From 4f94a66bc8ad9a57295f161de9195d5528b1d181 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 08 四月 2025 11:55:16 +0800
Subject: [PATCH] 基础数据维护+原辅材下单修改

---
 src/views/business/productSamplingInfo/components/addQuarterItem.vue |   85 +++++++++++++++++++++---------------------
 1 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/src/views/business/productSamplingInfo/components/addQuarterItem.vue b/src/views/business/productSamplingInfo/components/addQuarterItem.vue
index 57e3908..fa47685 100644
--- a/src/views/business/productSamplingInfo/components/addQuarterItem.vue
+++ b/src/views/business/productSamplingInfo/components/addQuarterItem.vue
@@ -1,8 +1,9 @@
 <template>
   <div>
-    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="quarterSampleDia" title="瀛e害鎶芥牱" width="90%" @close="quarterSampleDia = false">
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="quarterSampleDia"
+      title="鍙潬鎬ф娊鏍�" width="90%" @close="quarterSampleDia = false">
       <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
-        <div style="width: 30%;display: flex;align-items: center;" >
+        <div style="width: 30%;display: flex;align-items: center;">
           <span style="width: 50px">缂栧彿锛�</span>
           <el-input v-model="quarterSampleForm.quarterNo" :disabled="operationType !== 'add'" size="small"></el-input>
         </div>
@@ -13,11 +14,11 @@
       </div>
       <div>
         <el-table v-loading="tableLoading" :data="quarterItems" height="400" style="width: 100%"
-                  :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
+          :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
           <el-table-column label="浜у搧绫诲瀷" prop="productType" width="200">
             <template slot-scope="{row}">
               <template>
-                <el-input v-model="row.productType" size="small"/>
+                <el-input v-model="row.productType" size="small" />
               </template>
             </template>
           </el-table-column>
@@ -25,43 +26,37 @@
           <el-table-column label="鍨嬪彿" prop="productModel" width="120">
             <template slot-scope="{row}">
               <template>
-                <el-input v-model="row.productModel" size="small" :disabled="operationType === 'view'"/>
+                <el-input v-model="row.productModel" size="small" :disabled="operationType === 'view'" />
               </template>
             </template>
           </el-table-column>
           <el-table-column label="鎶芥牱鏁伴噺" min-width="340" prop="spotCheckNumber">
             <template slot-scope="{row}">
               <template>
-                <el-input v-model="row.spotCheckNumber" size="small" :disabled="operationType === 'view'"/>
+                <el-input v-model="row.spotCheckNumber" size="small" :disabled="operationType === 'view'" />
               </template>
             </template>
           </el-table-column>
           <el-table-column v-if="operationType === 'add'" label="鏁伴噺" min-width="120" prop="number">
             <template slot-scope="{row}">
               <template>
-                <el-input v-model="row.number" size="small" :disabled="operationType === 'view'"/>
+                <el-input v-model="row.number" size="small" :disabled="operationType === 'view'" />
               </template>
             </template>
           </el-table-column>
           <el-table-column v-if="operationType !== 'add'" label="鎶芥牱鏃堕棿" prop="spotCheckTime" width="160">
             <template slot-scope="{row}">
               <template>
-                <el-date-picker v-model="row.spotCheckTime"
-                                format="yyyy-MM-dd"
-                                :disabled="operationType === 'view'"
-                                placeholder="閫夋嫨鏃ユ湡"
-                                size="small"
-                                clearable
-                                style="width:100%"
-                                type="date"
-                                value-format="yyyy-MM-dd">
+                <el-date-picker v-model="row.spotCheckTime" format="yyyy-MM-dd" :disabled="operationType === 'view'"
+                  placeholder="閫夋嫨鏃ユ湡" size="small" clearable style="width:100%" type="date" value-format="yyyy-MM-dd">
                 </el-date-picker>
               </template>
             </template>
           </el-table-column>
           <el-table-column v-if="operationType !== 'add'" label="璇曟牱缁撹" prop="result" width="130">
             <template v-slot="scope">
-              <el-select v-model="scope.row.result" placeholder="璇烽�夋嫨" size="small" clearable :disabled="operationType === 'view'">
+              <el-select v-model="scope.row.result" placeholder="璇烽�夋嫨" size="small" clearable
+                :disabled="operationType === 'view'">
                 <el-option label="鍚堟牸" value="鍚堟牸"></el-option>
                 <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�"></el-option>
               </el-select>
@@ -70,54 +65,60 @@
           <el-table-column v-if="operationType !== 'add'" label="鍙栨牱浜哄憳" prop="samplingUser" width="120">
             <template slot-scope="{row}">
               <template>
-                <el-input v-model="row.samplingUser" size="small" :disabled="operationType === 'view'"/>
+                <el-input v-model="row.samplingUser" size="small" :disabled="operationType === 'view'" />
               </template>
             </template>
           </el-table-column>
           <el-table-column label="澶囨敞" prop="itemRemark" width="200">
             <template slot-scope="{row}">
               <template>
-                <el-input v-model="row.itemRemark" size="small" :disabled="operationType === 'view'"/>
+                <el-input v-model="row.itemRemark" size="small" :disabled="operationType === 'view'" />
               </template>
             </template>
           </el-table-column>
           <el-table-column v-if="operationType !== 'view'" fixed="right" label="鎿嶄綔" width="100">
             <template slot-scope="scope">
-              <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">鍒犻櫎</el-button>
+              <el-button size="small" style="color: #f56c6c" type="text"
+                @click="deleteScope(scope.$index)">鍒犻櫎</el-button>
             </template>
           </el-table-column>
         </el-table>
       </div>
       <div style="display: flex;align-items: center;margin: 10px 0">
         <span style="width: 70px">澶囨敞锛�</span>
