Prechádzať zdrojové kódy

国内贸易商品信息修改

lichao 3 rokov pred
rodič
commit
4d1c4c0e25

+ 0 - 13
src/views/businessManagement/deliveryNotice/configuration/customerContact.json

@@ -72,19 +72,6 @@
         }
       ]
     },{
-      "label": "规格编码",
-      "prop": "typeno",
-      "index": 3,
-      "width":100,
-      "cell": false,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入规格编码",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "规格型号",
       "prop": "specificationAndModel",
       "index": 4,

+ 8 - 0
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -500,6 +500,7 @@ export default {
     this.getWorkDicts("order_status").then(res => {
       this.statusOption = res.data.data
     })
+    this.$set(this.form,'deliveryStatus','录入')
     wareHouseType().then(res => {
       this.warehouseType = res.data.data.records
       this.warehouseType.forEach(item => {
@@ -730,12 +731,19 @@ export default {
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
           console.log(this.tableData[item])
+          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
           this.tableData[item].itemId = this.tableData[item].id
           this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
           delete this.tableData[item].goodsTypeName
           delete this.tableData[item].id
           delete this.tableData[item].status
           delete this.tableData[item].isDeleted
+          this.$set(this.tableData[item], 'inventoryNumber', 0)
+          this.$set(this.tableData[item], 'actualQuantity', 0)
+          this.$set(this.tableData[item], 'inventoryAmount', 0)
+          this.$set(this.tableData[item], 'deliveryAmount', 0)
+          this.tableData[item].price = 0
+          this.tableData[item].amount = 0
           this.tableData[item].sort = this.maxGoodsNum + 1
           this.maxGoodsNum++
           this.$refs.crudContact.rowCellAdd(this.tableData[item]);

+ 4 - 15
src/views/businessManagement/purchaseOrder/configuration/customerContact.json

@@ -72,19 +72,6 @@
         }
       ]
     },{
-      "label": "规格编码",
-      "prop": "typeno",
-      "index": 3,
-      "width":100,
-      "cell": false,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入规格编码",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "规格型号",
       "prop": "specificationAndModel",
       "index": 4,
@@ -116,7 +103,8 @@
       "prop": "actualQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
@@ -129,7 +117,8 @@
       "prop": "storageQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,

+ 33 - 1
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -72,6 +72,24 @@
               ></el-input>
               <span v-else>{{ row.price }}</span>
             </template>
+            <template slot="storageQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.storageQuantity"
+                size="small"
+                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              ></el-input>
+              <span v-else>{{ row.storageQuantity }}</span>
+            </template>
+            <template slot="actualQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.actualQuantity"
+                size="small"
+                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              ></el-input>
+              <span v-else>{{ row.actualQuantity }}</span>
+            </template>
             <template slot="code" slot-scope="{row,index}">
               <span style="float: left;padding-top: 2px">{{ row.code }}</span>
               <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
@@ -95,7 +113,7 @@
                          icon="el-icon-plus"
                          size="small"
                          :disabled="selection.length < 1"
-                         @click="generateShipmentC">生成货单
+                         @click="generateShipmentC">生成货单
               </el-button>
               <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
             </template>
@@ -746,6 +764,11 @@ export default {
     //商品编辑
     rowCell(row, index) {
       console.log(row)
+      if (row.$cellEdit) {
+        if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
+          return this.$message.error('订货数量不能小于发货数量')
+        }
+      }
       this.$refs.crudContact.rowCell(row, index)
     },
     //费用编辑
@@ -836,7 +859,11 @@ export default {
           this.tableData[item].itemId = this.tableData[item].id
           this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
           delete this.tableData[item].id
+          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+          this.$set(this.tableData[item], 'priceType', '一般')
           this.$set(this.tableData[item], 'orderQuantity', 0)
+          this.$set(this.tableData[item], 'actualQuantity', 0)
+          this.$set(this.tableData[item], 'storageQuantity', 0)
           this.tableData[item].price = 0
           this.tableData[item].amount = 0
           this.tableData[item].sort = this.maxGoodsNum + 1
@@ -1059,6 +1086,11 @@ export default {
       console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          for (let item in this.contactsData) {
+            if (Number(this.contactsData[item].orderQuantity) < Number(this.contactsData[item].actualQuantity)) {
+              return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
+            }
+          }
           //商品信息
           this.form.itemsVOList = this.contactsData
           this.form.orderFeesList = this.advantageProjectData

+ 0 - 13
src/views/businessManagement/receipt/configuration/customerContact.json

@@ -73,19 +73,6 @@
         }
       ]
     },{
-      "label": "规格编码",
-      "prop": "typeno",
-      "index": 3,
-      "width":100,
-      "cell": false,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入规格编码",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "规格型号",
       "prop": "specificationAndModel",
       "index": 4,

+ 5 - 0
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -873,6 +873,11 @@ export default {
           delete this.tableData[item].id
           delete this.tableData[item].status
           delete this.tableData[item].isDeleted
+          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+          this.$set(this.tableData[item], 'purchaseQuantity', 0)
+          this.$set(this.tableData[item], 'actualQuantity', 0)
+          this.$set(this.tableData[item], 'purchaseAmount', 0)
+          this.$set(this.tableData[item], 'deliveryAmount', 0)
           this.tableData[item].sort = this.maxGoodsNum + 1
           this.maxGoodsNum++
           this.$refs.crudContact.rowCellAdd(this.tableData[item]);

+ 0 - 1
src/views/businessManagement/salesOrder/configuration/BuyFree.json

@@ -14,7 +14,6 @@
   "dialogWidth": "60%",
   "tree": true,
   "border": true,
-  "index": true,
   "selection": true,
   "menuWidth": 300,
   "dialogClickModal": false,

+ 6 - 17
src/views/businessManagement/salesOrder/configuration/customerContact.json

@@ -33,7 +33,7 @@
         }
       ]
     },{
-      "label": "类",
+      "label": "产品分类",
       "prop": "priceCategory",
       "index": 1,
       "width":100,
@@ -41,7 +41,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入类",
+          "message": "请输入产品分类",
           "trigger": "blur"
         }
       ]
@@ -85,19 +85,6 @@
         }
       ]
     },{
-      "label": "规格编码",
-      "prop": "typeno",
-      "index": 3,
-      "width":100,
-      "cell": false,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入规格编码",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "规格型号",
       "prop": "specificationAndModel",
       "index": 4,
@@ -129,7 +116,8 @@
       "prop": "actualQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
@@ -142,7 +130,8 @@
       "prop": "storageQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,

+ 0 - 1
src/views/businessManagement/salesOrder/configuration/optionPolicy.json

@@ -14,7 +14,6 @@
   "dialogWidth": "60%",
   "tree": true,
   "border": true,
-  "index": true,
   "selection": true,
   "menuWidth": 300,
   "dialogClickModal": false,

+ 104 - 9
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -78,7 +78,8 @@
               <el-input
                 v-if="row.$cellEdit"
                 v-model="row.orderQuantity"
-                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'                size="small"
+                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+                size="small"
                 @input="quantityChange(row)"
               ></el-input>
               <span v-else>{{ row.orderQuantity }}</span>
@@ -88,10 +89,42 @@
                 v-if="row.$cellEdit"
                 v-model="row.price"
                 size="small"
-                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'                @input="priceChange(row)"
+                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+                @input="priceChange(row)"
               ></el-input>
               <span v-else>{{ row.price }}</span>
             </template>
+            <template slot="storageQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.storageQuantity"
+                size="small"
+                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              ></el-input>
+              <span v-else>{{ row.storageQuantity }}</span>
+            </template>
+            <template slot="actualQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.actualQuantity"
+                size="small"
+                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              ></el-input>
+              <span v-else>{{ row.actualQuantity }}</span>
+            </template>
+<!--            <template slot="specificationAndModel" slot-scope="{ row }">-->
+<!--              <el-select-->
+<!--                v-if="row.$cellEdit && row.typeData.length > 0"-->
+<!--                v-model="row.specificationAndModel"-->
+<!--                size="small"-->
+<!--              ></el-select>-->
+<!--              <el-input-->
+<!--                v-else-if="row.$cellEdit && row.typeData.length == 0"-->
+<!--                v-model="row.specificationAndModel"-->
+<!--                size="small"-->
+<!--              ></el-input>-->
+<!--              <span v-else>{{ row.specificationAndModel }}</span>-->
+<!--            </template>-->
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                   type="text"
@@ -451,8 +484,10 @@ import {
   corpsitem,
   getList,
   detailList,
-  generateShipment
+  generateShipment,
+
 } from "@/api/basicData/configuration"
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 import customerContact from "./configuration/customerContact.json"
 import advantageProject from "./configuration/advantageProject.json"
 import bankOfDeposit from "./configuration/bankOfDeposit.json"
@@ -488,6 +523,7 @@ export default {
         dicData: []
       },
       data: [],
+      policyForm: {},
       dataPolicy: [],
       contactsDataBuyFree: [],
       loadingCost: false,
@@ -999,6 +1035,12 @@ export default {
       this.statusOption = res.data.data
     })
     this.$set(this.form, 'orderStatus', '录入')
