liqianyi %!s(int64=2) %!d(string=hai) anos
pai
achega
dcccd3dbf4

+ 5 - 0
src/views/modules/common/material-component.vue

@@ -54,6 +54,11 @@
         noMore: false
       }
     },
+    watch: {
+      materialId (value) {
+        this.value = value
+      }
+    },
     mounted () {
       this.init()
     },

+ 6 - 6
src/views/modules/warehouse/stock-order-outbound.vue

@@ -15,9 +15,10 @@
             <el-row class="my-row">
               <el-col :span="8">
                 <el-form-item label="名称" prop="materialName">
-                  <material-component
+                  <el-input v-if="id"  v-model="item.materialName" :disabled="true" style="width: 200px; margin-right: 10px"/>
+                  <material-component v-else
                                       v-model="dataList[index]"
-                                      :material-id="item.materialId">
+                                      :material-id.sync="item.materialId">
                   </material-component>
                 </el-form-item>
               </el-col>
@@ -70,7 +71,7 @@
 <script>
   import UserComponent from '../common/user-component'
   import DictSelect from '../sys/dict-select'
-  import {getBoundDetails, outboundBatch} from '@/api/warehouse'
+  import {getBoundDetails, outboundBatch, updateBatch} from '@/api/warehouse'
   import {getUUID} from '../../../utils'
   import MaterialComponent from '../common/material-component'
   export default {
@@ -107,7 +108,6 @@
               }
               this.dataForm.recordType = 1
               data.data.forEach((item) => {
-                item.buttonType = 1
                 this.addOne(item)
               })
             }
@@ -177,8 +177,8 @@
                 unitName: item.unitName,
                 creatorId: this.$store.state.user.id
               })
-            })
-            outboundBatch(postData).then(({data}) => {
+            });
+            (!this.id ? outboundBatch(postData) : updateBatch(postData)).then(({data}) => {
               if (data && data.code === '200') {
                 this.$message({
                   message: '操作成功',