Forráskód Böngészése

入库部分代码

xutongzee 1 éve
szülő
commit
42e469ed1a

+ 2 - 2
src/store/modules/user.js

@@ -13,10 +13,10 @@ const state = {
     signatureStateText: '',  // 个签
 
     // 徐同泽
-    token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ0NCwibmJmIjoxNzAyNjk3NDQ0LCJleHAiOjE3Mjg2MTc0NDR9.BOU8yu57KZrgUbcIGuS0a8AB91oLhH6nHawxYUQwt7U',
+    // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ0NCwibmJmIjoxNzAyNjk3NDQ0LCJleHAiOjE3Mjg2MTc0NDR9.BOU8yu57KZrgUbcIGuS0a8AB91oLhH6nHawxYUQwt7U',
 
     // 张鑫楷
-    // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ5MiwibmJmIjoxNzAyNjk3NDkyLCJleHAiOjE3Mjg2MTc0OTJ9.tvPS5OIrfn21LItFuUSiKgnAUu1p-9x5xwzVzxp6y20'
+    token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMSIsImlzcyI6Imh0dHBzOlwvXC96YWluLmNvbSIsImF1ZCI6Imh0dHBzOlwvXC96YWluLmNvbSIsImlhdCI6MTcwMjY5NzQ5MiwibmJmIjoxNzAyNjk3NDkyLCJleHAiOjE3Mjg2MTc0OTJ9.tvPS5OIrfn21LItFuUSiKgnAUu1p-9x5xwzVzxp6y20'
 }
 
 const getters = {

+ 27 - 6
src/views/applyfor/components/IndexType3.vue

@@ -5,7 +5,7 @@
         <!-- 需要新增页面 -->
         <c-select title="采购审批单" />
 
-        <c-product-store type="3" />
+        <c-product-store type="3" v-model="stock_goods" />
 
         <c-files v-model="document" />
 
@@ -55,7 +55,7 @@ export default {
             remark: '', // 其他补充说明
 
             selOrd: '', // 关联审批单
-            libraryInfo: [], // 入库明细
+            stock_goods: [], // 入库明细
 
             approve_user: [],
             copy_user: []
@@ -72,6 +72,28 @@ export default {
         // 获取编辑数据
         handleFormatEditData(data) {
             console.log('%c edit data type6 >>>', 'background: blue; color: #fff', data);
+            const IS_EDIT = this.flag === 'approve'
+            this.way = IS_EDIT ? 'edit' : 'update'
+            this.id = IS_EDIT ? data.approve_id : data.id
+            this.module = data.module
+
+            if (Array.isArray(data.module_info.images_text) && data.module_info.images_text.length) {
+                this.images = data.module_info.images_text.map(img => ({
+                    url: img
+                }))
+            }
+
+            if (Array.isArray(data.module_info.document_text) && data.module_info.document_text.length) {
+                this.images = data.module_info.document_text.map(doc => ({
+                    url: doc
+                }))
+            }
+
+            this.selOrd = data.selOrd
+            this.remark = data.remark
+            this.stock_goods = data.stock_goods || []
+            // this.approve_user: this.approvePeople.map(user => (user.userid || user.emplId)).join(',')
+            // this.copy_user: this.copyPeople.map(user => (user.userid || user.emplId)).join(',')
         },
         /**
          * @description 提交数据默认函数
@@ -91,7 +113,7 @@ export default {
 
                 selOrd: this.selOrd,
                 remark: this.remark,
-                libraryInfo: this.libraryInfo,
+                stock_goods: this.stock_goods,
 
                 approve_user: this.approvePeople.map(user => (user.userid || user.emplId)).join(','),
                 copy_user: this.copyPeople.map(user => (user.userid || user.emplId)).join(',')
@@ -112,10 +134,10 @@ export default {
         },
         validate(data) {
             let mapTxt = {
-                'libraryInfo': '入库明细'
+                'stock_goods': '入库明细'
             }
             let requiredKey = [
-                'libraryInfo'
+                'stock_goods'
             ]
             return this.__validtor__({
                 mapTxt,
@@ -131,7 +153,6 @@ export default {
                     if (this.flag === 'approve') {
                         this.$router.go(-1)
                     } else this.__jump2apply_state__()
-
                 }
             } catch (e) {
                 console.log('it5, __post__', e);