From 264795ac21be1ef5e36ec431005acb84777dad79 Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周四, 25 4月 2024 14:07:46 +0800
Subject: [PATCH] css

---
 iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/index.vue              |    3 
 iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsMaterialManage.js                 |    7 
 iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/addForm.vue  |  166 ++++++++++----------
 iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainer/editForm.vue          |    3 
 iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue            |   92 ++++++++--
 iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/editForm.vue |  182 +++++++++++-----------
 iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsBase/WmsMaterialManage.js         |   15 +
 7 files changed, 257 insertions(+), 211 deletions(-)

diff --git a/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsBase/WmsMaterialManage.js b/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsBase/WmsMaterialManage.js
index a1e6aae..383c16c 100644
--- a/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsBase/WmsMaterialManage.js
+++ b/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsBase/WmsMaterialManage.js
@@ -25,7 +25,13 @@
     params: parameter
   })
 }
-
+export function WmsMaterialDetailList (parameter) {
+  return axios({
+    url: '/WmsMaterial/detail',
+    method: 'get',
+    params: parameter
+  })
+}
 /**
  * 娣诲姞鐗╂枡淇℃伅琛�
  *
@@ -112,3 +118,10 @@
 
 
 
+export function materialTypeDataList (parameter) {
+  return axios({
+    url: 'WmsMaterialType/listNonPage ',
+    method: 'get',
+    params: parameter
+  })
+}
diff --git a/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsMaterialManage.js b/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsMaterialManage.js
index 94f5c1f..519417f 100644
--- a/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsMaterialManage.js
+++ b/iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsMaterialManage.js
@@ -101,10 +101,3 @@
   })
 }
 
-export function materialTypeDataList (parameter) {
-  return axios({
-    url: 'WmsMaterialType/listNonPage ',
-    method: 'get',
-    params: parameter
-  })
-}
diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainer/editForm.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainer/editForm.vue
index 279acb1..e07393f 100644
--- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainer/editForm.vue
+++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainer/editForm.vue
@@ -92,7 +92,8 @@
       record: {},
       visible: false,
       confirmLoading: false,
-      form: this.$form.createForm(this)
+      form: this.$form.createForm(this),
+      selectTypeData2:[]
     }
   },
   created() {
diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/addForm.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/addForm.vue
index 6953930..295ef44 100644
--- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/addForm.vue
+++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/addForm.vue
@@ -1,19 +1,14 @@
 锘�<template>
-  <a-modal
-    title="鏂板瀹瑰櫒鍏崇郴"
-    :width="900"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    @ok="handleSubmit"
+  <a-modal title="鏂板瀹瑰櫒鍏崇郴" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit"
     @cancel="handleCancel">
     <a-spin :spinning="confirmLoading">
-		<a-form :form="form">
+      <a-form :form="form">
         <a-form-item label="瀹瑰櫒绫诲瀷鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
           <!-- <a-input placeholder="璇疯緭鍏ュ鍣ㄧ被鍨婭D" v-decorator="['containerTypeId', {rules: [{required: true, message: '璇疯緭鍏ュ鍣ㄧ被鍨婭D锛�'}]}]" /> -->
 
           <a-select style="width: 100%" placeholder="璇烽�夋嫨瀹瑰櫒绫诲瀷鍚嶇О" v-decorator="['containerTypeId']">
-            <a-select-option v-for="(item, index) in selectTypeData" :key="index"
-              :value="item.typeCode">{{ item.typeName }}</a-select-option>
+            <a-select-option v-for="(item, index) in selectTypeData" :key="index" :value="item.typeCode">{{ item.typeName
+            }}</a-select-option>
           </a-select>
 
         </a-form-item>
@@ -24,8 +19,8 @@
           <!-- <a-input placeholder="璇疯緭鍏ョ墿鏂欑被鍨婭D" v-decorator="['materialTypeId', {rules: [{required: true, message: '璇疯緭鍏ョ墿鏂欑被鍨婭D锛�'}]}]" /> -->
 
           <a-select style="width: 100%" placeholder="璇烽�夋嫨鐗╂枡绫诲瀷鍚嶇О" v-decorator="['materialTypeId']">
-            <a-select-option v-for="(item, index) in selectTypeData2" :key="index"
-              :value="item.materialTypeCode">{{ item.materialTypeName }}</a-select-option>
+            <a-select-option v-for="(item, index) in selectTypeData2" :key="index" :value="item.materialTypeCode">{{
+              item.materialTypeName }}</a-select-option>
           </a-select>
 
         </a-form-item>
@@ -36,7 +31,7 @@
           <a-input placeholder="璇疯緭鍏ョ墿鏂欑被鍨嬪悕绉�" v-decorator="['materialTypeName', {rules: [{required: true, message: '璇疯緭鍏ョ墿鏂欑被鍨嬪悕绉帮紒'}]}]" />
         </a-form-item> -->
         <a-form-item label="鐗╂枡瀹瑰櫒瀹归噺" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
-          <a-input placeholder="璇疯緭鍏ョ墿鏂欏鍣ㄥ閲�" v-decorator="['boxQty', {rules: [{required: true, message: '璇疯緭鍏ョ墿鏂欏鍣ㄥ閲忥紒'}]}]" />
+          <a-input placeholder="璇疯緭鍏ョ墿鏂欏鍣ㄥ閲�" v-decorator="['boxQty', { rules: [{ required: true, message: '璇疯緭鍏ョ墿鏂欏鍣ㄥ閲忥紒' }] }]" />
         </a-form-item>
       </a-form>
     </a-spin>
@@ -44,86 +39,87 @@
 </template>
 
 <script>
-  import moment from 'moment'
-  import {
+import moment from 'moment'
+import {
   WmsContainerPackagingAdd
-  } from '@/api/modular/main/WmsBase/WmsContainerPackagingManage'
+} from '@/api/modular/main/WmsBase/WmsContainerPackagingManage'
 
-  import { WmsContainerTypePage, WmsContainerTypeDelete, WmsContainerTypeToExcel } from '@/api/modular/main/WmsBase/WmsContainerTypeManage'
-	import { WmsMaterialTypePage,} from '@/api/modular/main/WmsBase/WmsMaterialTypeManage'
-  export default {
-  data () {
-  return {
-  labelCol: {
-  xs: { span: 24 },
-  sm: { span: 5 }
+import { WmsContainerTypePage, WmsContainerTypeDelete, WmsContainerTypeToExcel } from '@/api/modular/main/WmsBase/WmsContainerTypeManage'
+import { WmsMaterialTypePage, } from '@/api/modular/main/WmsBase/WmsMaterialTypeManage'
+export default {
+  data() {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 15 }
+      },
+      visible: false,
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      selectTypeData2:[]
+    }
   },
-  wrapperCol: {
-  xs: { span: 24 },
-  sm: { span: 15 }
+  created() {
+    WmsContainerTypePage().then((d) => {
+      this.selectTypeData = d.data.rows || []
+    }).catch(() => {
+
+    })
+    WmsMaterialTypePage().then((d) => {
+      this.selectTypeData2 = d.data.rows || []
+    }).catch(() => {
+
+    })
   },
-        visible: false,
-        confirmLoading: false,
-        form: this.$form.createForm(this)
-      }
+  methods: {
+    moment,
+    // 鍒濆鍖栨柟娉�
+    add(record) {
+      this.visible = true
+      this.$nextTick(() => {
+
+      });
+
+
     },
-    created() {
-      WmsContainerTypePage().then((d) => {
-        this.selectTypeData = d.data.rows || []
-      }).catch(() => {
-
-      })
-      WmsMaterialTypePage().then((d) => {
-        this.selectTypeData2 = d.data.rows || []
-      }).catch(() => {
-
-      })
-  },
-    methods: {
-	moment,
-      // 鍒濆鍖栨柟娉�
-      add (record) {
-        this.visible = true
-        this.$nextTick(() => {
-
-        });
-
-  
-      },
-      /**
-       * 鎻愪氦琛ㄥ崟
-       */
-      handleSubmit () {
-        const { form: { validateFields } } = this
-        this.confirmLoading = true
-        validateFields((errors, values) => {
-          if (!errors) {
-            for (const key in values) {
-              if (typeof (values[key]) === 'object') {
-                values[key] = JSON.stringify(values[key])
-              }
+    /**
+     * 鎻愪氦琛ㄥ崟
+     */
+    handleSubmit() {
+      const { form: { validateFields } } = this
+      this.confirmLoading = true
+      validateFields((errors, values) => {
+        if (!errors) {
+          for (const key in values) {
+            if (typeof (values[key]) === 'object') {
+              values[key] = JSON.stringify(values[key])
             }
-            WmsContainerPackagingAdd(values).then((res) => {
-              if (res.success) {
-                this.$message.success('鏂板鎴愬姛')
-                this.confirmLoading = false
-                this.$emit('ok', values)
-                this.handleCancel()
-              } else {
-                this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message))
-              }
-            }).finally((res) => {
-              this.confirmLoading = false
-            })
-          } else {
-            this.confirmLoading = false
           }
-        })
-      },
-      handleCancel () {
-        this.form.resetFields()
-        this.visible = false
-      }
+          WmsContainerPackagingAdd(values).then((res) => {
+            if (res.success) {
+              this.$message.success('鏂板鎴愬姛')
+              this.confirmLoading = false
+              this.$emit('ok', values)
+              this.handleCancel()
+            } else {
+              this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message))
+            }
+          }).finally((res) => {
+            this.confirmLoading = false
+          })
+        } else {
+          this.confirmLoading = false
+        }
+      })
+    },
+    handleCancel() {
+      this.form.resetFields()
+      this.visible = false
     }
   }
