From 746fc975621dc0538d0dcc6d4c8b3f17fc13fe3c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 30 十月 2023 13:24:43 +0800
Subject: [PATCH] 	modified:   src/api/equipment/equipment.js 	new file:   src/api/quality/rawMaterial.js 	modified:   src/api/technology/document.js 	new file:   src/const/crud/quality/rawMaterial.js 	modified:   src/router/views/index.js 	modified:   src/views/common/teststandardradio.vue 	modified:   src/views/equipment/equipment/index.vue 	modified:   src/views/plan/customerorder/customerorder-form.vue 	modified:   src/views/plan/customerorder/index.vue 	new file:   src/views/quality/rawMaterial/index.vue 	new file:   src/views/quality/rawMaterial/rawMaterial-form.vue 	modified:   src/views/technology/document/document-form.vue 	modified:   src/views/technology/operation/index.vue 	modified:   src/views/technology/operation/operation-form.vue 	modified:   src/views/technology/routing/index.vue 	modified:   src/views/technology/routing/routing-form.vue 	modified:   src/views/technology/structure/index.vue 	modified:   src/views/technology/structure/single-structure-form.vue 	modified:   vue.config.js

---
 src/views/technology/document/document-form.vue |  184 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 130 insertions(+), 54 deletions(-)

diff --git a/src/views/technology/document/document-form.vue b/src/views/technology/document/document-form.vue
index 81ffb96..95d7185 100644
--- a/src/views/technology/document/document-form.vue
+++ b/src/views/technology/document/document-form.vue
@@ -22,7 +22,7 @@
           label-width="110px"
         >
           <el-row>
-            <el-col :span="5">
+            <el-col :span="6">
               <el-form-item prop="name" label="鏂囦欢鍚嶇О">
                 <el-input
                   v-model="dataForm.name"
@@ -30,13 +30,13 @@
                 ></el-input>
               </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>
               </el-form-item>
             </el-col>
-            <el-col :span="4">
+            <!-- <el-col :span="4">
               <el-form-item prop="docType" label="绫诲瀷">
                 <el-select
                   v-model="dataForm.docType"
@@ -52,16 +52,8 @@
                   </el-option>
                 </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-col> -->
+            <!-- <el-col :span="3">
               <el-form-item prop="sheathColor" label="鎶ゅ棰滆壊">
                 <el-input
                   v-model="dataForm.sheathColor"
@@ -76,7 +68,7 @@
                   placeholder="缁濈紭棰滆壊"
                 ></el-input>
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <!-- <el-col :span="4">
               <el-form-item label="椤圭洰鍙�" prop="projectNo">
                 <el-input
@@ -108,9 +100,7 @@
                 <countrySelector v-model="dataForm.country"></countrySelector>
               </el-form-item>
             </el-col> -->
-          </el-row>
-          <el-row>
-            <el-col :span="5">
+            <el-col :span="6">
               <el-form-item label="浜у搧闆朵欢鍙�" prop="partNo">
                 <el-input v-model="dataForm.partNo" placeholder="璇烽�夋嫨闆朵欢">
                   <el-button
@@ -121,21 +111,65 @@
                 </el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="7">
+            <el-col :span="6">
               <el-form-item label="浜у搧闆朵欢鎻忚堪" prop="partName">
                 <el-input v-model="dataForm.partName" disabled> </el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="5">
-              <el-form-item label="澶囨敞" prop="remark">
-                <el-input
-                  type="textarea"
-                  v-model="dataForm.remark"
-                  placeholder="澶囨敞"
-                  style="width:360px"
-                ></el-input>
-              </el-form-item>
-            </el-col>
+          </el-row>
+          <el-row>
+              <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="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 +177,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"
           >
@@ -197,6 +231,8 @@
                   prop="operationName"
                   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>
@@ -307,8 +343,8 @@
                 </el-table-column>
               </el-table>
             </div>
-            <el-card class="document-bom" header="BOM-宸ュ簭鍙傛暟">
-              <div slot="header">
+            <el-card class="document-bom" header="">
+              <!-- <div slot="header">
                 <span>BOM-宸ュ簭鍙傛暟</span>
                 <el-tooltip
                   class="item"
@@ -339,7 +375,7 @@
                     >娣诲姞
                   </el-button>
                 </el-tooltip>
-              </div>
+              </div> -->
               <el-collapse
                 v-model="currTechnologyBomPartName"
                 accordion
@@ -367,7 +403,7 @@
                     </el-checkbox>
                   </template>
                   <div style="display:flex;">
-                    <div
+                    <!-- <div
                       style="font-size:13px;font-weight:bold;cursor: pointer;border-radius:2px 2px 0px 0px;width:80px;text-align:center;"
                       :class="[
                         item.showBom
@@ -377,21 +413,16 @@
                       @click="item.showBom = true"
                     >
                       BOM缁撴瀯
-                    </div>
+                    </div> -->
                     <div
                       style="font-size:13px;font-weight:bold;cursor: pointer;margin-left: 10px;border-radius:2px 2px 0px 0px;width:80px;text-align:center;"
