Browse Source

贸易和学校

QuKatie 3 years ago
parent
commit
31a91dcf7b

+ 13 - 0
src/api/statisticAnalysis/salesProfit.js

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

+ 1 - 1
src/components/price-Library/configuration/mainList.json

@@ -1,6 +1,6 @@
 {
   "border": true,
-  "searchMenuSpan": 8,
+  "searchMenuSpan": 24,
   "index": true,
   "viewBtn": false,
   "editBtn": false,

+ 27 - 19
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -58,54 +58,62 @@
       "label": "产品型号",
       "prop": "itemType",
       "index": 7,
-      "width": 100
+      "width": 100,
+      "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": 200,
       "overHidden": true
     },
     {
       "label": "配件价格",
       "prop": "partsPrice",
-      "index": 10,
+      "index": 11,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "配件价格描述",
       "prop": "partsPriceDescribe",
-      "index": 11,
+      "index": 12,
       "width": 120,
       "overHidden": true
     },
     {
       "label": "供应商",
       "prop": "corpId",
-      "index": 12,
+      "index": 13,
       "width": 200,
       "overHidden": true
     },
     {
       "label": "重点推荐",
       "prop": "priorityReferrer",
-      "index": 13,
+      "index": 14,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "推荐理由",
       "prop": "referrerReason",
-      "index": 14,
+      "index": 15,
       "width": 100,
       "overHidden": true,
       "cell": true
@@ -113,28 +121,28 @@
     {
       "label": "产品价格",
       "prop": "productPrice",
-      "index": 15,
+      "index": 16,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "销售价",
       "prop": "price",
-      "index": 16,
+      "index": 17,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "单品毛利率",
       "prop": "itemMargin",
-      "index": 17,
+      "index": 18,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "index": 18,
+      "index": 19,
       "width": 100,
       "overHidden": true,
       "cell": true,
@@ -148,49 +156,49 @@
     {
       "label": "数量",
       "prop": "orderQuantity",
-      "index": 19,
+      "index": 20,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "保险",
       "prop": "insurance",
-      "index": 20,
+      "index": 21,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "运费",
       "prop": "freight",
-      "index": 21,
+      "index": 22,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "折扣",
       "prop": "discount",
-      "index": 22,
+      "index": 23,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "金额",
       "prop": "amount",
-      "index": 23,
+      "index": 24,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "税率",
       "prop": "taxRate",
-      "index": 24,
+      "index": 25,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "备注",
       "prop": "remarks",
-      "index": 25,
+      "index": 26,
       "width": 100,
       "overHidden": true,
       "cell": true

+ 21 - 0
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -369,6 +369,16 @@
             ></crop-select>
             <span v-show="!row.$cellEdit">{{ row.corpName }}</span>
           </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="purchaseAmount" slot-scope="{ row }">
             <el-input
               v-if="row.$cellEdit"
@@ -1436,6 +1446,7 @@ export default {
                 item.itemDescription = e.cnameDescription;
                 item.itemType = this.reData.itemType;
                 item.tradeTerms = this.reData.tradeTerms;
+                item.purchaseCost = 0;
                 item.purchaseAmount = 0;
                 item.productPrice = productCal(
                   0,
@@ -1508,6 +1519,7 @@ export default {
             partsPrice: 0,
             itemType: null,
             tradeTerms: null,
+            purchaseCost: 0,
             purchaseAmount: 0,
             price: 0,
             orderQuantity: 0,
@@ -1570,6 +1582,7 @@ export default {
           cname: e.cname,
           ename: e.ename,
           priceCategory: e.goodsTypeName,
+          purchaseCost: e.price,
           purchaseAmount: e.purchaseAmount,
           itemProp: null,
           remarksOne: null,
@@ -1713,6 +1726,14 @@ export default {
                 )
               );
             }
+            this.data.forEach(e => {
+              e.productRemark =
+                e.ename + "\n" + e.itemDescription
+                  ? e.itemDescription
+                  : "" + " " + e.partsDescribe
+                  ? e.partsDescribe
+                  : "";
+            });
           }
           for (let i = 0; i < orderFeesList.length; i++) {
             if (orderFeesList[i].corpId == null) {

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

@@ -19,7 +19,7 @@
           @click.stop="openEdit"
           >编辑
         </el-button>
-        <el-dropdown style="margin-right: 8px;">
+        <el-dropdown style="margin-right: 8px;margin-left: 8px;">
           <el-button type="primary" size="small">
             审核处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
@@ -144,12 +144,12 @@
                 size="small"
                 type="text"
                 @click="rePick(row, index)"
-                :disabled="disabled"
+                :disabled="disabled||detailData.status == 1"
                 class="picker"
                 style="padding:4px 10px;float:left"
                 >选择</el-button
               >
-              <span> {{ row.cname }}</span>
+              <span>{{ row.cname }}</span>
             </template>
             <template slot="itemType" slot-scope="{ row }">
               <el-select
@@ -203,7 +203,7 @@
                 icon="el-icon-edit"
                 type="text"
                 @click="rowCell(row, index)"
-                :disabled="disabled"
+                :disabled="disabled||detailData.status == 1"
                 >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
               >
               <el-button

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

@@ -112,7 +112,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

+ 8 - 0
src/views/exportTrade/salesContract/detailsPage.vue

@@ -1862,6 +1862,14 @@ export default {
                 )
               );
             }
+            this.data.forEach(e => {
+              e.productRemark =
+                e.ename + "\n" + e.itemDescription
+                  ? e.itemDescription
+                  : "" + " " + e.partsDescribe
+                  ? e.partsDescribe
+                  : "";
+            });
           }
           const orderFeesList = this.$refs.feeInfo.submitData();
           for (let i = 0; i < orderFeesList.length; i++) {

+ 8 - 0
src/views/salaryManagement/primarySchool/detailsPage.vue

@@ -57,6 +57,7 @@
           @row-save="rowSave"
           @row-update="rowUpdate"
           :cell-style="cellStyle"
+          :row-style="rowStyle"
           :header-cell-class-name="headerCellClassName"
         >
           <template slot="menuLeft">
@@ -846,6 +847,13 @@ export default {
         return "headerCellClass";
       }
     },
+    rowStyle({ row, column, rowIndex }) {
+      if (rowIndex % 2 === 1) {
+        return {
+          backgroundColor: "#FAFAFA",
+        };
+      }
+    },
     getDetail(id) {
       detail(id).then(res => {
         this.form = res.data.data;

+ 2 - 2
src/views/salaryManagement/primarySchool/index.vue

@@ -25,9 +25,9 @@
           <el-button type="text" size="small" @click.stop="editOpen(row, 1)">
             查看
           </el-button>
-          <el-button type="text" size="small" @click.stop="editOpen(row, 1)">
+          <!-- <el-button type="text" size="small" @click.stop="editOpen(row, 1)">
             编辑
-          </el-button>
+          </el-button> -->
           <el-button type="text" size="small" @click.stop="rowDel(row, index)">
             删除
           </el-button>

+ 42 - 64
src/views/statisticAnalysis/salesProfit/index.vue

@@ -18,32 +18,37 @@
         @resetColumn="resetColumn"
         :cell-style="cellStyle"
       >
-        <template slot-scope="{ row }" slot="updateUser">
-          <span>{{ row.updateUserName }}</span>
+        <template slot="corpIdSearch">
+          <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
-        <template slot-scope="{ row, index }" slot="menu">
-          <el-button type="text" size="small" @click.stop="editOpen(row, 1)">
-            查看
-          </el-button>
-          <el-button type="text" size="small" @click.stop="editOpen(row, 2)">
-            编辑
-          </el-button>
-          <el-button type="text" size="small" @click.stop="rowDel(row, index)">
-            删除
-          </el-button>
+        <template slot="businesDateSearch">
+          <el-date-picker
+            v-model="search.businesDate"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
         </template>
+        <!-- <template slot-scope="{ row }" slot="corpId">
+          <span>{{ row.corpsName }}</span>
+        </template> -->
       </avue-crud>
     </basic-container>
   </div>
 </template>
 
 <script>
-import { getList, remove } from "@/api/salaryManagement/primarySchool";
+import { getList } from "@/api/statisticAnalysis/salesProfit";
 export default {
   name: "index",
   data() {
     return {
       form: {},
+      search: {},
       dataList: [],
       loading: false,
       isShow: true,
@@ -54,7 +59,7 @@ export default {
       },
       option: {
         searchShow: true,
-        searchMenuSpan: 16,
+        searchMenuSpan: 24,
         align: "center",
         searchSpan: 8,
         border: true,
@@ -67,94 +72,79 @@ export default {
         searchLabelWidth: 100,
         searchIcon: true,
         searchIndex: 2,
+        menu: false,
         column: [
           {
             label: "合同号",
-            prop: "",
+            prop: "orderNo",
             overHidden: true,
             width: 100,
             search: true
           },
           {
             label: "客户名称",
-            prop: "",
+            prop: "corpId",
             overHidden: true,
             width: 100,
-            search: true
+            search: true,
+            formatter: row => {
+              return row.corpsName;
+            }
           },
           {
             label: "合同日期",
-            prop: "",
+            prop: "businesDate",
             type: "date",
-            valueFormat: "yyyy-MM-dd",
+            format: "yyyy-MM-dd",
             overHidden: true,
-            width: 100
-          },
-          {
-            label: "合同日期开始",
-            prop: "DateStart",
-            type: "date",
-            valueFormat: "yyyy-MM-dd",
             search: true,
-            hide: true,
-            showColumn: false,
-            span: 8
-          },
-          {
-            label: "合同日期结束",
-            prop: "DateEnd",
-            type: "date",
-            valueFormat: "yyyy-MM-dd",
-            search: true,
-            hide: true,
-            showColumn: false,
-            span: 8
+            width: 100
           },
           {
             label: "起运港",
-            prop: "",
+            prop: "portOfLoad",
             overHidden: true,
             width: 100
           },
           {
             label: "目的港",
-            prop: "",
+            prop: "portOfDestination",
             overHidden: true,
             width: 100
           },
           {
             label: "运输条款",
-            prop: "",
+            prop: "transport",
             overHidden: true,
             width: 100
           },
           {
             label: "采购报价",
-            prop: "",
+            prop: "purchasePrice",
             overHidden: true,
             width: 100
           },
           {
             label: "销售金额",
-            prop: "",
+            prop: "amount",
             overHidden: true,
             width: 100
           },
           {
             label: "产品毛利",
-            prop: "",
+            prop: "grossProfit",
             overHidden: true,
             width: 100
           },
           {
             label: "产品利率",
-            prop: "",
+            prop: "grossProfitRate",
             overHidden: true,
             width: 100
           },
           {
             label: "单票利润",
-            prop: "",
+            prop: "singleTicketMargin",
             overHidden: true,
             width: 100
           }
@@ -168,6 +158,11 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
+      if (params.businesDate) {
+        params.contractStartDate = params.businesDate[0];
+        params.contractEndDate = params.businesDate[1];
+      }
+      delete params.businesDate;
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done();
@@ -207,23 +202,6 @@ export default {
       };
       this.isShow = false;
     },
-    rowDel(row, index, done) {
-      this.$confirm("确定删除数据?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "删除成功!"
-            });
-            this.onLoad(this.page, this.search);
-          }
-        });
-      });
-    },
     goBack() {
       this.detailData = this.$options.data().detailData;
       this.isShow = true;