From 0a3b4bac16a4cf49deaddc6b4f3a2aeee90e9061 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 21 五月 2024 16:33:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/technology/document/document-form.vue |  156 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 122 insertions(+), 34 deletions(-)

diff --git a/src/views/technology/document/document-form.vue b/src/views/technology/document/document-form.vue
index a6c7556..e101abb 100644
--- a/src/views/technology/document/document-form.vue
+++ b/src/views/technology/document/document-form.vue
@@ -7,11 +7,11 @@
         <h2 v-if="!editable">鏌ョ湅-宸ヨ壓鏂囦欢</h2>
       </div>
       <div class="btn-group header-right" v-if="editable">
-        <el-button @click="save()">淇濆瓨</el-button>
+        <el-button type="primary" @click="save()">淇濆瓨</el-button>
       </div>
     </div>
     <div class="page-main">
-      <div class="document-basic">
+      <div class="document-basic" style="height: 28%;">
         <el-form
           :model="dataForm"
           :rules="dataRule"
@@ -22,15 +22,17 @@
           label-width="110px"
         >
           <el-row>
-            <el-col :span="5">
+            <el-col :span="6">
               <el-form-item prop="name" label="鏂囦欢鍚嶇О">
+                <el-tooltip class="item" effect="dark" :content="dataForm.name" >
                 <el-input
                   v-model="dataForm.name"
                   placeholder="鏂囦欢鍚嶇О"
                 ></el-input>
+                </el-tooltip>
               </el-form-item>
             </el-col>
-            <el-col :span="4">
+            <el-col :span="6">
               <el-form-item prop="number" label="鏂囦欢缂栧彿">
                 <el-input v-model="dataForm.number" placeholder="鏂囦欢缂栧彿">
                 </el-input>
@@ -53,14 +55,6 @@
                 </el-select>
               </el-form-item>
             </el-col> -->
-            <el-col :span="3">
-              <el-form-item prop="version" label="鐗堟湰鍙�">
-                <el-input
-                  v-model="dataForm.version"
-                  placeholder="鐗堟湰鍙�"
-                ></el-input>
-              </el-form-item>
-            </el-col>
             <!-- <el-col :span="3">
               <el-form-item prop="sheathColor" label="鎶ゅ棰滆壊">
                 <el-input
@@ -110,7 +104,7 @@
             </el-col> -->
             <el-col :span="6">
               <el-form-item label="浜у搧闆朵欢鍙�" prop="partNo">
-                <el-input v-model="dataForm.partNo" placeholder="璇烽�夋嫨闆朵欢">
+                <el-input disabled v-model="dataForm.partNo" placeholder="璇烽�夋嫨闆朵欢">
                   <el-button
                     slot="append"
                     icon="el-icon-search"
@@ -121,21 +115,74 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="浜у搧闆朵欢鎻忚堪" prop="partName">
+                <el-tooltip class="item" effect="dark" :content="dataForm.partName" >
                 <el-input v-model="dataForm.partName" disabled> </el-input>
+                </el-tooltip>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="5">
-              <el-form-item label="澶囨敞" prop="remark">
+              <el-col :span="6">
+                <el-form-item prop="version" label="鐗堟湰鍙�">
+                  <el-input
+                    v-model="dataForm.version"
+                    placeholder="鐗堟湰鍙�"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="BOM" prop="bomId">
+                  <el-select
+                    :disabled="dataForm.id != null"
+                    v-model="dataForm.bomId"
+                    placeholder=""
+                    style="width: 100%;"
+                    filterable>
+                    <el-option
+                      v-for="item in bomList"
+                      :key="item.id"
+                      :label="item.number"
+                      :value="item.id"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="宸ヨ壓璺嚎缂栧彿" prop="routingList">
+                  <el-select
+                    :disabled="dataForm.id != null"
+                    v-model="dataForm.routingId"
+                    placeholder=""
+                    style="width: 100%;"
+                    filterable>
+                    <el-option
+                      v-for="item in routingList"
+                      :key="item.id"
+                      :label="item.routing_no"
+                      :value="item.id"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+              <el-form-item label="椤圭洰鍙�" prop="projectNo">
                 <el-input
