Browse Source

no message

aXin-0810 1 năm trước cách đây
mục cha
commit
f162e867cc

+ 1 - 1
src/App.vue

@@ -17,4 +17,4 @@ export default {
 .teshudeshangchuananniu {
   color: #fff !important;
 }
-</style>
+</style>

+ 32 - 5
src/views/supply/reserve/components/reserve_form.vue

@@ -73,6 +73,16 @@
         v-if="!listItem"
         >批量设置预留数量</el-button
       >
+      <el-select
+        style="margin-left: 10px"
+        v-model="morenck"
+        placeholder="设置默认仓库"
+        size="small"
+        clearable
+        @change="shezhimorenck"
+      >
+        <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+      </el-select>
     </div>
     <div class="table" style="margin-top: 20px">
       <el-table
@@ -514,6 +524,7 @@ export default {
   },
   data() {
     return {
+      morenck: '',
       mainForm: {
         orderNum: '',
         orderDate: '',
@@ -571,7 +582,7 @@ export default {
   },
 
   async created() {
-    // await this.getWarehouseList();
+    await this.getWarehouseList()
     // await this.getListStock()
     if (this.listItem) {
       console.log(this.listItem)
@@ -583,6 +594,14 @@ export default {
   },
 
   methods: {
+    shezhimorenck(val) {
+      this.goodsList = this.goodsList.map(item => {
+        return {
+          ...item,
+          correspondId: val
+        }
+      })
+    },
     getDate() {
       var date = new Date()
       var seperator1 = '-'
@@ -628,7 +647,9 @@ export default {
         this.mainForm.createDate = res.data.createTime
         this.mainForm.remark = res.data.remark
         for (let i = 0; i < res.data.reservedOrderItems.length; i++) {
-          res.data.reservedOrderItems[i].warehouseList = await this.getListStock(res.data.reservedOrderItems[i].customerId)
+          res.data.reservedOrderItems[i].warehouseList = await this.getListStock(
+            res.data.reservedOrderItems[i].customerId
+          )
         }
 
         let data = res.data
@@ -747,7 +768,15 @@ export default {
         item.warehouseList = await this.getListStock(item.customerId)
       })
 
-      this.goodsList = this.goodsList.concat(this.dialogSelection)
+      this.goodsList = this.goodsList.concat(
+        this.dialogSelection.map(item => {
+          item.reservedNum = item.refundableQty
+          if (this.morenck) {
+            item.correspondId = this.morenck
+          }
+          return item
+        })
+      )
       this.isShowDialog = false
       this.dialogGoodsList = []
     },
@@ -893,13 +922,11 @@ export default {
             editData(params).then(res => {
               this.$successMsg('编辑成功')
               this.goBack()
-
             })
           } else {
             addData(params).then(res => {
               this.$successMsg('添加成功')
               this.goBack()
-
             })
           }
         }

+ 11 - 11
src/views/supply/reserve/reserve_list.vue

@@ -67,7 +67,7 @@ export default {
           [
             {
               name: '批量关闭预留单',
-              click: async() => {
+              click: async () => {
                 if (this.recordSelected.length === 0) {
                   this.$message.error('请选择需要关闭的数据')
                   return
@@ -212,11 +212,11 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class='operation-btns'>
+          <div class="operation-btns">
             <el-button
-              size='mini'
-              type='text'
-              onClick={async() => {
+              size="mini"
+              type="text"
+              onClick={async () => {
                 this.toDetail(row)
               }}
             >
@@ -225,9 +225,9 @@ export default {
 
             {this.$checkBtnRole('edit', this.$route.meta.roles) && !row.printNum ? (
               <el-button
-                size='mini'
-                type='text'
-                onClick={async() => {
+                size="mini"
+                type="text"
+                onClick={async () => {
                   this.toForm(row)
                 }}
               >
@@ -239,12 +239,12 @@ export default {
 
             {this.$checkBtnRole('examine', this.$route.meta.roles) && row.status === 1 ? (
               <el-popconfirm
-                onConfirm={async() => {
+                onConfirm={async () => {
                   this.handleClose(row.itemId)
                 }}
-                title='是否确定需要关闭该项内容?'
+                title="是否确定需要关闭该项内容?"
               >
-                <el-button slot='reference' size='mini' type='text'>
+                <el-button slot="reference" size="mini" type="text">
                   关闭
                 </el-button>
               </el-popconfirm>