chenrui 2 vuotta sitten
vanhempi
commit
7311fd2903

+ 22 - 3
src/views/salesManagement/salesQuery/edit.vue

@@ -154,6 +154,10 @@
             </div>
             <span v-else>--</span>
           </template>
+          <!-- 出库仓库 -->
+          <template slot="warehouseBox" slot-scope="text, record">
+            <chooseWarehouse style="width:100%;" :allowClear="false" ref="warehouseBox" v-model="record.warehouseSn" @change="handleWarehouseBox(record)"></chooseWarehouse>
+          </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <a-button
@@ -300,7 +304,7 @@ export default {
         // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
-        { title: '出库仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
@@ -313,6 +317,16 @@ export default {
     }
   },
   methods: {
+    // 设置单个出库仓库
+    handleWarehouseBox (row) {
+      const snArr = [row.salesBillDetailSn]
+      const ajax_data = {
+        warehouseSn: row.warehouseSn,
+        salesBillDetailSnList: snArr,
+        salesBillSn: this.$route.params.sn
+      }
+      this.setWarehouseInfo(ajax_data)
+    },
     chooseWarehouseOk (sn) {
       const _this = this
       const snArr = []
@@ -322,16 +336,21 @@ export default {
       const ajax_data = {
         warehouseSn: sn,
         salesBillDetailSnList: snArr,
-        salesBillSn: this.$route.params.sn
+        salesBillSn: _this.$route.params.sn
       }
+      _this.setWarehouseInfo(ajax_data)
+    },
+    setWarehouseInfo (data) {
+      const _this = this
       _this.spinning = true
-      updateWarehouse(ajax_data).then(res => {
+      updateWarehouse(data).then(res => {
         if (res.status == 200) {
           _this.openWarehouseModal = false
           _this.resetSearchForm(true)
           _this.$refs.promotable.resetCurForm()
           _this.$message.success(res.message)
         }
+        _this.$refs.table.refresh(true)
         _this.spinning = false
       })
     },

+ 1 - 0
src/views/salesManagement/salesQuery/list.vue

@@ -165,6 +165,7 @@
           <div class="warehouse_box" v-if="record.warehouseNameSet && record.warehouseNameSet.length>0">
             <span v-for="(item,i) in record.warehouseNameSet" :key="i">{{ item }}</span>
           </div>
+          <div v-else>--</div>
         </template>
         <!-- 总数量 -->
         <template slot="totalQty" slot-scope="text, record">

+ 1 - 2
src/views/salesManagement/salesQuery/setWarehouse.vue

@@ -82,9 +82,8 @@ export default {
     show (newValue, oldValue) {
       this.opened = newValue
       if (!newValue) {
-        this.$refs.dealerSubareaScopeList.resetForm()
+        this.form.warehouseSn = undefined
         this.$refs.ruleForm.resetFields()
-        this.verifyFun(this.addressId)
       }
     }
   }