-                  type="textarea"
-                  v-model="dataForm.remark"
-                  placeholder="澶囨敞"
-                  style="width:360px"
+                  v-model="dataForm.projectNo"
+                  placeholder="椤圭洰鍙�"
+                  style="width:100%"
                 ></el-input>
               </el-form-item>
             </el-col>
+              <el-col :span="6">
+                <el-form-item label="澶囨敞" prop="remark">
+                  <el-input
+                    type="textarea"
+                    v-model="dataForm.remark"
+                    placeholder="澶囨敞"
+                    style="width:100%"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
           </el-row>
         </el-form>
       </div>
@@ -143,7 +190,7 @@
       <div class="document-detail">
         <el-tabs type="card" style="width: 100%;height: 100%">
           <el-tab-pane
-            label="鍘熸潗鐢ㄩ噺"
+            label="鍘熸潗鏂欑敤閲�"
             style="height: 100%"
             class="orimaterial-quantity"
           >
@@ -198,6 +245,8 @@
                   align="center"
                 >
                 </el-table-column>
+                <el-table-column label="鐗╂枡缂栧彿" prop="partNo" align="center">
+                </el-table-column>
                 <el-table-column label="鐗╂枡" prop="partName" align="center">
                 </el-table-column>
                 <el-table-column label="鏁伴噺" prop="quantity" align="center">
@@ -214,12 +263,13 @@
           >
             <TeststandardDialog
               :editable="editable"
-              :documentId="Number(dataForm.id)"
+              :key="dataForm.id"
+              :documentId="dataForm.id"
             >
             </TeststandardDialog>
           </el-tab-pane>
           <el-tab-pane label="浜у搧缁撴瀯宸ュ簭鍙傛暟" style="height: 100%">
-            <!-- <div class="document-related-stock-part">
+            <div class="document-related-stock-part">
               <div
                 style="padding-left:18px;font-size:14px;font-weight:700;color:#000;height:20px;line-height:20px;"
               >
@@ -306,7 +356,7 @@
                 >
                 </el-table-column>
               </el-table>
-            </div> -->
+            </div>
             <el-card class="document-bom" header="">
               <!-- <div slot="header">
                 <span>BOM-宸ュ簭鍙傛暟</span>
@@ -385,7 +435,7 @@
                       宸ュ簭鍙傛暟
                     </div>
                   </div>
- 
+
                  <!-- <div class="document-bom-div" v-show="item.showBom">
                     <el-tooltip
                       class="item"
@@ -487,7 +537,7 @@
                                 :richContent="ele.remark"
                               ></rich-text>
                             </el-tab-pane> -->
-                            <el-tab-pane label="妫�娴嬫爣鍑�">
+                            <!-- <el-tab-pane label="妫�娴嬫爣鍑�">
                               <checkStandardTable
                                 ref="documentTestStandardTable"
                                 :dataFormId="dataForm.id"
@@ -506,7 +556,7 @@
                                   refreshTestStandardInfo
                                 "
                               ></checkStandardTable>
-                            </el-tab-pane>
+                            </el-tab-pane> -->
                             <!-- <el-tab-pane label="鎶芥瑙勫垯">
                               <div>
                                 <div style="padding: 0px 20px;">
@@ -737,12 +787,15 @@
   saveLctJson,
   getLctJson,
   routingChildCheck,
-  qryDocSamplingRule
+  qryDocSamplingRule,
+  getTestStandardParams
 } from '@/api/technology/document'
 import { delDocumentSamplingRule } from '@/api/quality/documentsamplingrule'
 import { getObj as getTechnologyDetail } from '@/api/technology/routing'
 import { getObj as getStructureDetail } from '@/api/technology/completeproductstructure'