-                      :class="[
-                        !item.showBom
-                          ? 'highlight-tab-class'
-                          : 'unhighlight-tab-class'
-                      ]"
-                      @click="item.showBom = false"
+                      :class="['highlight-tab-class']"
                     >
                       宸ュ簭鍙傛暟
                     </div>
                   </div>
-
-                  <div class="document-bom-div" v-show="item.showBom">
+ 
+                 <!-- <div class="document-bom-div" v-show="item.showBom">
                     <el-tooltip
                       class="item"
                       effect="dark"
@@ -428,8 +459,9 @@
                       <el-table-column prop="unit" label="鍗曚綅">
                       </el-table-column>
                     </el-table>
-                  </div>
-                  <div class="document-technology-div" v-show="!item.showBom">
+                  </div> -->
+
+                  <div class="document-technology-div" v-show="item.showBom">
                     <div
                       style="border: 1px solid #ebeef5;height: 440px;overflow: auto;"
                     >
@@ -483,14 +515,14 @@
                                 ></el-table-column>
                               </el-table>
                             </el-tab-pane>
-                            <el-tab-pane label="澶囨敞" style="height: 100%">
+                            <!-- <el-tab-pane label="澶囨敞" style="height: 100%">
                               <rich-text
                                 :editorId="
                                   'fwb' + item.id + '-' + ele.id + '-' + j
                                 "
                                 :richContent="ele.remark"
                               ></rich-text>
-                            </el-tab-pane>
+                            </el-tab-pane> -->
                             <el-tab-pane label="妫�娴嬫爣鍑�">
                               <checkStandardTable
                                 ref="documentTestStandardTable"
@@ -511,7 +543,7 @@
                                 "
                               ></checkStandardTable>
                             </el-tab-pane>
-                            <el-tab-pane label="鎶芥瑙勫垯">
+                            <!-- <el-tab-pane label="鎶芥瑙勫垯">
                               <div>
                                 <div style="padding: 0px 20px;">
                                   <el-button
@@ -594,7 +626,7 @@
                                   </el-table>
                                 </div>
                               </div>
-                            </el-tab-pane>
+                            </el-tab-pane> -->
                           </el-tabs>
                         </el-collapse-item>
                       </el-collapse>
@@ -604,7 +636,7 @@
               </el-collapse>
             </el-card>
           </el-tab-pane>
-          <el-tab-pane label="鍥剧墖涓婁紶" style="height: 100%">
+          <!-- <el-tab-pane label="鍥剧墖涓婁紶" style="height: 100%">
             <el-card class="document-structure">
               <div slot="header">
                 <span>缁撴瀯鍥�</span>
@@ -666,7 +698,7 @@
                 </el-select>
                 <div id="demo" style="margin:5px auto;"></div>
               </div>
-              <!--<el-upload
+              <el-upload
                               class="upload-demo"
                               action="/mes/document/uploadLct"
                               :headers="headers"
@@ -686,12 +718,12 @@
                               <div slot="tip" class="el-upload__tip">
                                 鍙兘涓婁紶jpg鍥剧墖锛屼笖涓嶈秴杩�2MB
                               </div>
-                            </el-upload>-->
+                            </el-upload>
               <el-dialog :visible.sync="dialogFlowVisible">
                 <img width="100%" :src="dialogFlowImageUrl" alt="" />
               </el-dialog>
             </el-card>
-          </el-tab-pane>
+          </el-tab-pane> -->
         </el-tabs>
       </div>
     </div>
@@ -746,6 +778,8 @@
 import { delDocumentSamplingRule } from '@/api/quality/documentsamplingrule'
 import { getObj as getTechnologyDetail } from '@/api/technology/routing'
 import { getObj as getStructureDetail } from '@/api/technology/completeproductstructure'
+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'
@@ -764,6 +798,8 @@
 export default {
   data() {
     return {
+      bomList: [],
+      routingList: [],
       operationPart: {},
       showCompleteproductstructure: false,
       showTechnology: false,
@@ -790,6 +826,8 @@
       ],
       dataForm: {
         id: null,
+        bomId: null,
+        routingId: null,
         number: null,
         name: null,
         version: null,
@@ -906,6 +944,43 @@
     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) => {
+          console.log(response)
+          this.routingList = response.data.data
+        })
+      } else {
+        this.routingList = []
+      }
+    },
   },
   methods: {
     // 鏌ヨ绫诲瀷瀛楀吀
@@ -1775,6 +1850,7 @@
         allKeyValues = allKeyValues.concat(keyValues)
         i = i + keyValues.length
       }
+      console.log("aaa--",allKeyValues)
       this.materialCostList = allKeyValues
     },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@@ -1914,8 +1990,8 @@
     },
     getSummaries(param) {
       const { columns, data } = param
-      console.log(columns, 'A')
-      console.log(data, 'B')
+      // console.log(columns, 'A')
+      // console.log(data, 'B')
       const sums = []
       columns.forEach((column, index) => {
         if (index === 0) {

--
Gitblit v1.9.3