From 56ce6140130c265f024e79060b5dc449447e60aa Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 12 十月 2022 13:25:58 +0800
Subject: [PATCH] 1.物料清单页面开发完成

---
 src/views/sbgl/djbw.vue  |    2 
 src/views/zzmx/chda.vue  |    2 
 src/views/sbgl/bybz.vue  |    2 
 src/views/scgl/scdd.vue  |    4 
 src/api/zzmx.js          |   67 +++
 src/views/zzmx/wlqd.vue  | 1145 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/views/scgl/sckbg.vue |   11 
 src/views/sbgl/djbz.vue  |    2 
 src/views/template.vue   |   63 ++
 src/views/sbgl/bybw.vue  |    2 
 10 files changed, 1,267 insertions(+), 33 deletions(-)

diff --git a/src/api/zzmx.js b/src/api/zzmx.js
index b397af9..e9154a7 100644
--- a/src/api/zzmx.js
+++ b/src/api/zzmx.js
@@ -43,6 +43,7 @@
     params: data
   })
 }
+
 // 鍗曚綅鏂板
 export function UomAdd(data) {
   return request({
@@ -51,6 +52,7 @@
     data
   })
 }
+
 // 鍗曚綅鍒犻櫎
 export function UomDelete(data) {
   return request({
@@ -59,6 +61,7 @@
     params: data
   })
 }
+
 // 瀛樼被鍨嬫煡鎵剧墿鏂欑被鍨�
 export function StockTypeSelectMaterialType(data) {
   return request({
@@ -67,6 +70,7 @@
     params: data
   })
 }
+
 // 瀛樿揣妗f鏌ヨ
 export function InventoryFileSelect(data) {
   return request({
@@ -84,6 +88,7 @@
     data
   })
 }
+
 // 瀛樿揣妗f鍒犻櫎
 export function DeleteInventoryFile(data) {
   return request({
@@ -92,6 +97,7 @@
     params: data
   })
 }
+
 // 瀛樿揣妗f鍏宠仈宸ヨ壓璺嚎鏌ヨ
 export function InventoryFileAssociationRoute(data) {
   return request({
@@ -100,6 +106,7 @@
     params: data
   })
 }
+
 // 瀛樿揣妗f鍏宠仈宸ヨ壓璺嚎鎻愪氦
 export function SaveInventoryFile(partcode, defaultroute_code, data) {
   return request({
@@ -108,6 +115,7 @@
     data
   })
 }
+
 // 宸ヨ壓璺嚎鏌ヨ
 export function RouteSearch(data) {
   return request({
@@ -116,6 +124,7 @@
     params: data
   })
 }
+
 // 宸ヨ壓璺嚎棰勮
 export function ViewRoute(data) {
   return request({
@@ -124,6 +133,7 @@
     params: data
   })
 }
+
 // 宸ヨ壓璺嚎鏂板缂栬緫
 export function AddUpdateRoute(id, opertype, data) {
   return request({
@@ -141,6 +151,7 @@
     params: data
   })
 }
+
 // 宸ュ簭鏌ヨ
 export function StepSearch(data) {
   return request({
@@ -149,6 +160,7 @@
     params: data
   })
 }
+
 // 宸ュ簭鏂板缂栬緫
 export function AddUpdateStep(data) {
   return request({
@@ -157,6 +169,7 @@
     data
   })
 }
+
 // 宸ュ簭鍒犻櫎
 export function DeleteStep(data) {
   return request({
@@ -174,6 +187,7 @@
     params: data
   })
 }
+
 // 宸ュ簭瀹氫箟鍏宠仈宸ヤ綔绔欐彁浜�
 export function SaveStepAssociationEqp(stepcode, data) {
   return request({
@@ -182,6 +196,7 @@
     data
   })
 }
+
 // 宸ュ簭鍏宠仈缂洪櫡鏌ヨ
 export function StepAssociationDefect(data) {
   return request({
@@ -190,6 +205,7 @@
     params: data
   })
 }
+
 // 宸ュ簭鍏宠仈缂洪櫡鎻愪氦
 export function SaveStepAssociationDefect(stepcode, data) {
   return request({
@@ -198,6 +214,7 @@
     data
   })
 }
+
 // 浜у搧淇℃伅涓嬫媺妗嗘煡璇�
 export function PartSelect() {
   return request({
@@ -205,6 +222,7 @@
     method: 'get'
   })
 }
+
 // 浜у搧缂栫爜鏌ユ壘宸ヨ壓璺嚎涓嬫媺妗�
 export function PartSelectRpute(data) {
   return request({
@@ -213,6 +231,7 @@
     params: data
   })
 }
+
 // 鏍规嵁宸ヨ壓璺嚎缂栫爜鏌ユ壘鍏宠仈宸ュ簭闆嗗悎
 export function RouteSelectStep(data) {
   return request({
@@ -221,6 +240,7 @@
     params: data
   })
 }
+
 // 鏍规嵁宸ュ簭绾跨紪鐮佹煡鎵惧叧鑱旇澶囬泦鍚�
 export function StepSelectEqp(data) {
   return request({
@@ -229,6 +249,7 @@
     params: data
   })
 }
+
 // 鏍规嵁宸ュ簭绾跨紪鐮佹煡鎵惧叧鑱旇澶囧垪琛ㄩ泦鍚�
 export function StepSelectEqpList(data) {
   return request({
@@ -237,6 +258,7 @@
     params: data
   })
 }
+
 // 鑺傛媿宸ヤ环鏌ヨ
 export function BeatRateSearch(data) {
   return request({
@@ -245,6 +267,7 @@
     params: data
   })
 }
+
 // 鑺傛媿宸ヤ环鎻愪氦
 export function SaveBeatRate(data) {
   return request({
@@ -253,6 +276,7 @@
     data
   })
 }
+
 // 鑺傛媿宸ヤ环鍒犻櫎
 export function DeleteBeatRate(data) {
   return request({
@@ -269,6 +293,7 @@
     method: 'get'
   })
 }
