Browse Source

上架管理/销售单

caojunjie 2 years ago
parent
commit
48f042d04e

+ 7 - 0
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -31,3 +31,10 @@ export const submit = (data) => {
     data: data
   })
 }
+export const generateShipTask = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/generateShipTask',
+    method: 'post',
+    data: data
+  })
+}

+ 13 - 0
src/views/tirePartsMall/basicData/brandPage/detailsPage.vue

@@ -47,6 +47,7 @@
 <script>
 // import {submit} from "@/api/tirePartsMall/basicData/customerInformation";
 import {submit,getDetails,updateEnableOrNot} from "@/api/tirePartsMall/basicData/brandPage";
+import it from "element-ui/src/locale/lang/it";
 export default {
   name: "detailsPage",
   data() {
@@ -132,6 +133,18 @@ export default {
     },
     //修改提交触发
     editCustomer() {
+      if (this.form.brandFilesList.length === 0){
+        return this.$message.error("请上传主图")
+      }
+      let num = 0
+      for (let item of this.form.brandFilesList){
+        if (item.version == 0){
+          num++
+        }
+      }
+      if (num > 1){
+        return this.$message.error("主图类型重复")
+      }
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {

+ 36 - 14
src/views/tirePartsMall/basicData/customerInformation/js/optionList.js

@@ -70,15 +70,15 @@ export const option = {
       label: "是否启用",
       prop: "enableOrNot",
       overHidden: true,
-      hide:true,
-      showColumn:false,
+      hide: true,
+      showColumn: false,
       type: 'select',
-      dicData:[{
-        label:'否',
-        value:0
-      },{
-        label:'是',
-        value:1
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
       }]
     },
     {
@@ -197,9 +197,31 @@ export const option2 = {
   dialogTop: 25,
   dialogWidth: "80%",
   column: [{
+    label: '联系人',
+    prop: 'contacts',
+    cell: true,
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ]
+  }, {
+    label: '电话',
+    prop: 'tel',
+    cell: true,
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ]
+  }, {
     label: "地址",
     prop: "belongtoarea",
-    dicData:[],
+    dicData: [],
     dataType: "string",
     type: "cascader",
     props: {
@@ -215,7 +237,7 @@ export const option2 = {
     ],
     filterable: true,
     cell: true
-  },{
+  }, {
     label: '详细地址',
     prop: 'detailedAddress',
     cell: true,
@@ -226,15 +248,15 @@ export const option2 = {
         trigger: "blur"
       }
     ]
-  },{
+  }, {
     label: '备注',
     prop: 'remarks',
     cell: true
-  },{
+  }, {
     label: '默认地址',
     prop: 'defaultAddres',
-    display:false,
-    width:100,
+    display: false,
+    width: 100,
   }]
 }
 export const option3 = {

+ 118 - 43
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -16,6 +16,12 @@
             size="small"
             @click="editCustomer">保存数据
         </el-button>
+        <el-button
+            class="el-button--small-yh"
+            type="primary"
+            size="small"
+            @click="generateOutbound">生成出库任务
+        </el-button>
       </div>
     </div>
     <div style="margin-top: 50px">
@@ -38,8 +44,8 @@
                 <el-button
                     :size="size" :disabled="disabled" :type="type"
                     :icon="row.$cellEdit?'el-icon-plus':'el-icon-edit'"
-                    @click="$refs.formContacts.rowCell(row,index)"
-                >{{ row.$cellEdit ? '确认' : '修改' }}
+                    @click="$refs.formContacts.rowEdit(row,index)"
+                >编辑
                 </el-button>
                 <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
                            @click="rowDelBox(row,index,'orderItemsList')">删除
@@ -94,7 +100,7 @@
 </template>
 
 <script>
-import {getDetails, submit} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import {getDetails, submit, generateShipTask} from "@/api/tirePartsMall/salesManagement/saleOrder";
 
 export default {
   name: "detailsPage",
@@ -102,7 +108,7 @@ export default {
     return {
       activeName: "sale_detail",
       disabled: false,
-      key:0,
+      key: 0,
       form: {
         orderItemsList: [],
         paymentRecordsList: [],
@@ -119,6 +125,15 @@ export default {
             label: 'cname',
             value: 'id'
           },
+          change:(data)=>{
+            if (this.$refs.form.DIC.customerId || data.value){
+              for (let item of this.$refs.form.DIC.customerId){
+                if (item.id == data.value){
+                  //   后端返回数据暂无联系人、地址等数据,无法下拉默认
+                }
+              }
+            }
+          },
           dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH',
           rules: [{
             required: true,
@@ -140,22 +155,25 @@ export default {
             trigger: "blur"
           }]
         }, {
-          label: '收货地址',
-          prop: "recAddress",
-          rules: [{
-            required: true,
-            message: " ",
-            trigger: "blur"
-          }]
-        }, {
           label: '单据编号',
           prop: "ordNo",
         }, {
           label: '来源单号',
           prop: "srcOrdNo",
+          disabled: true
+        }, {
+          label: '业务来源',
+          prop: "businessSource",
+          disabled: true
         }, {
           label: '应收类别',
           prop: "receivableType",
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
+          props: {
+            label: "dictValue",
+            value: "dictValue"
+          }
         }, {
           label: '联系人',
           prop: "contacts",
@@ -163,12 +181,41 @@ export default {
           label: '电话',
           prop: "phone",
         }, {
+          label: '收货地址',
+          prop: "recAddress",
+          type: 'select',
+          props: {
+            label: 'address',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/corpsAddr/corpsAddrList',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
           label: '配送方式',
           prop: "shipType",
         }, {
           label: '物流公司',
           prop: "logisticsCorpName"
         }, {
+          label: '成本',
+          prop: "cost"
+        }, {
+          label: '毛利',
+          prop: "grossProfit"
+        }, {
+          label: '销售金额',
+          prop: "salesAmount"
+        }, {
+          label: '运费',
+          prop: "freight"
+        }, {
+          label: '总金额',
+          prop: "totalMoney"
+        }, {
           label: '备注',
           prop: "remarks",
           type: 'textarea',
@@ -185,10 +232,10 @@ export default {
         addBtnText: "录入明细",
         refreshBtn: false,
         dialogDrag: true,
-        addBtn: false,
+        addBtn: true,
         span: 8,
         height: 500,
-        addRowBtn: true,
+        addRowBtn: false,
         editBtn: false,
         delBtn: false,
         menuWidth: 140,
@@ -197,38 +244,45 @@ export default {
         column: [{
           label: '物料编码',
           prop: 'goodsNo',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '商品名称',
           prop: 'goodsId',
-          width:100,
-          cell: true
+          width: 200,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll'
         }, {
           label: '品牌',
-          prop: 'bandr',
-          width:100,
-          cell: true
+          prop: 'brandId',
+          width: 100,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/brandDesc/listAll'
         }, {
           label: '规格型号',
           prop: 'propertyName',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '花纹',
           prop: 'pattern',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '商品描述',
           prop: 'goodsDescription',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '数量',
           prop: 'goodsNum',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '单位',
           prop: 'units',
@@ -238,33 +292,35 @@ export default {
             value: "dictValue"
           },
           dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '价格',
           prop: 'price',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '发货数量',
           prop: 'sendNum',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '利润',
           prop: 'profit',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '小计',
           prop: 'subTotalMoney',
-          width:100,
-          cell: true
+          width: 100
         }, {
           label: '返利',
           prop: 'thisAmount',
-          width:100,
-          cell: true
+          width: 100
+        }, {
+          label: '成本',
+          prop: 'costprie',
+          width: 100
+        }, {
+          label: '毛利',
+          prop: 'grossProfit',
+          width: 100
         }]
       },
       optionPaymentDetails: {},
@@ -357,6 +413,25 @@ export default {
     }
   },
   methods: {
+    generateOutbound() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(255,255,255,0.7)'
+          });
+          generateShipTask(this.form).then(res=>{
+            this.$message.success("生成出库任务成功");
+            loading.close();
+          }).finally(() => {
+            loading.close();
+          });
+        }
+      })
+    },
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid, done) => {
@@ -369,7 +444,7 @@ export default {
             background: 'rgba(255,255,255,0.7)'
           });
           submit({
-            bsType:"XS",
+            bsType: "XS",
             ...this.form
           }).then(res => {
             this.$message.success("保存成功");
@@ -396,7 +471,7 @@ export default {
         loading.close();
       })
     },
-    rowDelBox(row, index,type) {
+    rowDelBox(row, index, type) {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",