Browse Source

修改bug

QuKatie 3 years ago
parent
commit
b0de468d3f

+ 9 - 2
src/api/statisticAnalysis/salesProfit.js

@@ -1,6 +1,6 @@
 import request from '@/router/axios';
 
-export const getList = (current, size,params) => {
+export const getList = (current, size, params) => {
   return request({
     url: '/api/blade-purchase-sales/exportOrder/profit',
     method: 'get',
@@ -10,4 +10,11 @@ export const getList = (current, size,params) => {
       size
     }
   })
-}
+}
+export const getProfitItem = (query) => {
+  return request({
+    url: '/api/blade-purchase-sales/exportOrder/getProfitItem',
+    method: 'get',
+    params: query
+  })
+}

+ 10 - 6
src/components/part-dialog/configuration/mainList.json

@@ -3,14 +3,13 @@
   "border": true,
   "index": true,
   "addBtn": false,
-  "menuWidth":140,
+  "menuWidth": 140,
   "selection": true,
-  "tip":false,
-  "delBtn":false,
-  "editBtn":false,
+  "tip": false,
+  "delBtn": false,
+  "editBtn": false,
   "showSummary": true,
-  "column": [
-    {
+  "column": [{
       "label": "类型",
       "prop": "goodTypeName",
       "width": 150
@@ -36,6 +35,11 @@
       "width": 80
     },
     {
+      "label": "配件成本",
+      "prop": "partsCost",
+      "width": 120
+    },
+    {
       "label": "单价",
       "prop": "price",
       "width": 120

+ 3 - 1
src/components/part-dialog/main.vue

@@ -217,6 +217,7 @@ export default {
               item.goodName = e.cname;
               item.ename = e.ename;
               item.price = e.purchaseAmount;
+              item.partsCost = e.price;
               item.goodNumber = this.partreData.goodNumber;
               item.amout = _.multiply(
                 Number(
@@ -234,13 +235,14 @@ export default {
             goodId: e.itemId,
             goodTypeId: e.goodTypeId,
             goodTypeName: e.goodsTypeName,
-            ename:e.ename,
+            ename: e.ename,
             corpId: e.corpId,
             corpName: e.corpName,
             goodName: e.cname,
             price: e.purchaseAmount,
             goodNumber: 1,
             amout: e.purchaseAmount,
+            partsCost: e.price,
             $cellEdit: true
           });
         });

+ 21 - 14
src/components/price-Library/configuration/mainList.json

@@ -48,98 +48,105 @@
       "search": true,
       "searchSpan": 6,
       "prop": "ename",
-      "index": 3,
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "最新价格",
+      "prop": "price",
+      "index": 5,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "采购价格",
       "prop": "purchaseAmount",
-      "index": 4,
+      "index": 6,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "供应商",
       "prop": "corpId",
-      "index": 5,
+      "index": 7,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "税率",
       "prop": "taxRate",
-      "index": 6,
+      "index": 8,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "币别",
       "prop": "currency",
-      "index": 7,
+      "index": 9,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "推荐理由",
       "prop": "referrerReason",
-      "index": 8,
+      "index": 10,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "有效截止日期",
       "prop": "endTime",
-      "index": 9,
+      "index": 11,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史价格1",
       "prop": "priceOne",
-      "index": 10,
+      "index": 12,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史日期1",
       "prop": "priceOneTime",
-      "index": 11,
+      "index": 13,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史价格2",
       "prop": "priceTwo",
-      "index": 12,
+      "index": 14,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史日期2",
       "prop": "priceTwoTime",
-      "index": 13,
+      "index": 15,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史价格3",
       "prop": "priceThree",
-      "index": 14,
+      "index": 16,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "历史日期3",
       "prop": "priceThreeTime",
-      "index": 15,
+      "index": 17,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "英文描述",
       "prop": "cnameDescription",
-      "index": 27,
+      "index": 18,
       "width": 100,
       "overHidden": true
     }

+ 0 - 1
src/components/price-Library/main.vue

@@ -108,7 +108,6 @@ export default {
         }
       }
       this.visible = false;
-      console.log(this.partType)
       if(this.partType){
         this.$emit("librayToPart", this.selectionList,this.partreData);
       }else{

+ 10 - 8
src/components/report-dialog/main.vue

@@ -85,8 +85,8 @@ export default {
     reportId: {
       type: String
     },
-    searchValue:{
-      type:Object
+    searchValue: {
+      type: Object
     }
   },
   filters: {
@@ -120,8 +120,8 @@ export default {
       });
     },
     goReport(name) {
-      let tenantId = this.$store.getters.userInfo.tenant_id
-      if(this.reportName == "同海-统计列表"){
+      let tenantId = this.$store.getters.userInfo.tenant_id;
+      if (this.reportName == "同海-统计列表") {
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
           &tenantId=${this.searchValue.tenantId}
@@ -134,11 +134,11 @@ export default {
       &payEndTime=${this.searchValue.payEndTime}
       &userName=${this.searchValue.userName}`
         });
-      }else if(name == "客户资料-客户资料.ureport.xml"){
+      } else if (name == "客户资料-客户资料.ureport.xml") {
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`
         });
-      }else if(name == "国内贸易-库存账.ureport.xml"){
+      } else if (name == "国内贸易-库存账.ureport.xml") {
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
           &code=${this.searchValue.code}
@@ -152,9 +152,11 @@ export default {
           &brand=${this.searchValue.brand}
           &tenantId=${tenantId}`
         });
-      }else{
+      } else {
+        let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
+          .user_id;
         this.$router.push({
-          path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}`
+          path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&userId=${userId}`
         });
       }
       this.$emit("onClose", false);

+ 10 - 0
src/util/calculate.js

@@ -10,6 +10,16 @@ export function productCal(num, num2, num3) {
   const sum = _.multiply(_.add(price, fitting), _.add(1, _.divide(fob, 100)))
   return Number(sum).toFixed(2)
 }
+export function costsCal(num, num2, num3) {
+  //数字1
+  const price1 = Number(num ? num : 0)
+  //数字2
+  const price2 = Number(num2 ? num2 : 0)
+  //数量
+  const Num = Number(num3 ? num3 : 0)
+  const sum = _.add(price1, _.multiply(price2, Num))
+  return Number(sum).toFixed(2)
+}
 //产品价格/汇率 计算出销售价格
 export function sellingCal(num, num2) {
   //产品价格

+ 24 - 17
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -84,37 +84,44 @@
       "overHidden": true
     },
     {
+      "label": "配件成本",
+      "prop": "partsCost",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
       "label": "配件价格",
       "prop": "partsPrice",
-      "index": 11,
+      "index": 12,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "配件价格描述",
       "prop": "partsPriceDescribe",
-      "index": 12,
+      "index": 13,
       "width": 120,
       "overHidden": true
     },
     {
       "label": "供应商",
       "prop": "corpId",
-      "index": 13,
+      "index": 14,
       "width": 200,
       "overHidden": true
     },
     {
       "label": "重点推荐",
       "prop": "priorityReferrer",
-      "index": 14,
+      "index": 15,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "推荐理由",
       "prop": "referrerReason",
-      "index": 15,
+      "index": 16,
       "width": 100,
       "overHidden": true,
       "cell": true
@@ -122,28 +129,28 @@
     {
       "label": "产品价格",
       "prop": "productPrice",
-      "index": 16,
+      "index": 17,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "销售价",
       "prop": "price",
-      "index": 17,
+      "index": 18,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "单品毛利率",
       "prop": "itemMargin",
-      "index": 18,
+      "index": 19,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "index": 19,
+      "index": 20,
       "width": 100,
       "overHidden": true,
       "cell": true,
@@ -157,49 +164,49 @@
     {
       "label": "数量",
       "prop": "orderQuantity",
-      "index": 20,
+      "index": 21,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "保险",
       "prop": "insurance",
-      "index": 21,
+      "index": 22,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "运费",
       "prop": "freight",
-      "index": 22,
+      "index": 23,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "折扣",
       "prop": "discount",
-      "index": 23,
+      "index": 24,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "金额",
       "prop": "amount",
-      "index": 24,
+      "index": 25,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "税率",
       "prop": "taxRate",
-      "index": 25,
+      "index": 26,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "备注",
       "prop": "remarks",
-      "index": 26,
+      "index": 27,
       "width": 100,
       "overHidden": true,
       "cell": true
@@ -207,7 +214,7 @@
     {
       "label": "商品信息",
       "prop": "productRemark",
-      "index": 27,
+      "index": 28,
       "width": 100,
       "overHidden": true,
       "cell": true

+ 9 - 3
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -582,7 +582,8 @@ import {
   transformCal,
   grossProfitCal,
   STGPCal,
-  numCal
+  numCal,
+  costsCal
 } from "@/util/calculate";
 
 import _ from "lodash";
@@ -758,7 +759,7 @@ export default {
             valueFormat: "yyyy-MM-dd 00:00:00"
           },
           {
-            label: "单号",
+            label: "报价单号",
             prop: "orderNo",
             span: 8
           },
@@ -1216,14 +1217,17 @@ export default {
       );
       const names = [];
       const namePrices = [];
+      let costsSum = 0;
       rows.map(e => {
         if (e.ename) {
           names.push(e.ename);
         }
         namePrices.push((e.goodName ? e.goodName : "") + ":" + e.amout);
+        costsSum = costsCal(costsSum, e.partsCost, e.goodNumber);
       });
       this.data[index].partsDescribe = names.join(",");
       this.data[index].partsPriceDescribe = namePrices.join(";");
+      this.data[index].partsCost = costsSum;
       this.priceChange(this.data[index]);
     },
     importProperty(row, index) {
@@ -1584,6 +1588,7 @@ export default {
     },
     importLibray(rows) {
       rows.forEach(e => {
+        console.log(e);
         this.data.push({
           itemId: e.itemId,
           code: e.code,
@@ -1784,10 +1789,11 @@ export default {
             paySum
           );
           this.subLoading = true;
+          
           submit({
             ...this.form,
             orderItemsList: this.data,
-            orderFeesList: orderFeesList
+            orderFeesList: orderFeesList,
           })
             .then(res => {
               if (res.data.code == 200) {

+ 6 - 7
src/views/exportTrade/customerInquiry/index.vue

@@ -342,6 +342,7 @@ export default {
         params.createTimeStart = params.createTime[0];
         params.createTimeEnd = params.createTime[1];
       }
+      this.search = this.deepClone(params);
       delete params.businesDate;
       delete params.dateValidity;
       delete params.createTime;
@@ -363,18 +364,16 @@ export default {
           orderStartDate: this.search.businesDate[0],
           orderEndDate: this.search.businesDate[1]
         };
-        delete params.businesDate;
-        // delete this.search.businesDate;
       }
+      let data = this.deepClone(Object.assign(params, this.search));
+      delete data.businesDate;
+      delete data.dateValidity;
+      delete data.createTime;
       this.loading = true;
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false);
       });
-      getList(
-        page.currentPage,
-        page.pageSize,
-        params
-      )
+      getList(page.currentPage, page.pageSize, data)
         .then(res => {
           if (res.data.data.records) {
             res.data.data.records.forEach(e => {

+ 47 - 2
src/views/exportTrade/invoice/detailsPage.vue

@@ -812,7 +812,16 @@ export default {
                   res.data.data.deliveryFilesList
                 );
                 if (status2 == "goBack") {
+                  if (this.form.id) {
+                    this.unLock({
+                      moduleName: "fh",
+                      tableName: "business_order",
+                      billId: this.form.id,
+                      billNo: this.form.orgOrderNo
+                    });
+                  }
                   this.$emit("goBack");
+                  this.leaveDetailsKey(this.$route.name);
                 }
               })
               .finally(() => {
@@ -899,10 +908,28 @@ export default {
             this.editCustomer("submit", "goBack");
           })
           .catch(() => {
+            if (this.form.id) {
+              this.unLock({
+                moduleName: "fh",
+                tableName: "business_order",
+                billId: this.form.id,
+                billNo: this.form.orgOrderNo
+              });
+            }
             this.$emit("goBack");
+            this.leaveDetailsKey(this.$route.name);
           });
       } else {
+        if (this.form.id) {
+          this.unLock({
+            moduleName: "fh",
+            tableName: "business_order",
+            billId: this.form.id,
+            billNo: this.form.orgOrderNo
+          });
+        }
         this.$emit("goBack");
+        this.leaveDetailsKey(this.$route.name);
       }
     },
     openReport() {
@@ -942,8 +969,26 @@ export default {
       return sums;
     },
     openEdit() {
-      this.detailData.status = 2;
-      this.option = this.$options.data().option;
+      const data = {
+        moduleName: "fh",
+        tableName: "business_order",
+        billId: this.form.id,
+        no: localStorage.getItem("browserID"),
+        billNo: this.form.orgOrderNo
+      };
+      this.inDetailsKey(this.$route.name, {
+        moduleName: "fh",
+        tableName: "business_order",
+        billId: this.form.id,
+        billNo: this.form.orgOrderNo
+      });
+      this.checkLock(data).then(res => {
+        if (res.data.code == 200) {
+          this.onLock(data);
+          this.detailData.status = 2;
+          this.option = this.$options.data().option;
+        }
+      });
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(

+ 1 - 1
src/views/exportTrade/invoice/index.vue

@@ -102,7 +102,7 @@
             type="text"
             icon="el-icon-edit"
             size="small"
-            @click.stop="editOpen(scope.row, 2)"
+            @click.stop="editOpen(scope.row, 1)"
             >编辑
           </el-button>
           <el-button

+ 1 - 1
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -964,7 +964,7 @@ export default {
               if (status == "goBack") {
                 if (this.form.id) {
                   this.unLock({
-                    moduleName: "xs",
+                    moduleName: "cg",
                     tableName: "business_order",
                     billId: this.form.id,
                     billNo: this.form.orgOrderNo

+ 48 - 2
src/views/exportTrade/purchaseInquiry/detailsPage.vue

@@ -70,6 +70,7 @@
               v-model="form.dateValidity"
               type="date"
               placeholder="选择日期"
+              :disabled="detailData.status == 1"
               :picker-options="pickerOptions"
             ></el-date-picker>
           </template>
@@ -818,7 +819,16 @@ export default {
                     : []
                 );
                 if (status2 == "goBack") {
+                  if (this.form.id) {
+                    this.unLock({
+                      moduleName: "xj",
+                      tableName: "business_order",
+                      billId: this.form.id,
+                      billNo: this.form.orgOrderNo
+                    });
+                  }
                   this.$emit("goBack");
+                  this.leaveDetailsKey(this.$route.name);
                 }
               })
               .finally(() => {
@@ -865,10 +875,28 @@ export default {
             this.editCustomer("save", "goBack");
           })
           .catch(() => {
+            if (this.form.id) {
+              this.unLock({
+                moduleName: "xj",
+                tableName: "business_order",
+                billId: this.form.id,
+                billNo: this.form.orgOrderNo
+              });
+            }
             this.$emit("goBack");
+            this.leaveDetailsKey(this.$route.name);
           });
       } else {
+        if (this.form.id) {
+          this.unLock({
+            moduleName: "xj",
+            tableName: "business_order",
+            billId: this.form.id,
+            billNo: this.form.orgOrderNo
+          });
+        }
         this.$emit("goBack");
+        this.leaveDetailsKey(this.$route.name);
       }
     },
     openReport() {
@@ -903,8 +931,26 @@ export default {
       return sums;
     },
     openEdit() {
-      this.detailData.status = 2;
-      this.option = this.$options.data().option;
+      const data = {
+        moduleName: "xj",
+        tableName: "business_order",
+        billId: this.form.id,
+        no: localStorage.getItem("browserID"),
+        billNo: this.form.orgOrderNo
+      };
+      this.inDetailsKey(this.$route.name, {
+        moduleName: "xj",
+        tableName: "business_order",
+        billId: this.form.id,
+        billNo: this.form.orgOrderNo
+      });
+      this.checkLock(data).then(res => {
+        if (res.data.code == 200) {
+          this.onLock(data);
+          this.detailData.status = 2;
+          this.option = this.$options.data().option;
+        }
+      });
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(

+ 47 - 2
src/views/exportTrade/receipt/detailsPage.vue

@@ -821,7 +821,16 @@ export default {
                 );
                 this.$message.success("保存成功");
                 if (status2 == "goBack") {
+                  if (this.form.id) {
+                    this.unLock({
+                      moduleName: "sh",
+                      tableName: "business_order",
+                      billId: this.form.id,
+                      billNo: this.form.orgOrderNo
+                    });
+                  }
                   this.$emit("goBack");
+                  this.leaveDetailsKey(this.$route.name);
                 }
               })
               .finally(() => {
@@ -908,10 +917,28 @@ export default {
             this.editCustomer("submit", "goBack");
           })
           .catch(() => {
+            if (this.form.id) {
+              this.unLock({
+                moduleName: "sh",
+                tableName: "business_order",
+                billId: this.form.id,
+                billNo: this.form.orgOrderNo
+              });
+            }
             this.$emit("goBack");
+            this.leaveDetailsKey(this.$route.name);
           });
       } else {
+        if (this.form.id) {
+          this.unLock({
+            moduleName: "sh",
+            tableName: "business_order",
+            billId: this.form.id,
+            billNo: this.form.orgOrderNo
+          });
+        }
         this.$emit("goBack");
+        this.leaveDetailsKey(this.$route.name);
       }
     },
     openReport() {
@@ -949,8 +976,26 @@ export default {
       return sums;
     },
     openEdit() {
-      this.detailData.status = 2;
-      this.option = this.$options.data().option;
+      const data = {
+        moduleName: "sh",
+        tableName: "business_order",
+        billId: this.form.id,
+        no: localStorage.getItem("browserID"),
+        billNo: this.form.orgOrderNo
+      };
+      this.inDetailsKey(this.$route.name, {
+        moduleName: "sh",
+        tableName: "business_order",
+        billId: this.form.id,
+        billNo: this.form.orgOrderNo
+      });
+      this.checkLock(data).then(res => {
+        if (res.data.code == 200) {
+          this.onLock(data);
+          this.detailData.status = 2;
+          this.option = this.$options.data().option;
+        }
+      });
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(

+ 1 - 1
src/views/exportTrade/receipt/index.vue

@@ -93,7 +93,7 @@
             type="text"
             icon="el-icon-edit"
             size="small"
-            @click.stop="editOpen(scope.row, 2)"
+            @click.stop="editOpen(scope.row, 1)"
             >编辑
           </el-button>
           <el-button

+ 33 - 19
src/views/exportTrade/salesContract/config/customerContact.json

@@ -64,51 +64,65 @@
       "overHidden": true
     },
     {
+      "label": "采购成本",
+      "prop": "purchaseCost",
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    },
+    {
       "label": "采购单价",
       "prop": "purchaseAmount",
-      "index": 8,
+      "index": 9,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "配件信息",
       "prop": "partsDescribe",
-      "index": 9,
+      "index": 10,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "配件成本",
+      "prop": "partsCost",
+      "index": 11,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "配件价格",
       "prop": "partsPrice",
-      "index": 10,
+      "index": 12,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "配件价格描述",
       "prop": "partsPriceDescribe",
-      "index": 11,
+      "index": 13,
       "width": 120,
       "overHidden": true
     },
     {
       "label": "供应商",
       "prop": "corpId",
-      "index": 12,
+      "index": 14,
       "width": 200,
       "overHidden": true
     },
     {
       "label": "重点推荐",
       "prop": "priorityReferrer",
-      "index": 13,
+      "index": 15,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "推荐理由",
       "prop": "referrerReason",
-      "index": 14,
+      "index": 16,
       "width": 100,
       "overHidden": true,
       "cell": true
@@ -116,21 +130,21 @@
     {
       "label": "销售价",
       "prop": "price",
-      "index": 15,
+      "index": 17,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "单品毛利率",
       "prop": "itemMargin",
-      "index": 16,
+      "index": 18,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "index": 17,
+      "index": 19,
       "width": 100,
       "overHidden": true,
       "cell": true,
@@ -144,56 +158,56 @@
     {
       "label": "数量",
       "prop": "orderQuantity",
-      "index": 18,
+      "index": 20,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "发货数量",
       "prop": "actualQuantity",
-      "index": 19,
+      "index": 21,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "保险",
       "prop": "insurance",
-      "index": 20,
+      "index": 22,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "运费",
       "prop": "freight",
-      "index": 21,
+      "index": 23,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "折扣",
       "prop": "discount",
-      "index": 22,
+      "index": 24,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "金额",
       "prop": "amount",
-      "index": 23,
+      "index": 25,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "税率",
       "prop": "taxRate",
-      "index": 24,
+      "index": 26,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "备注",
       "prop": "remarks",
-      "index": 25,
+      "index": 27,
       "width": 100,
       "overHidden": true,
       "cell": true
@@ -201,7 +215,7 @@
     {
       "label": "商品信息",
       "prop": "productRemark",
-      "index": 26,
+      "index": 28,
       "width": 100,
       "overHidden": true,
       "cell": true

+ 19 - 1
src/views/exportTrade/salesContract/detailsPage.vue

@@ -99,6 +99,16 @@
               :disabled="detailData.status == 1"
             ></crop-select>
           </template>
+          <template slot="purchaseCost" slot-scope="{ row }">
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.purchaseCost"
+              size="small"
+              placeholder="请输入"
+              oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
+            ></el-input>
+            <span v-else>{{ row.purchaseCost | micrometerFormat }}</span>
+          </template>
           <template slot="belongToCorpId">
             <crop-select
               v-model="form.belongToCorpId"
@@ -684,7 +694,8 @@ import {
   transformCal,
   grossProfitCal,
   STGPCal,
-  numCal
+  numCal,
+  costsCal
 } from "@/util/calculate";
 import { getCorpsattn } from "@/api/basicData/customerInformation";
 export default {
@@ -1354,14 +1365,17 @@ export default {
       );
       const names = [];
       const namePrices = [];
+      let costsSum = 0;
       rows.map(e => {
         if (e.ename) {
           names.push(e.ename);
         }
         namePrices.push((e.goodName ? e.goodName : "") + ":" + e.amout);
+        costsSum = costsCal(costsSum, e.partsCost, e.goodNumber);
       });
       this.data[index].partsDescribe = names.join(",");
       this.data[index].partsPriceDescribe = namePrices.join(";");
+      this.data[index].partsCost = costsSum;
       this.priceChange(this.data[index]);
     },
     importProperty(row, index) {
@@ -1599,6 +1613,7 @@ export default {
                 item.itemType = this.reData.itemType;
                 item.tradeTerms = this.reData.tradeTerms;
                 item.partsDescribe = this.reData.partsDescribe;
+                item.purchaseCost = 0;
                 item.purchaseAmount = 0;
                 item.productPrice = productCal(
                   0,
@@ -1681,6 +1696,8 @@ export default {
             unit: e.unit,
             itemMargin: 0,
             remarks: null,
+            purchaseCost: 0,
+            purchaseAmount: 0,
             exchangeRate: this.form.exchangeRate,
             partsDescribe: null,
             $cellEdit: true
@@ -1732,6 +1749,7 @@ export default {
           cname: e.cname,
           ename: e.ename,
           priceCategory: e.goodsTypeName,
+          purchaseCost: e.price,
           purchaseAmount: e.purchaseAmount,
           itemProp: null,
           remarksOne: null,

+ 47 - 2
src/views/exportTrade/shippingInquiry/detailsPage.vue

@@ -545,7 +545,16 @@ export default {
                     : []
                 );
                 if (status2 == "goBack") {
+                  if (this.form.id) {
+                    this.unLock({
+                      moduleName: "cw",
+                      tableName: "business_order",
+                      billId: this.form.id,
+                      billNo: this.form.orgOrderNo
+                    });
+                  }
                   this.$emit("goBack");
+                  this.leaveDetailsKey(this.$route.name);
                 }
               })
               .finally(() => {
@@ -597,10 +606,28 @@ export default {
             this.editCustomer("submit", "goBack");
           })
           .catch(() => {
+            if (this.form.id) {
+              this.unLock({
+                moduleName: "cw",
+                tableName: "business_order",
+                billId: this.form.id,
+                billNo: this.form.orgOrderNo
+              });
+            }
             this.$emit("goBack");
+            this.leaveDetailsKey(this.$route.name);
           });
       } else {
+        if (this.form.id) {
+          this.unLock({
+            moduleName: "cw",
+            tableName: "business_order",
+            billId: this.form.id,
+            billNo: this.form.orgOrderNo
+          });
+        }
         this.$emit("goBack");
+        this.leaveDetailsKey(this.$route.name);
       }
     },
     onClose(val) {
@@ -632,8 +659,26 @@ export default {
       return sums;
     },
     openEdit() {
-      this.detailData.status = 2;
-      this.option = this.$options.data().option;
+      const data = {
+        moduleName: "cw",
+        tableName: "business_order",
+        billId: this.form.id,
+        no: localStorage.getItem("browserID"),
+        billNo: this.form.orgOrderNo
+      };
+      this.inDetailsKey(this.$route.name, {
+        moduleName: "cw",
+        tableName: "business_order",
+        billId: this.form.id,
+        billNo: this.form.orgOrderNo
+      });
+      this.checkLock(data).then(res => {
+        if (res.data.code == 200) {
+          this.onLock(data);
+          this.detailData.status = 2;
+          this.option = this.$options.data().option;
+        }
+      });
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(

+ 111 - 1
src/views/statisticAnalysis/salesProfit/index.vue

@@ -17,7 +17,17 @@
         :table-loading="loading"
         @saveColumn="saveColumn"
         @resetColumn="resetColumn"
+        @expand-change="expandChange"
       >
+        <template slot-scope="{ row }" slot="expand">
+          <avue-crud
+            :data="row.itemData"
+            :option="itemOption"
+            :table-loading="row.itemLoading"
+            :cell-style="cellStyle"
+            class="itemTable"
+          ></avue-crud>
+        </template>
         <template slot="corpIdSearch">
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
@@ -42,7 +52,7 @@
 </template>
 
 <script>
-import { getList } from "@/api/statisticAnalysis/salesProfit";
+import { getList, getProfitItem } from "@/api/statisticAnalysis/salesProfit";
 export default {
   name: "index",
   data() {
@@ -72,6 +82,8 @@ export default {
         searchLabelWidth: 100,
         searchIcon: true,
         searchIndex: 2,
+        expand: true,
+        expandWidth: 38,
         menu: false,
         column: [
           {
@@ -161,6 +173,79 @@ export default {
             width: 100
           }
         ]
+      },
+      itemOption: {
+        align: "center",
+        header: false,
+        menu: false,
+        column: [
+          {
+            label: "产品类别",
+            prop: "priceCategory",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品名称",
+            prop: "cname",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品成本",
+            prop: "purchaseAmount",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "原始成本",
+            prop: "purchaseCost",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "配件成本",
+            prop: "partsPrice",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "原始成本",
+            prop: "partsCost",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "销售价",
+            prop: "price",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "汇率",
+            prop: "exchangeRate",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "销售金额",
+            prop: "amount",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品毛利",
+            prop: "productGrossMargin",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "产品毛利率 ",
+            prop: "itemMargin",
+            width: 100,
+            overHidden: true
+          }
+        ]
       }
     };
   },
@@ -168,6 +253,17 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
+    expandChange(row) {
+      if (!row.itemData) {
+        getProfitItem({ id: row.id })
+          .then(res => {
+            this.dataList[row.$index].itemData = res.data.data;
+          })
+          .finally(() => {
+            this.dataList[row.$index].itemLoading = false;
+          });
+      }
+    },
     //点击搜索按钮触发
     searchChange(params, done) {
       if (params.businesDate) {
@@ -191,8 +287,16 @@ export default {
     },
     onLoad(page, params) {
       this.loading = true;
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
       getList(page.currentPage, page.pageSize, params)
         .then(res => {
+          if (res.data.data.records) {
+            res.data.data.records.forEach(e => {
+              e.itemLoading = true;
+            });
+          }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
           if (this.page.total) {
@@ -226,4 +330,10 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+::v-deep .el-table__expanded-cell[class*="cell"] {
+  padding: 0px;
+}
+.itemTable ::v-deep .el-table {
+  width: 940px;
+}
 </style>

+ 71 - 63
src/views/system/lock/index.vue

@@ -18,21 +18,19 @@
         :table-loading="loading"
       >
         <template slot="moudleNameSearch">
-          <el-select
-            v-model="search.moudleName"
-            clearable
-            filterable
-          >
+          <el-select v-model="search.moudleName" clearable filterable>
             <el-option
               v-for="(item, index) in moudleOption"
               :label="item.label"
               :value="item.value"
-              :key="item.value"
+              :key="index"
             ></el-option>
           </el-select>
         </template>
         <template slot-scope="scope" slot="moudleName">
-          <span>{{ scope.row.moudleName | moudleNameFormat(moudleOption) }}</span>
+          <span>{{
+            scope.row.moudleName | moudleNameFormat(moudleOption)
+          }}</span>
         </template>
         <template slot="menu" slot-scope="{ row, index }">
           <el-button
@@ -40,7 +38,8 @@
             icon="el-icon-unlock"
             size="small"
             @click="rowUnlock(row, index)"
-          >解锁</el-button>
+            >解锁</el-button
+          >
         </template>
       </avue-crud>
     </basic-container>
@@ -49,7 +48,7 @@
 
 <script>
 import option from "./config/mainList.json";
-import {lockList, lockRemove} from "@/api/lock/lock";
+import { lockList, lockRemove } from "@/api/lock/lock";
 
 export default {
   name: "index",
@@ -61,58 +60,70 @@ export default {
       page: {
         pageSize: 10,
         pagerCount: 5,
-        total: 0,
+        total: 0
       },
       search: {},
       loading: false,
       moudleOption: [
         {
-          label: '销售',
-          value: 'xs'
+          label: "销售",
+          value: "xs"
+        },
+        {
+          label: "采购",
+          value: "cg"
+        },
+        {
+          label: "发货",
+          value: "fh"
         },
         {
-          label: '采购',
-          value: 'cg'
+          label: "收货",
+          value: "sh"
         },
         {
-          label: '发货',
-          value: 'fh'
+          label: "收费",
+          value: "sf"
         },
         {
-          label: '收货',
-          value: 'sh'
+          label: "付费",
+          value: "ff"
         },
         {
-          label: '收费',
-          value: 'sf'
+          label: "进项",
+          value: "jx"
         },
         {
-          label: '付费',
-          value: 'ff'
+          label: "销项",
+          value: "xx"
         },
         {
-          label: '进项',
-          value: 'jx'
+          label: "船务",
+          value: "cw"
         },
         {
-          label: '销项',
-          value: 'xx'
+          label: "报价",
+          value: "bj"
         },
         {
-          label: '小学部',
-          value: 'xxb'
+          label: "询价",
+          value: "xj"
         },
+        {
+          label: "小学部",
+          value: "xxb"
+        }
       ]
-    }
+    };
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(73), option);
     let i = 0;
     this.option.column.forEach(item => {
-      if (item.search) i++
-    })
-    if (i % 3 !== 0){
-      const num = 3 - Number(i % 3)
+      if (item.search) i++;
+    });
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3);
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
     }
@@ -120,13 +131,13 @@ export default {
   filters: {
     moudleNameFormat(row, moudleOption) {
       let name;
-      moudleOption.map((e) => {
+      moudleOption.map(e => {
         if (row == e.value) {
-          name = e.label
+          name = e.label;
         }
       });
       return name;
-    },
+    }
   },
   methods: {
     searchChange(params, done) {
@@ -142,15 +153,15 @@ export default {
     },
     refreshChange() {
       this.dataList.forEach(item => {
-        this.$refs.crud.toggleRowExpansion(item, false)
-      })
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
       this.page.currentPage = 1;
       this.onLoad(this.page, this.search);
     },
     onLoad(page, params) {
       this.dataList.forEach(item => {
-        this.$refs.crud.toggleRowExpansion(item, false)
-      })
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
       this.loading = true;
       lockList(page.currentPage, page.pageSize, params)
         .then(res => {
@@ -160,9 +171,9 @@ export default {
             this.option.height = window.innerHeight - 260;
           }
           this.dataList.forEach(item => {
-            this.$set(item,'insideList',[])
-            this.$set(item,'loading', true)
-          })
+            this.$set(item, "insideList", []);
+            this.$set(item, "loading", true);
+          });
         })
         .finally(() => {
           this.loading = false;
@@ -170,20 +181,22 @@ export default {
     },
     // 解锁
     rowUnlock(row, index) {
-      this.$confirm('是否确认解锁?', '提示', {
+      this.$confirm("是否确认解锁?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(() => {
-        return lockRemove({ids: row.id})
-      }).then(() => {
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        this.page.currentPage = 1;
-        this.onLoad(this.page, {parentId: 0});
       })
+        .then(() => {
+          return lockRemove({ ids: row.id });
+        })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.page.currentPage = 1;
+          this.onLoad(this.page, { parentId: 0 });
+        });
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
@@ -198,20 +211,15 @@ export default {
     },
     async resetColumn() {
       this.option = option;
-      const inSave = await this.delColumnData(
-        this.getColumnName(73),
-        option
-      );
+      const inSave = await this.delColumnData(this.getColumnName(73), option);
       if (inSave) {
         this.$message.success("重置成功");
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
-    },
-  },
-}
+    }
+  }
+};
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>