+
 // 宸ヨ壓璺嚎宸ヨ壓璁剧疆涓嬫媺
 export function StepSelect() {
   return request({
@@ -276,3 +301,45 @@
     method: 'get'
   })
 }
+
+// 鐗╂枡娓呭崟涓诲垪琛ㄦ煡璇�
+export function BoIventorySelect(data) {
+  return request({
+    url: 'ProductModel/BoIventorySelect',
+    method: 'get',
+    params: data
+  })
+}
+
+// 鐗╂枡娓呭崟缂栬緫鏄剧ず鍙婇瑙�
+export function BoIventorySelectView(data) {
+  return request({
+    url: 'ProductModel/BoIventorySelectView',
+    method: 'get',
+    params: data
+  })
+}
+// 鐗╂枡娓呭崟鏂板/缂栬緫鎻愪氦
+export function AddUpdateBoIventory(data) {
+  return request({
+    url: 'ProductModel/AddUpdateBoIventory',
+    method: 'post',
+    data
+  })
+}
+// 鐗╂枡娓呭崟鏂板鏃惰幏鍙栨渶澶х増鏈彿
+export function MaterielDetailedVsion(data) {
+  return request({
+    url: 'ProductModel/MaterielDetailedVsion',
+    method: 'get',
+    params: data
+  })
+}
+// 鐗╂枡娓呭崟鍒犻櫎
+export function DeleteBoIventory(data) {
+  return request({
+    url: 'ProductModel/DeleteBoIventory',
+    method: 'post',
+    params: data
+  })
+}
diff --git a/src/views/sbgl/bybw.vue b/src/views/sbgl/bybw.vue
index bda6be2..63e8240 100644
--- a/src/views/sbgl/bybw.vue
+++ b/src/views/sbgl/bybw.vue
@@ -3,7 +3,7 @@
     <div class="body" :style="{height:mainHeight+'px'}">
       <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+        <!--        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
       </div>
 
       <div class="bodyTopFormGroup">
diff --git a/src/views/sbgl/bybz.vue b/src/views/sbgl/bybz.vue
index fe0ea0e..9a1491e 100644
--- a/src/views/sbgl/bybz.vue
+++ b/src/views/sbgl/bybz.vue
@@ -3,7 +3,7 @@
     <div class="body" :style="{height:mainHeight+'px'}">
       <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+        <!--        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
       </div>
 
       <div class="bodyTopFormGroup">
diff --git a/src/views/sbgl/djbw.vue b/src/views/sbgl/djbw.vue
index a48882a..d7926bf 100644
--- a/src/views/sbgl/djbw.vue
+++ b/src/views/sbgl/djbw.vue
@@ -3,7 +3,7 @@
     <div class="body" :style="{height:mainHeight+'px'}">
       <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+        <!--        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
       </div>
 
       <div class="bodyTopFormGroup">
diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index 82a4437..06223a2 100644
--- a/src/views/sbgl/djbz.vue
+++ b/src/views/sbgl/djbz.vue
@@ -3,7 +3,7 @@
     <div class="body" :style="{height:mainHeight+'px'}">
       <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+        <!--        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
       </div>
 
       <div class="bodyTopFormGroup">
diff --git a/src/views/scgl/scdd.vue b/src/views/scgl/scdd.vue
index 36bd953..a744515 100644
--- a/src/views/scgl/scdd.vue
+++ b/src/views/scgl/scdd.vue
@@ -55,7 +55,7 @@
             <el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style=" display: flex;">
               <el-input v-model="form.creatuser" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
-            <el-form-item v-show="isExpandForm" label="棰勮寮�宸ユ椂闂�" label-width="100px" style=" line-height: 40px;;display: flex;font-size: 14px;">
+            <el-form-item v-show="isExpandForm" label="棰勮寮�宸ユ椂闂�" label-width="100px" style="display: flex;font-size: 14px;align-items: center">
               <el-date-picker
                 v-model="form.paystartdate"
                 type="daterange"
@@ -71,7 +71,7 @@
               <!--              :picker-options="expireTimeOption"-->
 
             </el-form-item>