+}
 </script>
diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/editForm.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/editForm.vue
index fc14202..386cb6d 100644
--- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/editForm.vue
+++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsContainerPackaging/editForm.vue
@@ -1,10 +1,5 @@
 锘�<template>
-  <a-modal
-    title="缂栬緫瀹瑰櫒鍏崇郴"
-    :width="900"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    @ok="handleSubmit"
+  <a-modal title="缂栬緫瀹瑰櫒鍏崇郴" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit"
     @cancel="handleCancel">
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
@@ -12,8 +7,8 @@
           <!-- <a-input placeholder="璇疯緭鍏ュ鍣ㄧ被鍨婭D" v-decorator="['containerTypeId', {rules: [{required: true, message: '璇疯緭鍏ュ鍣ㄧ被鍨婭D锛�'}]}]" /> -->
 
           <a-select style="width: 100%" placeholder="璇烽�夋嫨瀹瑰櫒绫诲瀷鍚嶇О" v-decorator="['containerTypeId']">
-            <a-select-option v-for="(item, index) in selectTypeData" :key="index"
-              :value="item.typeCode">{{ item.typeName }}</a-select-option>
+            <a-select-option v-for="(item, index) in selectTypeData" :key="index" :value="item.typeCode">{{ item.typeName
+            }}</a-select-option>
           </a-select>
 
         </a-form-item>