+    // this.optionPolicy.selectable = function(row, index) {
+    //   return false
+    // }
+    // this.customerBuyFree.selectable = function(row, index) {
+    //   return false
+    // }
     if (this.detailData.id) {
       // let id = this.$route.query.id.replace(/\"/g, "")
       this.queryData(this.detailData.id)
@@ -1099,7 +1141,11 @@ export default {
     },
     //商品编辑
     rowCell(row, index) {
-      console.log(row)
+      if (row.$cellEdit) {
+        if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
+          return this.$message.error('订货数量不能小于发货数量')
+        }
+      }
       this.$refs.crudContact.rowCell(row, index)
     },
     //费用编辑
@@ -1192,7 +1238,7 @@ export default {
         this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
         this.contactsData[this.choiceIndexT].code = this.tableData[0].code
         this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
-        this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
+        this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specs
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
         this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
         this.contactsData[this.choiceIndexT].orderQuantity = 0
@@ -1235,12 +1281,21 @@ export default {
       // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
+          let data = {
+            goodsId: this.tableData[item].id,
+            typeno: this.tableData[item].specs
+          }
+          selectGoodsNum(data).then(res => {
+            console.log(res.data)
+          })
           this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
           delete this.tableData[item].goodsTypeName
           this.tableData[item].itemId = this.tableData[item].id
-          // this.tableData[item].orderQuantity = 0
+          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+          this.$set(this.tableData[item], 'priceType', '一般')
           this.$set(this.tableData[item], 'orderQuantity', 0)
+          this.$set(this.tableData[item], 'actualQuantity', 0)
+          this.$set(this.tableData[item], 'storageQuantity', 0)
           this.tableData[item].price = 0
           this.tableData[item].amount = 0
           this.tableData[item].sort = this.maxGoodsNum + 1
@@ -1264,7 +1319,10 @@ export default {
     closePolicy() {
       this.treePolicyId = '';
       this.dataPolicy = [];
+      this.policyForm = {};
       this.contactsDataBuyFree = [];
+      this.policyData = []
+      this.policyDataTwo = []
     },
     //选中触发
     selectionChange(list) {
@@ -1304,17 +1362,48 @@ export default {
     },
     //销售政策特价促销选中触发
     selectionChangePolicy(list) {
-      this.policyData = list
+      console.log(list)
+      this.policyData = this.policyData.concat(list)
+      // this.policyData.forEach(item => {
+      //   this.$set(item, 'price', item.specialOffer)
+      // })
+      if (this.policyData.length > 0) {
+        this.customerBuyFree.selection = false
+      } else {
+        this.customerBuyFree.selection = true
+      }
     },
     //销售政策买赠促销选中触发
     selectionChangePolicyTwo(list) {
-      this.policyDataTwo = list
+      this.policyDataTwo = this.policyDataTwo.concat(list)
+      // this.policyDataTwo.forEach(item => {
+      //   this.$set(item, 'price', item.salesPrice)
+      // })
+      if (this.policyDataTwo.length > 0) {
+        this.optionPolicy.selection = false
+      } else {
+        this.optionPolicy.selection = true
+      }
     },
     //导入商品政策
     importPolicy() {
       let list = this.policyData.concat(this.policyDataTwo)
       for (let item in list) {
         console.log(list[item])
+        if (this.policyData.length > 0) {
+          this.$set(list[item], 'price', list[item].specialOffer)
+        } else {
+          this.$set(list[item], 'price', list[item].salesPrice)
+        }
+        this.$set(list[item], 'actualQuantity', 0)
+        this.$set(list[item], 'storageQuantity', 0)
+        this.$set(list[item], 'orderQuantity', 0)
+        this.$set(list[item], 'amount', 0)
+        this.$set(list[item], 'priceCategory', this.policyForm.cname)
+        this.$set(list[item], 'priceType', this.policyForm.cname)
+        this.$set(list[item], 'cname', list[item].productCategory)
+        this.$set(list[item], 'sort', this.maxGoodsNum + 1)
+        this.maxGoodsNum++
         this.$refs.crudContact.rowCellAdd(list[item]);
         this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
       }
@@ -1374,6 +1463,7 @@ export default {
     policyOnLoad(params = {}) {
       // this.policyLoading = true;
       detailList(this.treePolicyId).then(res => {
+        this.policyForm = res.data.data
         //特价促销
         this.dataPolicy = res.data.data.specialItemList
         //买赠促销
@@ -1480,6 +1570,11 @@ export default {
       console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          for (let item in this.contactsData) {
+            if (Number(this.contactsData[item].orderQuantity) < Number(this.contactsData[item].actualQuantity)) {
+              return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
+            }
+          }
           //商品信息
           this.form.orderItemsList = this.contactsData
           this.form.orderFeesList = this.advantageProjectData