-            <el-form-item v-show="isExpandForm" label="棰勮瀹屽伐鏃堕棿" label-width="100px" style=" display: flex;font-size: 14px;">
+            <el-form-item v-show="isExpandForm" label="棰勮瀹屽伐鏃堕棿" label-width="100px" style=" display: flex;font-size: 14px;align-items: center">
               <el-date-picker
                 v-model="form.payenddate"
                 type="daterange"
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 265672a..cafa374 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -1991,14 +1991,12 @@
             }
             SavaMesOrderStepIn(data).then(res => {
               if (res.code === '200') {
+                this.dialogVisible = false
                 this.$message.success('鏀舵枡鎴愬姛锛�')
-
                 if (this.dialogForm.nextstepcode === '') {
                   this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
                   this.dialogVisible2 = true
                 }
-                this.dialogVisible = false
-
                 this.tabClick()
                 this.$store.state.app.buttonIsDisabled = false
               } else {
@@ -2019,8 +2017,8 @@
             }
             SavaMesOrderStepStart(data).then(res => {
               if (res.code === '200') {
-                this.$message.success('寮�宸ユ垚鍔燂紒')
                 this.dialogVisible = false
+                this.$message.success('寮�宸ユ垚鍔燂紒')
                 this.tabClick()
                 this.$store.state.app.buttonIsDisabled = false
               } else {
@@ -2070,15 +2068,14 @@
 
             SavaMesOrderStepReport(data).then(res => {
               if (res.code === '200') {
+                this.dialogVisible = false
                 this.$message.success('鎶ュ伐鎴愬姛锛�')
-
                 if (this.dialogForm.nextstepcode === '') {
                   this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
                   this.dialogVisible2 = true
-                  this.$store.state.app.buttonIsDisabled = false
                 }
-                this.dialogVisible = false
                 this.tabClick()
+                this.$store.state.app.buttonIsDisabled = false
               } else {
                 this.$message.error('鎶ュ伐澶辫触!')
               }
diff --git a/src/views/template.vue b/src/views/template.vue
index 3baf0a0..f03e9f5 100644
--- a/src/views/template.vue
+++ b/src/views/template.vue
@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
-      <div class="bodyTopButtonGroup">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
         <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
       </div>
@@ -10,18 +10,21 @@
         <el-form
           ref="form"
           :model="form"
-          label-width="80px"
+          label-width="100px"
           inline
           style="display: flex;justify-content: space-between"
         >
-          <div class="elForm">
-            <el-form-item label="缁勭粐缂栫爜" style=" display: flex;">
+          <div class="elForm" style="justify-content: flex-start">
+            <el-form-item label-width="70px" label="姣嶄欢缂栫爜" style=" display: flex;">
               <el-input v-model="form.OrgCode" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
-            <el-form-item label="缁勭粐鍚嶇О" style=" display: flex;">
+            <el-form-item label="姣嶄欢鍚嶇О" style=" display: flex;">
               <el-input v-model="form.OrgName" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
-            <el-form-item label="缁勭粐绫诲瀷" style=" display: flex;">
+            <el-form-item label="姣嶄欢瑙勬牸" style=" display: flex;">
+              <el-input v-model="form.OrgName" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="鍚敤鐘舵��" style=" display: flex;">
               <el-select v-model="form.OrgType" style="width: 200px" placeholder="璇烽�夋嫨">
                 <el-option
                   v-for="item in OrgTypeArr"
@@ -31,15 +34,43 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item label="鍒涘缓浜哄憳" style=" display: flex;">
+            <el-form-item v-show="isExpandForm" label-width="70px" label="鐗堟湰缂栧彿" style=" display: flex;">
+              <el-input v-model="form.OrgName" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style=" display: flex;">
               <el-input v-model="form.UserName" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍒涘缓鏃ユ湡" style=" display: flex;">
+              <el-date-picker
+                v-model="form.createdate"
+                style="width: 200px"
+                type="date"
+                placeholder="閫夋嫨鏃ユ湡"
+              />
+            </el-form-item>
           </div>
-          <div class="bodySearchReset">
+          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
             <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
             <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
+        <div
+          class="bodyTopFormExpand"
+        >
+          <svg-icon
+            v-show="mouseHoverType==='mouseout'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+            @mouseenter="mouseHoverType=$event.type"
+          />
+          <svg-icon
+            v-show="mouseHoverType==='mouseenter'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+            @click="isExpandForm=!isExpandForm"
+            @mouseout="mouseHoverType=$event.type"
+          />
+        </div>
       </div>
 
       <div class="elTableDiv">
@@ -47,10 +78,10 @@
           ref="tableDataRef"
           class="tableFixed"
           :data="tableData"
-          :height="tableHeight+'px'"
+          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
           border
           :row-class-name="tableRowClassName"
-          :style="{width: 100+'%',height:tableHeight+'px',}"
+          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
@@ -183,6 +214,8 @@
   },
   data() {
     return {
+      mouseHoverType: 'mouseout',
+      isExpandForm: false,
       mainHeight: 0,
       tableHeight: 0,
       form: {
@@ -190,17 +223,15 @@
         OrgName: '', // 缁勭粐鏋舵瀯鍚嶇О
         OrgType: '', // 缁勭粐绫诲瀷
         UserName: '', // 鍒涘缓浜哄憳
+        createdate: '',
         prop: 'lm_date', // 鎺掑簭瀛楁
         order: 'desc', // 鎺掑簭瀛楁
         page: 1, // 绗嚑椤�
         rows: 20 // 姣忛〉澶氬皯鏉�
       },
       OrgTypeArr: [
-        { label: '宸ュ巶', value: 'F' },
-        { label: '閮ㄩ棬', value: 'D' },
-        { label: '杞﹂棿', value: 'W' },
-        { label: '绉戝', value: 'K' },
-        { label: '鐢熶骇绾�', value: 'L' }
+        { label: '鏄�', value: 'Y' },
+        { label: '鍚�', value: 'N' }
       ],
 
       total: 10,
@@ -360,7 +391,7 @@
     getHeight() {
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 85
-        this.tableHeight = this.mainHeight - 200
+        this.tableHeight = this.mainHeight - 255
         this.$refs.tableDataRef.doLayout()
       })
     },
diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index a77a8cd..1916029 100644
--- a/src/views/zzmx/chda.vue
+++ b/src/views/zzmx/chda.vue
@@ -513,7 +513,7 @@
       title="鍏宠仈宸ヨ壓璺嚎"
       :visible.sync="dialogVisibleRoute"
       width="800px"
-      top="10vh"
+      top="5vh"
       :fullscreen="isIpad"
       class="dialogVisibleRoute"
       @closed="handleCloseRoute"
diff --git a/src/views/zzmx/wlqd.vue b/src/views/zzmx/wlqd.vue
index 4e1ab00..ff35bc9 100644
--- a/src/views/zzmx/wlqd.vue
+++ b/src/views/zzmx/wlqd.vue
@@ -1,11 +1,1150 @@
-<template />
+<template>
+  <div>
+    <div class="body" :style="{height:mainHeight+'px'}">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
+        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+        <!--        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
+      </div>
+
+      <div class="bodyTopFormGroup">
+        <el-form
+          ref="form"
+          :model="form"
+          label-width="100px"
+          inline
+          style="display: flex;justify-content: space-between"
+        >
+          <div class="elForm">
+            <el-form-item label-width="70px" label="姣嶄欢缂栫爜" style=" display: flex;">
+              <el-input v-model="form.parentpartcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="姣嶄欢鍚嶇О" style=" display: flex;">
+              <el-input v-model="form.parentpartname" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="姣嶄欢瑙勬牸" style=" display: flex;">
+              <el-input v-model="form.parentpartspec" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="瀛樿揣绫诲瀷" style=" display: flex;">
+              <el-select v-model="form.parttype" style="width: 200px" placeholder="璇烽�夋嫨">
+                <el-option
+                  v-for="item in parttypeArr"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label-width="70px" label="鐗堟湰缂栧彿" style=" display: flex;">
+              <el-input v-model="form.version" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style=" display: flex;">
+              <el-input v-model="form.createusername" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍒涘缓鏃ユ湡" style=" display: flex;align-items: center">
+              <el-date-picker
+                v-model="form.createdate"
+                type="daterange"
+                :clearable="false"
+                class="timeMini"
+                range-separator="~"
+                start-placeholder="寮�濮嬫棩鏈�"
+                style="width: 200px;display: flex;line-height: 34px ;height: 34px ;"
+                end-placeholder="缁撴潫鏃ユ湡"
+                size="mini"
+              />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍚敤鐘舵��" style=" display: flex;">
+              <el-select v-model="form.status" style="width: 200px" placeholder="璇烽�夋嫨">
+                <el-option
+                  v-for="item in openTypeArr"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+          </div>
+          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
+            <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+            <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+          </div>
+        </el-form>
+        <div
+          class="bodyTopFormExpand"
+        >
+          <svg-icon
+            v-show="mouseHoverType==='mouseout'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+            @mouseenter="mouseHoverType=$event.type"
+          />
+          <svg-icon
+            v-show="mouseHoverType==='mouseenter'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+            @click="isExpandForm=!isExpandForm"
+            @mouseout="mouseHoverType=$event.type"
+          />
+        </div>
+      </div>
+
+      <div class="elTableDiv">
+        <el-table
+          ref="tableDataRef"
+          class="tableFixed"
+          :data="tableData"
+          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
+          border
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @sort-change="sortChange"
+        >
+          <el-table-column
+            prop="RowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="partcode"
+            label="姣嶄欢缂栫爜"
+            min-width="160"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="partname"
+            label="姣嶄欢鍚嶇О"
+            min-width="160"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="partspec"
+            label="姣嶄欢瑙勬牸"
+            min-width="160"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="stocktype_name"
+            label="瀛樿揣绫诲瀷"
+            width="110"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="uom_name"
+            label="璁¢噺鍗曚綅"
+            width="110"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="quantity"
+            label="鍩虹鏁伴噺"
+            width="110"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="status"
+            width="110"
+            show-tooltip-when-overflow
+            label="鍚敤鐘舵��"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.status==='Y'">
+                <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+                鏄�
+              </div>
+              <div v-if="row.status==='N'">
+                <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+                鍚�
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="startdate"
+            label="鍚敤鏃ユ湡"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.startdate">{{ row.startdate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="version"
+            label="鐗堟湰鍙�"
+            width="110"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="username"
+            label="鍒涘缓浜哄憳"
+            width="110"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="lm_date"
+            label="鍒涘缓鏃堕棿"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鎿嶄綔"
+            width="120"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+                </el-tooltip>
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+                  <i class="el-icon-delete" @click="del(row)" />
+                </el-tooltip>
+                <el-tooltip class="item" effect="dark" content="棰勮" placement="top">
+                  <i
+                    class="el-icon-view"
+                    style="margin-left:15px;cursor: pointer;color:#42b983  "
+                    @click="edit('preview',row)"
+                  />
+                </el-tooltip>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!--鍒嗛〉-->
+      <pagination
+        :total="total"
+        :page.sync="form.page"
+        :limit.sync="form.rows"
+        align="right"
+        layout="total,prev, pager, next,sizes"
+        popper-class="select_bottom"
+        @pagination="getBoIventorySelect"
+      />
+    </div>
+
+    <el-dialog
+      :title="operation==='add'?'鏂板':(operation==='edit'?'缂栬緫':'棰勮')"
+      :visible.sync="dialogVisible"
+      width="1100px"
+      :close-on-click-modal="false"
+      top="5vh"
+      @closed="handleClose"
+      @close="handleClose"
+    >
+      <div>
+        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />姣嶄欢淇℃伅锛�
+      </div>
+      <div style="width: 800px;">
+        <el-form
+          ref="dialogForm"
+          inline
+          :rules="dialogFormRules"
+          :model="dialogForm"
+          label-width="80px"
+          style="margin-left: 20px;"
+        >
+          <el-form-item label="姣嶄欢缂栫爜" prop="parentpartcode">
+            <el-select
+              v-model="dialogForm.parentpartcode"
+              style="width: 200px"
+              placeholder="璇烽�夋嫨"
+              :popper-append-to-body="false"
+              :disabled="operation!=='add'"
+              @change="partSelectChange"
+            >
+              <el-option
+                v-for="item in PartSelectArr"
+                :key="item.partcode"
+                :label="item.partcode"
+                :value="item.partcode"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="姣嶄欢鍚嶇О" prop="parentpartname">
+            <el-select
+              v-model="dialogForm.parentpartname"
+              style="width: 200px"
+              placeholder="璇烽�夋嫨"
+              :disabled="operation!=='add'"
+              :popper-append-to-body="false"
+              @change="partSelectChange"
+            >
+              <el-option
+                v-for="item in PartSelectArr"
+                :key="item.partcode"
+                :label="item.partname"
+                :value="item.partcode"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="姣嶄欢瑙勬牸" prop="parentpartspec">
+            <el-input v-model="dialogForm.parentpartspec" disabled style="width: 200px" />
+            <!--          <el-select-->
+            <!--            v-model="dialogForm.parentpartspec"-->
+            <!--            style="width: 200px"-->
+            <!--            placeholder="璇烽�夋嫨"-->
+            <!--            :popper-append-to-body="false"-->
+            <!--          >-->
+            <!--            <el-option-->
+            <!--              v-for="item in PartSelectArr"-->
+            <!--              :key="item.partcode"-->
+            <!--              :label="item.partcode"-->
+            <!--              :value="item.partcode"-->
+            <!--            />-->
+            <!--          </el-select>-->
+          </el-form-item>
+          <el-form-item label="璁¢噺鍗曚綅" prop="uomcode">
+            <el-select
+              v-model="dialogForm.uomcode"
+              disabled
+              style="width: 200px"
+              placeholder="璇烽�夋嫨"
+              :popper-append-to-body="false"
+            >
+              <el-option
+                v-for="item in openTypeArr"
+                :key="item.partcode"
+                :label="item.uom_code"
+                :value="item.partcode"
+              />
+            </el-select>
+            <!--            <el-input v-model="dialogForm.uomcode" readonly style="width: 200px" />-->
+          </el-form-item>
+          <!--          <el-form-item label="瀛樿揣绫诲瀷" prop="uomcode">-->
+          <!--            <el-input v-model="dialogForm.chlx" readonly style="width: 200px" />-->
+          <!--          </el-form-item>-->
+          <el-form-item label="鍩虹鏁伴噺" prop="quantity">
+            <el-input
+              v-model="dialogForm.quantity"
+              :disabled="operation==='preview'"
+              oninput="value=value.replace(/[^0-9.]/g,'')"
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item prop="status" label="鍚敤鐘舵��">
+            <el-select
+              v-model="dialogForm.status"
+              style="width: 200px"
+              placeholder="璇烽�夋嫨"
+              :disabled="operation==='preview'"
+              :popper-append-to-body="false"
+            >
+              <el-option
+                v-for="item in openTypeArr"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="鍚敤鏃ユ湡" prop="startdate">
+            <el-date-picker
+              v-model="dialogForm.startdate"
+              style="width: 200px"
+              type="date"
+              :disabled="operation!=='add'"
+              value-format="yyyy-MM-dd"
+              :clearable="false"
+              placeholder="閫夋嫨鏃ユ湡"
+            />
+          </el-form-item>
+          <el-form-item label="鐗堟湰鍙�" prop="version">
+            <el-input v-model="dialogForm.version" disabled style="width: 200px" />
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <div>
+        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 10px 0" />瀛愪欢淇℃伅锛�
+      </div>
+      <el-button
+        v-if="operation!=='preview'"
+        type="primary"
+        style="margin-left: 20px;margin-bottom: 10px;"
+        icon="el-icon-circle-plus-outline"
+        :disabled="dialogForm.parentpartcode===''"
+        @click="addDialog()"
+      >鏂板
+      </el-button>
+      <el-table
+        ref="dialogTableDataArrRef"
+        class="tableFixed"
+        :data="dialogTableDataArr"
+        :height="tableHeight-300"
+        :style="{width: 100+'%',height:tableHeight-300+'px',}"
+        border
+        :row-class-name="tableRowClassName"
+        highlight-current-row
+        :header-cell-style="this.$headerCellStyle"
+        :cell-style="this.$cellStyle"
+      >
+        <el-table-column
+          width="50"
+          label="琛屽彿"
+          prop="SEQ"
+          fixed
+        />
+        <el-table-column
+          prop="SMATERIRL_CODE"
+          label="瀛愪欢缂栫爜"
+          show-tooltip-when-overflow
+        >
+          <template slot-scope="{row}">
+            <el-select
+              v-if="row.isVisible===1"
+              v-model="row.SMATERIRL_CODE"
+              placeholder="璇烽�夋嫨"
+              @change="val=>tableChange(val,row)"
+            >
+              <el-option
+                v-for="item in PartSelectArr"
+                :key="item.partname"
+                :label="item.partcode"
+                :value="item.partname"
+              />
+            </el-select>
+            <div v-if="row.isVisible===0">{{ row.SMATERIRL_CODE }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="SMATERIRL_NAME"
+          label="瀛愪欢鍚嶇О"
+
+          show-tooltip-when-overflow
+        >
+
+          <template slot-scope="{row}">
+            <el-select
+              v-if="row.isVisible===1"
+              v-model="row.SMATERIRL_NAME"
+              placeholder="璇烽�夋嫨"
+              @change="val=>tableChange(val,row)"
+            >
+              <el-option
+                v-for="item in PartSelectArr"
+                :key="item.partcode"
+                :label="item.partname"
+                :value="item.partcode"
+              />
+            </el-select>
+            <div v-if="row.isVisible===0">{{ row.SMATERIRL_NAME }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="SMATERIRL_SPEC"
+          label="瀛愪欢瑙勬牸"
+          width="110"
+          show-tooltip-when-overflow
+        />
+        <el-table-column
+          prop="uomcode"
+          label="璁¢噺鍗曚綅"
+          width="110"
+        />
+        <el-table-column
+          prop="BASE_QUANTITY"
+          label="鍩烘湰鐢ㄩ噺"
+          width="110"
+        >
+          <template slot-scope="{row}">
+            <el-input
+              v-if="row.isVisible===1"
+              v-model="row.BASE_QUANTITY"
+              oninput="value=value.replace(/[^0-9.]/g,'')"
+              placeholder="璇疯緭鍏�"
+              @input="val=>inputChange(val,row)"
+            />
+            <div v-if="row.isVisible===0">{{ row.BASE_QUANTITY }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="LOSS_QUANTITY"
+          label="鎹熻�楃巼%"
+          width="110"
+        >
+          <template slot-scope="{row}">
+            <el-input
+              v-if="row.isVisible===1"
+              v-model="row.LOSS_QUANTITY"
+              oninput="value=value.replace(/[^0-9.]/g,'')"
+              placeholder="璇疯緭鍏�"
+              @input="val=>inputChange(val,row)"
+            />
+            <div v-if="row.isVisible===0">{{ row.LOSS_QUANTITY }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="TOTAL_QUANTITY"
+          label="瀹為檯鐢ㄩ噺"
+          width="110"
+        />
+        <el-table-column
+          prop="PN_TYPE"
+          label="灞炴��"
+          width="110"
+        >
+          <template slot-scope="{row}">
+            <el-select v-if="row.isVisible===1" v-model="row.PN_TYPE" placeholder="璇烽�夋嫨">
+              <el-option
+                v-for="item in sxArr"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              />
+            </el-select>
+            <div v-if="row.isVisible===0">{{ row.PN_TYPE === 'Z' ? '涓绘枡' : '杈呮枡' }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          v-if="operation!=='preview'"
+          label="鎿嶄綔"
+          width="120"
+          fixed="right"
+        >
+          <template slot-scope="{row}">
+            <div class="operationClass">
+              <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">淇濆瓨</el-button>
+              <el-button v-if="row.isVisible===1" type="text" @click="cancelRow(row)">鍙栨秷</el-button>
+              <el-button v-if="row.isVisible===0" type="text" @click="editRow(row)">缂栬緫</el-button>
+              <el-button v-if="row.isVisible===0" type="text" @click="delRow(row)">鍒犻櫎</el-button>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-if="operation==='preview'" @click="dialogVisibleCancel">杩� 鍥�</el-button>
+          <el-button v-if="operation!=='preview'" @click="dialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button
+            v-if="operation!=='preview'"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >纭� 瀹�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
+    <!--瀵煎叆缁勪欢-->
+    <import-picker
+      ref="importPickerFunc"
+      class="importPickerClass"
+      :shows.sync="shows"
+      :title="title_value"
+      :colos="colos"
+      :code="code"
+    />
+
+  </div>
+</template>
 
 <script>
+import Pagination from '@/components/Pagination'
+import ImportPicker from '@/components/ImportPicker'
+import { handleDatetime } from '@/utils/global'
+import {
+  AddUpdateBoIventory,
+  BoIventorySelect,
+  BoIventorySelectView,
+  DeleteBoIventory, MaterielDetailedVsion,
+  PartSelect,
+  StockTypeSelect
+} from '@/api/zzmx'
+
 export default {
-  name: 'Wlqd'
+  name: 'Zzjg',
+  components: {
+    Pagination, ImportPicker
+  },
+  data() {
+    return {
+      mouseHoverType: 'mouseout',
+      isExpandForm: false,
+      mainHeight: 0,
+      tableHeight: 0,
+      form: {
+        parentpartcode: '', // 姣嶄欢缂栫爜
+        parentpartname: '', // 姣嶄欢鍚嶇О
+        parentpartspec: '', // 姣嶄欢瑙勬牸
+        parttype: '', // 瀛樿揣绫诲瀷
+        status: '', // 鍚敤鐘舵��
+        version: '', // 鐗堟湰鍙�
+        createusername: '', // 鍒涘缓浜哄憳
+        createdate: '', // 鍒涘缓鏃ユ湡
+        prop: 'lm_date', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      parttypeArr: [], // 瀛樿揣绫诲瀷
+      openTypeArr: [// 鍚敤鐘舵��
+        { label: '鏄�', value: 'Y' },
+        { label: '鍚�', value: 'N' }
+      ],
+
+      total: 10,
+      tableData: [],
+      dialogVisible: false,
+      dialogForm: {
+        bomid: '',
+        parentpartcode: '',
+        parentpartname: '',
+        parentpartspec: '',
+        uomcode: '',
+        // chlx: '',
+        quantity: '',
+        status: '',
+        startdate: '',
+        version: ''
+      },
+      operation: '',
+      dialogFormRules: {
+        parentpartcode: [
+          { required: true, message: '璇烽�夋嫨姣嶄欢缂栫爜', trigger: ['blur', 'change'] }
+        ],
+        parentpartname: [
+          { required: true, message: '璇烽�夋嫨姣嶄欢鍚嶇О', trigger: ['blur', 'change'] }
+        ],
+        // parentpartspec: [
+        //   { required: true, message: '璇烽�夋嫨姣嶄欢瑙勬牸', trigger: ['blur', 'change'] }
+        // ],
+        status: [
+          { required: true, message: '璇烽�夋嫨鍚敤鐘舵��', trigger: ['blur', 'change'] }
+        ],
+        quantity: [
+          { required: true, message: '璇疯緭鍏ュ熀纭�鏁伴噺', trigger: ['blur', 'change'] }
+        ],
+        // uomcode: [
+        //   { required: true, message: '璇疯緭鍏ヨ閲忓崟浣�', trigger: ['blur', 'change'] }
+        // ],
+        // version: [
+        //   { required: true, message: '璇疯緭鍏ョ増鏈彿', trigger: ['blur', 'change'] }
+        // ],
+        startdate: [
+          { required: true, message: '璇烽�夋嫨鍚敤鏃ユ湡', trigger: ['blur', 'change'] }
+        ]
+      },
+      PartSelectArrAll: [], // 浜у搧鎵�鏈夊��
+      PartSelectArr: [], // 浜у搧鍙�夊��
+      PartSelectArrTemp: [], // 浜у搧宸查�夋殏瀛樺��
+      dialogTableDataArr: [],
+      sxArr: [
+        { code: 'Z', name: '涓绘枡' },
+        { code: 'F', name: '杈呮枡' }
+      ],
+
+      title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+      code: '4',
+      shows: false
+
+    }
+  },
+  watch: {
+    shows() {
+      if (!this.shows) {
+        this.getBoIventorySelect()
+      }
+    }
+  },
+  created() {
+    this.handleRequest()
+  },
+  mounted() {
+    window.addEventListener('resize', this.getHeight)
+    this.getHeight()
+  },
+  methods: {
+    handleRequest() {
+      this.getBoIventorySelect().then(res => {
+        if (res.code === '200') {
+          // this.getPartSelect()
+          this.getStockTypeSelect()
+        }
+      })
+    },
+    async getBoIventorySelect() {
+      let tempDate = this.form.createdate
+      if (tempDate.length > 0) {
+        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
+      }
+
+      const data = {
+        parentpartcode: this.form.parentpartcode,
+        parentpartname: this.form.parentpartname,
+        parentpartspec: this.form.parentpartspec,
+        parttype: this.form.parttype,
+        status: this.form.status,
+        version: this.form.version,
+        createusername: this.form.createusername,
+        createdate: tempDate,
+
+        prop: this.form.prop, // 鎺掑簭瀛楁
+        order: this.form.order, // 鎺掑簭瀛楁
+        page: this.form.page, // 绗嚑椤�
+        rows: this.form.rows // 姣忛〉澶氬皯鏉�
+      }
+
+      const res = await BoIventorySelect(data)
+      this.tableData = res.data
+      this.total = res.count
+      return { code: res.code }
+    },
+    // 鑾峰彇姣嶄欢缂栫爜鍚嶇О绛変笅鎷夋帴鍙�
+    async getPartSelect() {
+      const { data: res } = await PartSelect()
+      this.PartSelectArr = res
+      this.PartSelectArrAll = res
+    },
+    // 鑾峰彇瀛樿揣绫诲瀷涓嬫媺鎺ュ彛
+    async getStockTypeSelect() {
+      const { data: res } = await StockTypeSelect()
+      this.parttypeArr = res
+    },
+    partSelectChange(val) {
+      const res = this.PartSelectArr.find(item => item.partcode === val)
+      this.dialogForm.parentpartcode = res.partcode
+      this.dialogForm.parentpartname = res.partname
+      this.dialogForm.parentpartspec = res.partspec
+      this.dialogForm.uomcode = res.uom_code
+
+      if (this.PartSelectArrTemp.length > 0) {
+        this.PartSelectArr.unshift(this.PartSelectArrTemp[0])
+        this.PartSelectArrTemp.splice(0, 1)
+      }
+
+      this.PartSelectArr.forEach((item, index) => {
+        if (item.partcode === val) {
+          this.PartSelectArrTemp.push(item)
+          this.PartSelectArr.splice(index, 1)
+        }
+      })
+      this.getMaterielDetailedVsion(this.dialogForm.parentpartcode)
+    },
+    async getMaterielDetailedVsion(parentpartcode) {
+      const { data: res } = await MaterielDetailedVsion({ parentpartcode })
+      this.dialogForm.version = res
+    },
+    // 鎺掑簭鏀瑰彉鏃�
+    sortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.form.order = order
+      this.form.prop = prop
+      this.getBoIventorySelect()
+    },
+    // 鏌ヨ
+    search() {
+      this.getBoIventorySelect()
+    },
+    // 瀵煎叆鎸夐挳
+    upload() {
+      this.shows = true
+      this.$refs.importPickerFunc.newDataFunc()
+    },
+    colos() {
+      this.shows = false
+    },
+    // 閲嶇疆
+    reset() {
+      this.form.parentpartcode = ''
+      this.form.parentpartname = ''
+      this.form.parentpartspec = ''
+      this.form.parttype = ''
+      this.form.status = ''
+      this.form.version = ''
+      this.form.createusername = ''
+      this.form.createdate = ''
+      this.getBoIventorySelect()
+    },
+
+    // 鏂板鎸夐挳
+    add(operation) {
+      this.operation = operation
+      this.dialogVisible = true
+      this.getPartSelect()
+
+      this.dialogForm.startdate = handleDatetime(new Date())
+      console.log(this.dialogForm.startdate, 7)
+    },
+    // 淇敼鎸夐挳
+    async edit(operation, row) {
+      const res = await BoIventorySelectView({ bomid: row.id })
+      if (res.code === '200') {
+        this.operation = operation
+        this.dialogVisible = true
+        await this.getPartSelect()
+
+        const childrenArr = [] // 瀛愰泦鏁扮粍partcode
+
+        res.data.forEach((item, index) => {
+          let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+          number = number === 0 ? (10 + Math.random()) : number
+
+          // item.SEQ = (index + 1) + '0'
+          // item.isVisible = 0
+          // item.number = number
+          this.dialogTableDataArr.push({
+            SEQ: item.seq,
+            isVisible: 0,
+            number,
+            SMATERIRL_CODE: item.partcode,
+            SMATERIRL_NAME: item.partname,
+            SMATERIRL_SPEC: item.partspec,
+            uomcode: item.uom_name,
+            BASE_QUANTITY: item.base_quantity,
+            LOSS_QUANTITY: item.loss_quantity,
+            TOTAL_QUANTITY: item.total_quantity,
+            PN_TYPE: item.pn_type
+          })
+          childrenArr.push(item.partcode)
+        })
+
+        this.$nextTick(() => {
+          this.dialogForm.bomid = row.id
+          this.dialogForm.parentpartcode = row.partcode
+          this.dialogForm.parentpartname = row.partname
+          this.dialogForm.parentpartspec = row.partspec
+          this.dialogForm.uomcode = row.uom_code
+          this.dialogForm.startdate = row.startdate
+          this.dialogForm.status = row.status
+          this.dialogForm.quantity = row.quantity
+          this.dialogForm.version = row.version
+
+          this.PartSelectArr = this.PartSelectArr.filter(item => !childrenArr.includes(item.partcode) && item.partcode !== this.dialogForm.parentpartcode)
+        })
+      }
+    },
+    // 杈撳叆妗嗗�兼敼鍙樻椂瑙﹀彂
+    inputChange(val, row) {
+      row.TOTAL_QUANTITY = (parseFloat(row.BASE_QUANTITY) * (parseFloat(row.LOSS_QUANTITY) + 100)) / 100
+      if (!Number.isFinite(row.TOTAL_QUANTITY)) { // 妫�楠屾槸鍚︽槸鏁板瓧
+        row.TOTAL_QUANTITY = ''
+      }
+    },
+    // 瀵硅瘽妗嗚〃鏍间笅鎷夐�夋嫨鍊兼敼鍙樻椂
+    tableChange(val, row) {
+      const res = this.PartSelectArr.find(item => item.partcode === val || item.partname === val)
+      row.SMATERIRL_CODE = res.partcode
+      row.SMATERIRL_NAME = res.partname
+      row.SMATERIRL_SPEC = res.partspec
+      row.uomcode = res.uom_code
+
+      // this.PartSelectArr.forEach((item, index) => {
+      //   this.PartSelectArr.splice(index, 1)
+      // })
+    },
+    addDialog() {
+      if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
+        return this.$message.info('璇峰厛淇濆瓨鏈潯璁板綍锛�')
+      }
+
+      let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+      number = number === 0 ? (10 + Math.random()) : number
+      this.dialogTableDataArr.push({
+        SEQ: (this.dialogTableDataArr.length + 1) + '0',
+        isVisible: 1,
+        number,
+        SMATERIRL_CODE: '',
+        SMATERIRL_NAME: '',
+        SMATERIRL_SPEC: '',
+        uomcode: '',
+        BASE_QUANTITY: '',
+        LOSS_QUANTITY: '',
+        TOTAL_QUANTITY: '',
+        PN_TYPE: ''
+      })
+    },
+    saveRow(row) {
+      if (row.SMATERIRL_CODE === '' || row.BASE_QUANTITY === '' || row.LOSS_QUANTITY === '' || row.PN_TYPE === '') {
+        return this.$message.info('淇濆瓨澶辫触锛岃琛屽唴瀹规湭濉叏锛�')
+      }
+
+      row.isVisible = 0
+      this.PartSelectArr = this.PartSelectArr.filter(i => i.partcode !== row.SMATERIRL_CODE)
+    },
+    cancelRow(row) {
+      row.isVisible = 0
+      this.dialogTableDataArr = this.dialogTableDataArr.filter(i => i.number !== row.number)
+    },
+    editRow(row) {
+      if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
+        return this.$message.info('璇峰厛淇濆瓨鍏跺畠琛岃褰曪紒')
+      }
+
+      row.isVisible = 1
+
+      this.PartSelectArrAll.forEach(item => {
+        if (item.partcode === row.SMATERIRL_CODE) {
+          this.PartSelectArr.unshift(item)
+        }
+      })
+    },
+    delRow(row) {
+      this.PartSelectArrAll.forEach(item => {
+        if (item.partcode === row.SMATERIRL_CODE) {
+          this.PartSelectArr.unshift(item)
+        }
+      })
+      this.dialogTableDataArr.forEach((item, index) => {
+        if (item.SMATERIRL_CODE === row.SMATERIRL_CODE) {
+          this.dialogTableDataArr.splice(index, 1)
+        }
+      })
+      this.dialogTableDataArr.forEach((item, index) => {
+        item.SEQ = (index + 1) + '0'
+      })
+    },
+    // 鍒犻櫎鎸夐挳
+    async del(row) {
+      this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        DeleteBoIventory({ bomid: row.id }).then(res => {
+          if (res.code === '200') {
+            this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
+            this.getBoIventorySelect()
+          }
+        })
+      }).catch(() => {
+        this.$message.info('宸插彇娑堝垹闄�')
+      })
+    },
+    // 瀵硅瘽妗嗗叧闂簨浠�
+    handleClose() {
+      this.dialogForm.parentpartcode = ''
+      this.dialogForm.parentpartname = ''
+      this.dialogForm.parentpartspec = ''
+      this.dialogForm.uomcode = ''
+      // this.dialogForm.chlx = ''
+      this.dialogForm.quantity = ''
+      this.dialogForm.status = ''
+      this.dialogForm.startdate = ''
+      this.dialogForm.version = ''
+      this.PartSelectArr = []
+      this.PartSelectArrAll = []
+      this.PartSelectArrTemp = []
+      this.dialogTableDataArr = []
+      this.$refs.dialogForm.clearValidate()
+    },
+    // 瀵硅瘽妗嗗彇娑�
+    dialogVisibleCancel() {
+      this.dialogVisible = false
+    },
+    // 瀵硅瘽妗嗙‘璁�
+    dialogVisibleConfirm() {
+      if (this.dialogTableDataArr.length === 0) {
+        return this.$message.info('瀛愪欢淇℃伅涓嶈兘涓虹┖锛�')
+      }
+
+      this.$refs.dialogForm.validate(valid => {
+        if (valid) {
+          const data = {
+            bomid: this.dialogForm.bomid,
+            parentpartcode: this.dialogForm.parentpartcode,
+            parentpartname: this.dialogForm.parentpartname,
+            parentpartspec: this.dialogForm.parentpartspec,
+            uomcode: this.dialogForm.uomcode,
+            quantity: this.dialogForm.quantity,
+            status: this.dialogForm.status,
+            startdate: this.dialogForm.startdate,
+            version: this.dialogForm.version,
+            worklist: this.dialogTableDataArr,
+            opertype: this.operation === 'add' ? 'Add' : 'Update'
+          }
+          console.log(data, 89)
+          this.$store.state.app.buttonIsDisabled = true
+          AddUpdateBoIventory(data).then(res => {
+            if (res.code === '200') {
+              this.dialogVisible = false
+              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+              this.getBoIventorySelect()
+              this.$store.state.app.buttonIsDisabled = false
+            } else {
+              this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+              this.$store.state.app.buttonIsDisabled = false
+            }
+          })
+        }
+      })
+    },
+
+    // 鑾峰彇椤甸潰楂樺害
+    getHeight() {
+      this.$nextTick(() => {
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 255
+        this.$refs.tableDataRef.doLayout()
+      })
+    },
+    tableRowClassName({ row, rowIndex }) {
+      return 'custom-row'
+    }
+  }
 }
 </script>
 
-<style scoped>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-button--text {
+  font-size: 14px;
+  cursor: pointer;
+}
 
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+  color: $main_color;
+  cursor: pointer;
+}
+
+.el-icon-edit-outline {
+  margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+  height: 34px;
+  display: flex;
+  align-items: center;
+  padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+  //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+  background-color: #f8f8fa;
+  border: none;
+}
+
+::v-deep .el-input__inner {
+  height: 34px;
+  line-height: 34px;
+  //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+  //padding: 20px 100px !important;
+  padding: 20px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+  display: flex;
+  justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+  transform: scale(0.8);
+}
+
+::v-deep .cell {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+  height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+  background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+  background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+  color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+  border: 1px solid #eee;
+  width: 99%;
+  margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+::v-deep .el-select__caret {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.tableFixed {
+  ::v-deep .el-table__fixed-right {
+    height: 100% !important;
+  }
+
+  ::v-deep .el-table__fixed {
+    height: 100% !important;
+  }
+}
+
+::v-deep .el-range__icon{
+  line-height: 28px !important;
+}
+::v-deep .el-range-separator{
+  line-height: 28px !important;
+}
+::v-deep .el-range-input{
+  font-size: 14px;
+}
+::v-deep .el-range-separator{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>
+<style>
+
+.el-table .custom-row {
+  background: #f8f8fa;
+}
 </style>

--
Gitblit v1.9.3