@@ -24,8 +19,8 @@
           <!-- <a-input placeholder="璇疯緭鍏ョ墿鏂欑被鍨婭D" v-decorator="['materialTypeId', {rules: [{required: true, message: '璇疯緭鍏ョ墿鏂欑被鍨婭D锛�'}]}]" /> -->
 
           <a-select style="width: 100%" placeholder="璇烽�夋嫨鐗╂枡绫诲瀷鍚嶇О" v-decorator="['materialTypeId']">
-            <a-select-option v-for="(item, index) in selectTypeData2" :key="index"
-              :value="item.materialTypeCode">{{ item.materialTypeName }}</a-select-option>
+            <a-select-option v-for="(item, index) in selectTypeData2" :key="index" :value="item.materialTypeCode">{{
+              item.materialTypeName }}</a-select-option>
           </a-select>
 
         </a-form-item>
@@ -36,7 +31,7 @@
           <a-input placeholder="璇疯緭鍏ョ墿鏂欑被鍨嬪悕绉�" v-decorator="['materialTypeName', {rules: [{required: true, message: '璇疯緭鍏ョ墿鏂欑被鍨嬪悕绉帮紒'}]}]" />
         </a-form-item> -->
         <a-form-item label="鐗╂枡瀹瑰櫒瀹归噺" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