-        <el-input v-model="quarterSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 43%" type="textarea"></el-input>
+        <el-input v-model="quarterSampleForm.remark" :disabled="operationType === 'view'" size="small"
+          style="width: 43%" type="textarea"></el-input>
       </div>
       <div v-if="operationType !== 'add'">
         <el-form ref="form" :model="editForm" label-width="70px">
           <el-col :span="12">
             <el-form-item label="缂栧埗浜猴細">
-              <el-select v-model="editForm.writeUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+              <el-select v-model="editForm.writeUser" :disabled="operationType !== 'edit'" placeholder="璇烽�夋嫨" size="small"
+                style="width: 100%">
                 <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="浼氱浜猴細">
-              <el-select v-model="editForm.countersignUser" :disabled="operationType !=='edit'" multiple placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+              <el-select v-model="editForm.countersignUser" :disabled="operationType !== 'edit'" multiple
+                placeholder="璇烽�夋嫨" size="small" style="width: 100%">
                 <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="瀹℃牳浜猴細">
-              <el-select v-model="editForm.examineUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+              <el-select v-model="editForm.examineUser" :disabled="operationType !== 'edit'" placeholder="璇烽�夋嫨"
+                size="small" style="width: 100%">
                 <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="鎵瑰噯浜猴細">
-              <el-select v-model="editForm.ratifyUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+              <el-select v-model="editForm.ratifyUser" :disabled="operationType !== 'edit'" placeholder="璇烽�夋嫨"
+                size="small" style="width: 100%">
                 <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
@@ -127,15 +128,16 @@
       <span slot="footer" class="dialog-footer">
         <el-button @click="quarterSampleDia = false">鍙� 娑�</el-button>
         <el-button v-if="operationType === 'add'" @click="quarterSampleDia = false">淇� 瀛�</el-button>
-        <el-button v-if="operationType !== 'add' && operationType !== 'view'" type="primary" @click="handleSample">纭� 瀹�</el-button>
+        <el-button v-if="operationType !== 'add' && operationType !== 'view'" type="primary" @click="handleSample">纭�
+          瀹�</el-button>
       </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import {addQuarter, getQuarter, updateQuarterOnOrder} from "@/api/business/productSamplingInfo";
-import {selectUserCondition} from "@/api/performance/class";
+import { addQuarter, getQuarter, updateQuarterOnOrder } from "@/api/business/productSamplingInfo";
+import { selectUserCondition } from "@/api/performance/class";
 
 export default {
   name: "addQuarterItem",
@@ -145,7 +147,7 @@
     // 杩欓噷瀛樻斁鏁版嵁
     return {
       tableLoading: false,
-      quarterSampleDia: false, // 瀛e害鎶芥牱寮规
+      quarterSampleDia: false, // 鍙潬鎬ф娊鏍峰脊妗�
       quarterSampleForm: {
         quarterNo: '', // 缂栧彿
       },
@@ -168,7 +170,7 @@
   },
   // 鏂规硶闆嗗悎
   methods: {
-    openDia (quarterTemItems, type) {
+    openDia(quarterTemItems, type) {
       this.quarterSampleDia = true
       this.operationType = type
       if (type === 'add') {
@@ -179,7 +181,7 @@
       } else {
         this.tableLoading = true
         this.quarterRow = quarterTemItems
-        getQuarter({quarterId: quarterTemItems.quarterId}).then(res => {
+        getQuarter({ quarterId: quarterTemItems.quarterId }).then(res => {
           this.tableLoading = false
           if (res.code === 200) {
             this.quarterItems = res.data.quarterItems
@@ -197,7 +199,7 @@
       }
     },
     // 鎵嬪姩娣诲姞
-    addQuarter () {
+    addQuarter() {
       this.quarterItems.push({
         productType: '',
         dutyUser: JSON.parse(localStorage.getItem("user")).name,
@@ -210,8 +212,8 @@
         itemRemark: '',
       })
     },
-    // 鎻愪氦瀛e害鎶芥牱
-    handleSample () {
+    // 鎻愪氦鍙潬鎬ф娊鏍�
+    handleSample() {
       this.$confirm('鏄惁鎻愪氦璇ユ暟鎹�', '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -231,7 +233,7 @@
             }
           })
         } else {
-          const params = {...this.editForm}
+          const params = { ...this.editForm }
           if (params.countersignUser.length > 0) {
             params.countersignUser = params.countersignUser.join(',')
           } else {
@@ -255,16 +257,16 @@
 
     },
     // 娓呯┖鎶芥牱璁″垝
-    clearTable () {
+    clearTable() {
       this.quarterItems = []
       this.$parent.quarterTemItems = []
     },
     // 鎵嬪姩鍒犻櫎
-    deleteScope (index) {
+    deleteScope(index) {
       this.quarterItems.splice(index, 1)
     },
-    // 鍏抽棴瀛e害鎶芥牱寮规
-    closeQuarterSampleDia () {
+    // 鍏抽棴鍙潬鎬ф娊鏍峰脊妗�
+    closeQuarterSampleDia() {
       this.quarterSampleDia = false
       if (this.operationType === 'add') {
         this.$parent.handleStockList()
@@ -272,7 +274,7 @@
         this.$parent.refreshTable()
       }
     },
-    getUserList(){
+    getUserList() {
       selectUserCondition().then((res) => {
         this.userList = res.data;
       })
@@ -287,5 +289,4 @@
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

--
Gitblit v1.9.3