lilei 2 år sedan
förälder
incheckning
06522a80c0

+ 4 - 5
src/views/allocationManagement/transferReturn/basicInfoModal.vue

@@ -195,7 +195,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
-          if(!form.warehouseSn){
+          if(form.grabFlag==0 && !form.warehouseSn){
             _this.$message.error("请选择调入仓库")
             return false
           }
@@ -217,13 +217,12 @@ export default {
     // 调往对象  change
     targetTypeChange (val) {
       console.log(val)
-      this.$refs.ruleForm.resetFields()
+      // this.$refs.ruleForm.resetFields()
       this.form.targetSn = undefined
       this.form.targetName = ''
+      this.form.warehouse = undefined
       this.form.targetType = val
-      if (val !== 'DEALER') {
-        this.form.grabFlag = '0'
-      }
+      this.form.grabFlag = val != 'DEALER' ? '0' : '1'
     },
     resetForm () {
       this.$refs.ruleForm.resetFields()

+ 18 - 3
src/views/allocationManagement/transferReturn/edit.vue

@@ -19,7 +19,16 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调入仓库">{{ (basicInfoData&&basicInfoData.warehouseName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调入仓库">
+                <warehouse
+                style="width:200px;"
+                :allowClear="false"
+                  v-model="basicInfoData.warehouseSn"
+                  @change="updateWarehouse"
+                  id="basicInfo-warehouseSn"
+                  placeholder="请选择调入仓库"
+                />
+              </a-descriptions-item>
               <a-descriptions-item label="费用/调拨退货类型">
                 <AllocateType
                   id="allocateEdit-allocateReturnTypeSn"
@@ -248,6 +257,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 // import ImportGuideModal from './importGuideModal.vue'
 import print from './print.vue'
+import warehouse from '@/views/common/chooseWarehouse.js'
 import { queryStockProductPage } from '@/api/stock'
 import AllocateType from '@/views/common/allocateType.js'
 import {
@@ -264,7 +274,7 @@ import {
 export default {
   name: 'TransferReturnEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, print, AllocateType },
+  components: { STable, VSelect, print, AllocateType, warehouse },
   data () {
     const _this = this
     return {
@@ -288,7 +298,7 @@ export default {
         this.disabled = true
         const dealerLevel = this.$route.params.dealerLevel == 'OTHER' ? undefined : this.$route.params.dealerLevel
         const warehouseSn = this.basicInfoData.warehouseSn
-        return queryStockProductPage(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel == 0 ? '' : dealerLevel, warehouseSn: warehouseSn})).then(res => {
+        return queryStockProductPage(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel == 0 ? '' : dealerLevel})).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -371,6 +381,11 @@ export default {
       })
       _this.editRemark = false
     },
+    // 修改仓库
+    updateWarehouse(warehouseSn){
+      this.basicInfoData.warehouseSn = warehouseSn
+      this.handleEditRemark()
+    },
     // 修改调拨类型
     changeAllocateType (val, opt) {
       console.log(val, opt, '------------')

+ 18 - 3
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -19,7 +19,16 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调入仓库">{{ (basicInfoData&&basicInfoData.warehouseName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调入仓库">
+                <warehouse
+                style="width:200px;"
+                :allowClear="false"
+                  v-model="basicInfoData.warehouseSn"
+                  @change="updateWarehouse"
+                  id="basicInfo-warehouseSn"
+                  placeholder="请选择调入仓库"
+                />
+              </a-descriptions-item>
               <a-descriptions-item label="费用/调拨退货类型">
                 <AllocateType
                   id="allocateEdit-allocateReturnTypeSn"
@@ -239,6 +248,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 // import ImportGuideModal from './importGuideModal.vue'
 import print from './print.vue'
+import warehouse from '@/views/common/chooseWarehouse.js'
 import { allocDetailQueryPageForReturn } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
 import {
@@ -255,7 +265,7 @@ import {
 export default {
   name: 'TransferReturnGrpEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, AllocateType, print },
+  components: { STable, VSelect, AllocateType, print, warehouse },
   data () {
     return {
       spinning: false,
@@ -280,7 +290,7 @@ export default {
         const targetSn =  this.basicInfoData.targetSn
         const targetType = this.$route.params.targetType
         const allocateNo = this.queryParam.allocateNo
-        const otherParams = { allocateBill: { targetType: targetType , targetSn:targetSn, warehouseSn:warehouseSn, allocateNo: allocateNo } }
+        const otherParams = { allocateBill: { targetType: targetType , targetSn:targetSn, allocateNo: allocateNo } }
         return allocDetailQueryPageForReturn(Object.assign(parameter, this.queryParam, otherParams)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -427,6 +437,11 @@ export default {
       })
       _this.editRemark = false
     },
+    // 修改仓库
+    updateWarehouse(warehouseSn){
+      this.basicInfoData.warehouseSn = warehouseSn
+      this.handleEditRemark()
+    },
     // 修改调拨类型
     changeAllocateType (val, opt) {
       console.log(val, opt, '------------')

+ 33 - 3
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -18,7 +18,16 @@
             <a-descriptions :column="3">
               <a-descriptions-item label="供应商">{{ (productTotal&&productTotal.supplierName) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="入库类型">{{ (productTotal&&productTotal.sparePartsTypeDictValue) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="入库仓库">{{ (productTotal&&productTotal.warehouseName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="入库仓库">
+                <warehouse
+                style="width:200px;"
+                :allowClear="false"
+                  v-model="productTotal.warehouseSn"
+                  @change="updateWarehouse"
+                  id="basicInfo-warehouseSn"
+                  placeholder="请选择入库仓库"
+                />
+              </a-descriptions-item>
               <a-descriptions-item label="入库单号">{{ (productTotal&&productTotal.sparePartsNo) || '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
@@ -117,11 +126,12 @@ import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import sparePartsProductModal from './productModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
-import { sparePartsDetailList, sparePartsPageCount, sparePartsDeleteDetail, sparePartsDetailBatchInsert } from '@/api/spareParts'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import { sparePartsDetailList, sparePartsPageCount, sparePartsDeleteDetail, sparePartsDetailBatchInsert, sparePartsSave } from '@/api/spareParts'
 export default {
   name: 'BulkWarehousingOrderEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, sparePartsProductModal, ImportGuideModal },
+  components: { STable, VSelect, sparePartsProductModal, ImportGuideModal, warehouse },
   data () {
     return {
       spinning: false,
@@ -182,6 +192,26 @@ export default {
       this.itemSn = ''
       this.openModal = false
     },
+    // 修改仓库
+    updateWarehouse(warehouseSn){
+      const _this = this
+      _this.spinning = true
+      const params = {
+        id:this.productTotal.id,
+        warehouseSn: warehouseSn,
+        supplierSn: this.productTotal.supplierSn, // 供应商
+        sparePartsType: this.productTotal.sparePartsType, //  散件类型
+        relationNo: this.productTotal.relationNo, //  关联单号
+        remark: this.productTotal.remark // 备注
+      }
+      sparePartsSave(params).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+        }
+        _this.$refs.table.refresh()
+        _this.spinning = false
+      })
+    },
     //  删除
     handleDel (row) {
       const _this = this

+ 1 - 1
src/views/purchasingManagement/bulkWarehousingOrder/productModal.vue

@@ -129,7 +129,7 @@ export default {
           { required: true, message: '请选择产品编码', trigger: 'change' }
         ],
         warehouseLocationSn: [
-          { required: true, message: '请选择仓库仓位', trigger: 'change' }
+          { required: true, message: '请选择仓位', trigger: 'change' }
         ],
         productCost: [
           { required: true, message: '该产品没有设置成本价', trigger: 'blur' }