-          <a-input placeholder="璇疯緭鍏ョ墿鏂欏鍣ㄥ閲�" v-decorator="['boxQty', {rules: [{required: true, message: '璇疯緭鍏ョ墿鏂欏鍣ㄥ閲忥紒'}]}]" />
+          <a-input placeholder="璇疯緭鍏ョ墿鏂欏鍣ㄥ閲�" v-decorator="['boxQty', { rules: [{ required: true, message: '璇疯緭鍏ョ墿鏂欏鍣ㄥ閲忥紒' }] }]" />
         </a-form-item>
       </a-form>
     </a-spin>
@@ -45,98 +40,99 @@
 
 <script>
 import moment from 'moment'
-  import {
+import {
   WmsContainerPackagingEdit
-  } from '@/api/modular/main/WmsBase/WmsContainerPackagingManage'
+} from '@/api/modular/main/WmsBase/WmsContainerPackagingManage'
 
 
-  import { WmsContainerTypePage, WmsContainerTypeDelete, WmsContainerTypeToExcel } from '@/api/modular/main/WmsBase/WmsContainerTypeManage'
-	import { WmsMaterialTypePage,} from '@/api/modular/main/WmsBase/WmsMaterialTypeManage'
+import { WmsContainerTypePage, WmsContainerTypeDelete, WmsContainerTypeToExcel } from '@/api/modular/main/WmsBase/WmsContainerTypeManage'
+import { WmsMaterialTypePage, } from '@/api/modular/main/WmsBase/WmsMaterialTypeManage'
 
