浏览代码

Merge branch 'develop_yh17_fencang' of jianguan-web/jg-ocs-html into develop_yh18

刘俊俊 2 年之前
父节点
当前提交
c1127b50ee

+ 33 - 19
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
       })
     },
@@ -570,23 +589,18 @@ export default {
     },
     // 提交销售单
     handleSubmit () {
-      // 先不提交,先判断是否有价格更新  (下级创建时判断)
-      if (this.detailData && this.detailData.salesBillSource && this.detailData.salesBillSource == 'PURCHASE') {
-        submitCheck({ salesBillSn: this.salesBillSn }).then(res => {
-          if (res.status == 200) {
-            if (res.data.length > 0) {
-              this.updataData = res.data
-              this.priceUpdateModal = true
-            } else {
-              const ajax_data = { salesBillSn: this.salesBillSn }
-              this.submitResult(ajax_data)
-            }
+      // 先不提交,先判断是否有价格更新
+      submitCheck({ salesBillSn: this.salesBillSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data.length > 0) {
+            this.updataData = res.data
+            this.priceUpdateModal = true
+          } else {
+            const ajax_data = { salesBillSn: this.salesBillSn }
+            this.submitResult(ajax_data)
           }
-        })
-      } else {
-        const ajax_data = { salesBillSn: this.salesBillSn }
-        this.submitResult(ajax_data)
-      }
+        }
+      })
     },
     // 提交
     submitResult (data) {

+ 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)
       }
     }
   }