-import { getTestStandardParams } from '@/api/quality/teststandard'
+import { fetchList as getBomList } from '@/api/technology/completeproductstructure'
+import { getRouting } from '@/api/technology/document'
+//import { getTestStandardParams } from '@/api/quality/teststandard'
 import { remote } from '@/api/admin/dict'
 import { fetchList as getStandard } from '@/api/quality/standardbind'
 import { getStore } from '@/util/store.js'
@@ -760,6 +813,8 @@
 export default {
   data() {
     return {
+      bomList: [],
+      routingList: [],
       operationPart: {},
       showCompleteproductstructure: false,
       showTechnology: false,
@@ -786,6 +841,8 @@
       ],
       dataForm: {
         id: null,
+        bomId: null,
+        routingId: null,
         number: null,
         name: null,
         version: null,
@@ -812,7 +869,7 @@
           { required: true, message: '鐗堟湰鍙蜂笉鑳戒负绌�', trigger: 'blur' }
         ],
         projectNo: [
-          { required: true, message: '椤圭洰鍙蜂笉鑳戒负绌�', trigger: 'blur' }
+          // { required: true, message: '椤圭洰鍙蜂笉鑳戒负绌�', trigger: 'blur' }
         ],
         projectType: [
           { required: true, message: '椤圭洰绫诲埆涓嶈兘涓虹┖', trigger: 'change' }
@@ -902,6 +959,42 @@
     window.winDbClick = this.getDbClick
     // 鍒濆鍖栨祦绋嬪浘瀹炰緥
     this.initFlowDesign()
+  },
+  watch: {
+    'dataForm.partId'(newValue, oldValue) {
+      if (oldValue) {
+        this.dataForm.bomId = null
+      }
+      if (newValue) {
+        getBomList(
+          Object.assign({
+            current: 1,
+            size: 999,
+            partId: this.dataForm.partId,
+          })
+        ).then((response) => {
+          this.bomList = response.data.data.records
+        })
+      } else {
+        this.bomList = []
+      }
+    },
+    'dataForm.bomId'(newValue, oldValue) {
+      if (oldValue) {
+        this.dataForm.routingId = null
+      }
+      if (newValue) {
+        getRouting(
+          Object.assign({
+            bomId: this.dataForm.bomId,
+          })
+        ).then((response) => {
+          this.routingList = response.data.data
+        })
+      } else {
+        this.routingList = []
+      }
+    },
   },
   methods: {
     // 鏌ヨ绫诲瀷瀛楀吀
@@ -1127,7 +1220,6 @@
         if (this.currTechnologyName != null && this.currTechnologyName !== '') {
           // 褰撶敤鎴峰垹闄ゅ伐鑹烘枃浠朵腑鍏宠仈鐨勫伐鑹鸿矾绾挎椂锛岃嫢璇ユ枃浠跺搴擝OM涓墍闇�鍗婃垚鍝佺殑宸ヨ壓璺嚎涔熷凡涓庡綋鍓嶅伐鑹烘枃浠跺叧鑱�
           routingChildCheck(this.currTechnologyBomPartName).then((res) => {
-            console.log('res', res.data)
             const resData = res.data
             let num = 0
             if (resData.code === 0) {
@@ -1824,7 +1916,6 @@
       if (this.dataForm.id) {
         this.getDocumentInfo(this.dataForm.id)
       }
-      console.log('涓婁紶鎴愬姛')
     },
     handleStructureExceed(files, fileList) {
       // this.$message.warning(
@@ -1866,7 +1957,6 @@
       this.dialogFlowVisible = true
     },
     handleFlowSuccess(response, file, fileList) {
-      console.log('涓婁紶鎴愬姛')
     },
     handleFlowExceed(files, fileList) {
       this.$message.warning(
@@ -1910,8 +2000,6 @@
     },
     getSummaries(param) {
       const { columns, data } = param
-      console.log(columns, 'A')
-      console.log(data, 'B')
       const sums = []
       columns.forEach((column, index) => {
         if (index === 0) {

--
Gitblit v1.9.3