-  export default {
-  data () {
-  return {
-  Id: 0,
-  labelCol: {
-  xs: { span: 24 },
-  sm: { span: 5 }
+export default {
+  data() {
+    return {
+      Id: 0,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 15 }
+      },
+      record: {},
+      visible: false,
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      selectTypeData2:[]
+    }
   },
-  wrapperCol: {
-  xs: { span: 24 },
-  sm: { span: 15 }
+  created() {
+    WmsContainerTypePage().then((d) => {
+      this.selectTypeData = d.data.rows || []
+    }).catch(() => {
+
+    })
+    WmsMaterialTypePage().then((d) => {
+      this.selectTypeData2 = d.data.rows || []
+    }).catch(() => {
+
+    })
   },
-  record: {},
-        visible: false,
-        confirmLoading: false,
-        form: this.$form.createForm(this)
-      }
+  methods: {
+    moment,
+    // 鍒濆鍖栨柟娉�
+    edit(record) {
+      this.visible = true;
+      this.Id = record.id;
+      this.$nextTick(() => {
+      });
+      //娣卞害鎷疯礉 绉婚櫎VUE鐨勭洃鍚紝闃叉INDEX椤甸潰鍊煎彉鍔�
+      this.record = JSON.parse(JSON.stringify(record))
+      this.$nextTick(() => {
+        this.form.setFieldsValue(
+          {
+            ...record
+          }
+        )
+
+      })
     },
-    created() {
-      WmsContainerTypePage().then((d) => {
-        this.selectTypeData = d.data.rows || []
-      }).catch(() => {
-
-      })
-      WmsMaterialTypePage().then((d) => {
-        this.selectTypeData2 = d.data.rows || []
-      }).catch(() => {
-
-      })
-  },
-    methods: {
-	moment,
-      // 鍒濆鍖栨柟娉�
-      edit (record) {
-        this.visible = true;
-		this.Id = record.id;
-        this.$nextTick(() => {
-        });
-        //娣卞害鎷疯礉 绉婚櫎VUE鐨勭洃鍚紝闃叉INDEX椤甸潰鍊煎彉鍔�
-        this.record = JSON.parse(JSON.stringify(record))
-        this.$nextTick(() => {
-          this.form.setFieldsValue(
-            {
-              ...record
+    handleSubmit() {
+      const { form: { validateFields } } = this
+      this.confirmLoading = true
+      validateFields((errors, values) => {
+        if (!errors) {
+          for (const key in values) {
+            if (values[key] == null) continue
+            if (typeof (values[key]) === 'object') {
+              values[key] = JSON.stringify(values[key])
+              this.record[key] = values[key]
+            } else {
+              this.record[key] = values[key]
             }
-          )
-
-        })
-      },
-      handleSubmit () {
-        const { form: { validateFields } } = this
-        this.confirmLoading = true
-        validateFields((errors, values) => {
-          if (!errors) {
-            for (const key in values) {
-              if (values[key] == null) continue
-              if (typeof (values[key]) === 'object') {
-                values[key] = JSON.stringify(values[key])
-                 this.record[key] = values[key]
-              } else {
-                 this.record[key] = values[key]
-              }
-            }
-            WmsContainerPackagingEdit(this.record).then((res) => {
-              if (res.success) {
-                this.$message.success('缂栬緫鎴愬姛')
-                this.confirmLoading = false
-                this.$emit('ok', this.record)
-                this.handleCancel()
-              } else {
-                this.$message.error('缂栬緫澶辫触锛�' + JSON.stringify(res.message))
-              }
-            }).finally((res) => {
+          }
+          WmsContainerPackagingEdit(this.record).then((res) => {
+            if (res.success) {
+              this.$message.success('缂栬緫鎴愬姛')
               this.confirmLoading = false
-            })
-          }else{
+              this.$emit('ok', this.record)
+              this.handleCancel()
+            } else {
+              this.$message.error('缂栬緫澶辫触锛�' + JSON.stringify(res.message))
+            }
+          }).finally((res) => {
             this.confirmLoading = false
-          } 
-        });
-      },
-      handleCancel () {
-        this.form.resetFields()
-        this.visible = false
-      }
+          })
+        } else {
+          this.confirmLoading = false
+        }
+      });
+    },
+    handleCancel() {
+      this.form.resetFields()
+      this.visible = false
     }
   }
+}
 </script>
diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/index.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/index.vue
index b8f7f93..43e0cb5 100644
--- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/index.vue
+++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/index.vue
@@ -194,7 +194,8 @@
 			
 			<!-- <a v-if="hasPerm('WmsMaterial:edit')" @click="$refs.editForm.edit(record)">缂栬緫</a> -->
 			<a v-if="hasPerm('WmsMaterial:edit')" @click="$refs.tabForm.add(record)">缂栬緫</a>
-
+			<a-divider type="vertical" v-if="hasPerm('WmsMaterial:edit') & hasPerm('WmsMaterial:delete')"/>
+			<a v-if="hasPerm('WmsMaterial:edit')" @click="$refs.tabForm.add(record,'璇︽儏')">璇︽儏</a>
           <a-divider type="vertical" v-if="hasPerm('WmsMaterial:edit') & hasPerm('WmsMaterial:delete')"/>
           <a-popconfirm v-if="hasPerm('WmsMaterial:delete')" placement="topRight" title="纭鍒犻櫎锛�" @confirm="() => WmsMaterialDelete(record)">
             <a>鍒犻櫎</a>
diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
index 6da1ac1..6af8f65 100644
--- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
+++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
@@ -125,13 +125,16 @@
 </template>
 
 <script>
-import { WmsMaterialAdd, GetAreas, GetStations, materialTypeDataList } from '@/api/modular/main/WmsMaterialManage'
+
+import {
+  WmsMaterialAdd, WmsMaterialEdit, WmsMaterialDetailList,materialTypeDataList
+} from '@/api/modular/main/WmsBase/WmsMaterialManage'
 import addForm from './tabItem/addForm.vue'
 import addFormBaseCustomer from './tabItem/addFormBaseCustomer/addFormBaseCustomer.vue'
 import addFormContainerPackaging from './tabItem/WmsContainerPackaging/addFormContainerPackaging.vue'
 import addFormSub from './tabItem/WmsSubstituteGood/addFormWmsSubstituteGood.vue'
 import addControlRule from './tabItem/WmsControlRule/addForm.vue'
-import { WmsUnitPage, WmsUnitDelete, WmsUnitToExcel } from '@/api/modular/main/WmsBase/WmsUnitManage'
+import { WmsUnitPage} from '@/api/modular/main/WmsBase/WmsUnitManage'
 export default {
   components: {
     addForm,
@@ -165,7 +168,9 @@
       visible: false,
       confirmLoading: false,
       form: this.$form.createForm(this),
-      materialTypeData2:[]
+      materialTypeData2: [],
+      selectTypeData2:[],
+      selectTypeData1:[]
     }
   },
   methods: {
@@ -210,20 +215,43 @@
     },
     handleOk() { },
     // 鍒濆鍖栨柟娉�
-    add(record) {
-     
-
+    add(record, type) {
       this.visible = true
       if (record) {//缂栬緫
-        this.title = '缂栬緫鍩虹鐗╂枡淇℃伅';
+        if (type == '璇︽儏') {
+          this.title = '璇︽儏鐗╂枡淇℃伅璇︽儏';// 璇︽儏
+        } else {
+          this.title = '缂栬緫鍩虹鐗╂枡淇℃伅';
+        }
         this.$nextTick(() => {
           this.form.setFieldsValue({
             ...record
           })
         })
-     
-      } else { // 鏂板
-        this.title = '鏂板鍩虹鐗╂枡淇℃伅';
+        WmsMaterialDetailList({
+          id: record.id
+        })
+          .then(res => {
+            if (res.success) {
+              console.log("666666666666")
+              console.log(res)
+              this.$refs.WmsControlRule.list = res.data.baseCustomerList || []
+              this.$refs.addFormBaseCustomer.list = res.data.controlRuleDetailList || []
+              this.$refs.addFormWmsSubstituteGoodRef.list = res.data.substituteGoodList || []
+              // this.$message.success('缂栬緫鎴愬姛')
+              // this.confirmLoading = false
+              // this.$emit('ok', values)
+              // this.handleCancel()
+            } else {
+              this.$message.error('璇︽儏澶辫触锛�' + JSON.stringify(res.message))
+            }
+          })
+          .finally(res => {
+            this.confirmLoading = false
+          })
+
+      } else {
+        this.title = '鏂板鍩虹鐗╂枡淇℃伅';// 鏂板
       }
     },
     getSelects() {
@@ -297,20 +325,38 @@
             // ContainerPackagingList: this.$refs.addFormContainerPackagingRef.list //鍖呰鍏崇郴
           }
           this.confirmLoading = true
-          WmsMaterialAdd(param)
-            .then(res => {
-              if (res.success) {
-                this.$message.success('鏂板鎴愬姛')
+          if (this.title == '鏂板鍩虹鐗╂枡淇℃伅') {
+            WmsMaterialAdd(param)
+              .then(res => {
+                if (res.success) {
+                  this.$message.success('鏂板鎴愬姛')
+                  this.confirmLoading = false
+                  this.$emit('ok', values)
+                  this.handleCancel()
+                } else {
+                  this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message))
+                }
+              })
+              .finally(res => {
                 this.confirmLoading = false
-                this.$emit('ok', values)
-                this.handleCancel()
-              } else {
-                this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message))
-              }
-            })
-            .finally(res => {
-              this.confirmLoading = false
-            })
+              })
+          } else {
+            WmsMaterialEdit(param)
+              .then(res => {
+                if (res.success) {
+                  this.$message.success('缂栬緫鎴愬姛')
+                  this.confirmLoading = false
+                  this.$emit('ok', values)
+                  this.handleCancel()
+                } else {
+                  this.$message.error('缂栬緫澶辫触锛�' + JSON.stringify(res.message))
+                }
+              })
+              .finally(res => {
+                this.confirmLoading = false
+              })
+          }
+
         } else {
           this.confirmLoading = false
         }

--
Gitblit v1.9.3