Browse Source

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 years ago
parent
commit
c55f21a4a6

+ 15 - 0
src/api/basicData/customerInquiry.js

@@ -159,4 +159,19 @@ export function getPricedetail(query) {
     method: 'get',
     params:query
   })
+}
+//生成销售单
+export function getParities(data) {
+  return request({
+    url: '/api/blade-client/parities/getParities',
+    method: 'post',
+    data:data
+  })
+}
+export function getCode(query) {
+  return request({
+    url: '/api/blade-client/parities/getCode',
+    method: 'get',
+    params:query
+  })
 }

+ 15 - 0
src/api/basicData/salesContract.js

@@ -141,3 +141,18 @@ export function pleaseCheck(data) {
     data: data
   })
 }
+//生成销售单
+export function getParities(data) {
+  return request({
+    url: '/api/blade-client/parities/getParities',
+    method: 'post',
+    data:data
+  })
+}
+export function getCode(query) {
+  return request({
+    url: '/api/blade-client/parities/getCode',
+    method: 'get',
+    params:query
+  })
+}

+ 27 - 9
src/components/price-Library/main.vue

@@ -16,7 +16,6 @@
           <el-col :span="4">
             <avue-tree
               :option="treeOption"
-              :data="treeData"
               @node-click="nodeClick"
               style="height:74vh"
             />
@@ -63,7 +62,11 @@
 
 <script>
 import option from "./configuration/mainList.json";
-import { getPricebank, getGoodstype } from "@/api/basicData/customerInquiry";
+import {
+  getPricebank,
+  getGoodstype,
+  getDeptLazyTree
+} from "@/api/basicData/customerInquiry";
 import { dateFormat } from "@/util/date";
 import _ from "lodash";
 export default {
@@ -71,13 +74,28 @@ export default {
     return {
       treeForm: {},
       treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function(node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
+            );
+          });
+        },
         addBtn: false,
         menu: false,
-        filter: false,
         size: "small",
         props: {
-          label: "cname",
-          value: "cname"
+          label: "title",
+          value: "value",
+          children: "children"
         }
       },
       visible: false,
@@ -101,8 +119,7 @@ export default {
         clearable: true
       },
       partType: false,
-      partreData: false,
-      treeData: []
+      partreData: false
     };
   },
   props: {},
@@ -111,7 +128,7 @@ export default {
     getGoodstype(1, 500).then(res => {
       this.findObject(this.tableOption.column, "goodsTypeName").dicData =
         res.data.data.records;
-      this.treeData = res.data.data.records;
+      // this.treeData = res.data.data.records;
     });
     if (localStorage.getItem("roleName") == "贸易") {
       this.findObject(this.tableOption.column, "taxRate").hide = true;
@@ -131,7 +148,8 @@ export default {
       return "padding:0;height:40px;";
     },
     nodeClick(data) {
-      this.search.goodsTypeName = data.cname;
+      console.log(data)
+      this.search.goodTypeId = data.value;
       this.getList(this.page, this.search);
     },
     importData() {

+ 14 - 1
src/views/basicData/rateManagement/detailsPage.vue

@@ -300,6 +300,18 @@ export default {
                   });
               }
             });
+          } else {
+            typeSave({
+              ...this.form,
+              paritiesItemList: this.dataList
+            })
+              .then(res => {
+                this.$message.success("保存成功");
+                this.getDetail(res.data.data.id);
+              })
+              .finally(() => {
+                this.loadingBtn = false;
+              });
           }
         } else {
           return false;
@@ -346,7 +358,7 @@ export default {
           this.toggleForm();
           this.dataList = [];
           if (this.form.paritiesType == "年汇率") {
-            delete this.form.moon;
+            this.form.moon = "";
             const data = {
               annual: this.form.annual,
               receivableParities: this.form.parities,
@@ -356,6 +368,7 @@ export default {
             };
             this.dataList.push(data);
           } else if (this.form.paritiesType == "月汇率") {
+            this.form.moon = "";
             for (let i = 1; i <= 12; i++) {
               const data = {
                 annual: this.form.annual,

+ 19 - 6
src/views/basicData/rateManagement/index.vue

@@ -95,7 +95,7 @@ export default {
             label: "货币币别",
             prop: "code",
             overHidden: true,
-            search:true
+            search: true
           },
           {
             label: "名称",
@@ -118,6 +118,21 @@ export default {
             overHidden: true
           },
           {
+            label: "默认汇率",
+            prop: "paritiesType",
+            overHidden: true
+          },
+          {
+            label: "汇率年度",
+            prop: "annual",
+            overHidden: true
+          },
+          {
+            label: "月份",
+            prop: "moon",
+            overHidden: true
+          },
+          {
             label: "备注",
             prop: "remarks",
             overHidden: true
@@ -174,11 +189,9 @@ export default {
         ...params,
         ...this.search,
         size: page.pageSize,
-        current: page.currentPage,
-      }
-      getRateList(
-        queryParams
-      )
+        current: page.currentPage
+      };
+      getRateList(queryParams)
         .then(res => {
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;

+ 44 - 23
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -131,6 +131,16 @@
               </el-option>
             </el-select>
           </template>
+          <template slot="businesDate">
+            <el-date-picker
+              v-model="form.businesDate"
+              type="date"
+              format="yyyy-MM-dd"
+              value-format="yyyy-MM-dd 00:00:00"
+              @change="businesDateChange"
+            >
+            </el-date-picker>
+          </template>
           <template slot="currency">
             <el-select
               size="small"
@@ -138,12 +148,13 @@
               placeholder="请选择"
               @change="currencyChange"
               :disabled="detailData.status == 1"
+              clearable
             >
               <el-option
                 v-for="item in currencyList"
                 :key="item.id"
-                :label="item.dictValue"
-                :value="item.dictValue"
+                :label="item"
+                :value="item"
               >
               </el-option>
             </el-select>
@@ -592,7 +603,9 @@ import {
   getPorts,
   getSpecification,
   saveSell,
-  getPricedetail
+  getPricedetail,
+  getParities,
+  getCode
 } from "@/api/basicData/customerInquiry";
 import { getAllBoxs } from "@/api/basicData/portinformation";
 import { getCorpsattn } from "@/api/basicData/customerInformation";
@@ -771,9 +784,9 @@ export default {
             label: "报价日期",
             prop: "businesDate",
             span: 8,
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd 00:00:00",
+            // type: "date",
+            // format: "yyyy-MM-dd",
+            // valueFormat: "yyyy-MM-dd 00:00:00",
             rules: [
               {
                 required: true,
@@ -1008,18 +1021,12 @@ export default {
     this.getWorkDicts("payment_term").then(res => {
       this.paymentTermList = res.data.data;
     });
-    this.getWorkDicts("currency").then(res => {
+    getCode().then(res => {
       this.currencyList = res.data.data;
-      if (!this.detailData.id) {
-        this.currencyList.forEach(e => {
-          if (e.dictValue == "USD") {
-            this.form.exchangeRate = e.remark;
-            this.oldform.exchangeRate = e.remark;
-            this.oldExchange = e.remark;
-          }
-        });
-      }
     });
+    if (!this.detailData.id) {
+      this.getParities();
+    }
     getPorts().then(res => {
       this.findObject(this.option.column, "portOfLoad").dicData = res.data;
       this.findObject(this.option.column, "portOfDestination").dicData =
@@ -1062,6 +1069,22 @@ export default {
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
     },
+    getParities() {
+      getParities({
+        currency: this.form.currency,
+        businesDate: this.form.businesDate
+      }).then(res => {
+        const data = res.data.data;
+        this.form.exchangeRate = data.receivableParities;
+        this.oldform.exchangeRate = data.receivableParities;
+        this.oldExchange =this.deepClone(data.receivableParities);
+      });
+    },
+    businesDateChange(){
+      if(this.form.currency&&this.form.businesDate){
+        this.getParities()
+      }
+    },
     getCorpData(row) {
       this.form.corpAttn = null;
       this.form.corpTel = null;
@@ -1356,12 +1379,10 @@ export default {
         this.form.exchangeRate
       );
     },
-    currencyChange(row) {
-      this.currencyList.forEach(e => {
-        if (e.dictValue == row) {
-          this.form.exchangeRate = e.remark;
-        }
-      });
+    currencyChange() {
+      if(this.form.currency&&this.form.businesDate){
+        this.getParities()
+      }
       if (this.data.length > 0) {
         this.data.forEach(e => {
           e.freight = transformCal(
@@ -1391,7 +1412,6 @@ export default {
           e.exchangeRate = this.form.exchangeRate;
         });
       }
-      this.oldExchange = this.deepClone(this.form.exchangeRate);
     },
     exchangeRateChange(row) {
       if (this.data.length > 0) {
@@ -1415,6 +1435,7 @@ export default {
           e.exchangeRate = this.form.exchangeRate;
         });
       }
+
       this.oldExchange = this.deepClone(row);
     },
     discountChange(row) {

+ 43 - 23
src/views/exportTrade/salesContract/detailsPage.vue

@@ -160,6 +160,16 @@
               </el-option>
             </el-select>
           </template>
+          <template slot="businesDate">
+            <el-date-picker
+              v-model="form.businesDate"
+              type="date"
+              format="yyyy-MM-dd"
+              value-format="yyyy-MM-dd 00:00:00"
+              @change="businesDateChange"
+            >
+            </el-date-picker>
+          </template>
           <template slot="currency">
             <el-select
               size="small"
@@ -167,12 +177,13 @@
               placeholder="请选择"
               @change="currencyChange"
               :disabled="detailData.status == 1"
+              clearable
             >
               <el-option
                 v-for="item in currencyList"
                 :key="item.id"
-                :label="item.dictValue"
-                :value="item.dictValue"
+                :label="item"
+                :value="item"
               >
               </el-option>
             </el-select>
@@ -693,7 +704,9 @@ import {
   getSpecification,
   saveSell,
   getPricedetail,
-  pleaseCheck
+  pleaseCheck,
+  getParities,
+  getCode
 } from "@/api/basicData/salesContract";
 import { getAllBoxs } from "@/api/basicData/portinformation";
 import _ from "lodash";
@@ -886,9 +899,9 @@ export default {
             label: "订单日期",
             prop: "businesDate",
             span: 8,
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd 00:00:00",
+            // type: "date",
+            // format: "yyyy-MM-dd",
+            // valueFormat: "yyyy-MM-dd 00:00:00",
             rules: [
               {
                 required: true,
@@ -1178,18 +1191,12 @@ export default {
     this.getWorkDicts("payment_term").then(res => {
       this.paymentTermList = res.data.data;
     });
-    this.getWorkDicts("currency").then(res => {
+    getCode().then(res => {
       this.currencyList = res.data.data;
-      if (!this.detailData.id) {
-        this.currencyList.forEach(e => {
-          if (e.dictValue == "USD") {
-            this.form.exchangeRate = e.remark;
-            this.oldform.exchangeRate = e.remark;
-            this.oldExchange = e.remark;
-          }
-        });
-      }
     });
+    if (!this.detailData.id) {
+      this.getParities();
+    }
     getGoods(1, 10).then(res => {
       if (res.data.data.total > 0) {
         this.goodsoptions = res.data.data.records;
@@ -1253,6 +1260,22 @@ export default {
         }
       });
     },
+    getParities() {
+      getParities({
+        currency: this.form.currency,
+        businesDate: this.form.businesDate
+      }).then(res => {
+        const data = res.data.data;
+        this.form.exchangeRate = data.receivableParities;
+        this.oldform.exchangeRate = data.receivableParities;
+        this.oldExchange = this.deepClone(data.receivableParities);
+      });
+    },
+    businesDateChange() {
+      if (this.form.currency&&this.form.businesDate) {
+        this.getParities();
+      }
+    },
     getCorpData(row) {
       this.form.coefficient = row.coefficient;
       if (this.data.length > 0) {
@@ -1532,12 +1555,10 @@ export default {
         );
       }
     },
-    currencyChange(row) {
-      this.currencyList.forEach(e => {
-        if (e.dictValue == row) {
-          this.form.exchangeRate = e.remark;
-        }
-      });
+    currencyChange() {
+      if (this.form.currency&&this.form.businesDate) {
+        this.getParities();
+      }
       if (this.data.length > 0) {
         this.data.forEach(e => {
           e.freight = transformCal(
@@ -1567,7 +1588,6 @@ export default {
           e.exchangeRate = this.form.exchangeRate;
         });
       }
-      this.oldExchange = this.deepClone(this.form.exchangeRate);
     },
     exchangeRateChange(row) {
       if (this.data.length > 0) {

+ 17 - 11
src/views/exportTrade/shippingInquiry/detailsPage.vue

@@ -17,11 +17,12 @@
           v-if="detailData.status == 1"
           class="el-button--small-yh "
           @click.stop="openEdit"
+          :disabled="form.ifShipping=='船务确认'"
           >编辑
         </el-button>
         <el-button
           type="primary"
-          :disabled="disabled && detailData.status == 1"
+          :disabled="disabled && detailData.status == 1||form.ifShipping=='船务确认'"
           @click="editCustomer('submit')"
           v-if="form.id && detailData.status != 1"
           :loading="subLoading"
@@ -283,8 +284,13 @@ export default {
             span: 8,
             type: "date",
             format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd 00:00:00",
-            row: true
+            valueFormat: "yyyy-MM-dd 00:00:00"
+          },
+          {
+            label: "船务状态",
+            prop: "ifShipping",
+            disabled: true,
+            span: 8
           },
           {
             label: "箱型",
@@ -701,8 +707,8 @@ export default {
       );
       if (inSave) {
         this.$nextTick(() => {
-          this.$refs.crud.doLayout()
-        })
+          this.$refs.crud.doLayout();
+        });
         this.$message.success("保存成功");
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
@@ -716,8 +722,8 @@ export default {
       );
       if (inSave) {
         this.$nextTick(() => {
-          this.$refs.crud.doLayout()
-        })
+          this.$refs.crud.doLayout();
+        });
         this.$message.success("重置成功");
         //关闭窗口
         setTimeout(() => {
@@ -732,8 +738,8 @@ export default {
       );
       if (inSave) {
         this.$nextTick(() => {
-          this.$refs.goodsCrud.doLayout()
-        })
+          this.$refs.goodsCrud.doLayout();
+        });
         this.$message.success("保存成功");
         //关闭窗口
         this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
@@ -747,8 +753,8 @@ export default {
       );
       if (inSave) {
         this.$nextTick(() => {
-          this.$refs.goodsCrud.doLayout()
-        })
+          this.$refs.goodsCrud.doLayout();
+        });
         this.$message.success("重置成功");
         //关闭窗口
         setTimeout(() => {

+ 1 - 1
src/views/maintenance/priceLibrary/config/mainList.json

@@ -58,7 +58,7 @@
     },
     {
       "label": "供应商",
-      "prop": "corpCode",
+      "prop": "corpId",
       "search": true,
       "searchSpan": 8,
       "index": 6,

+ 6 - 3
src/views/maintenance/priceLibrary/index.vue

@@ -51,8 +51,8 @@
             :false-label="0"
           />
         </template>
-        <template slot="corpCodeSearch">
-          <crop-select v-model="search.corpCode" corpType="GYS"></crop-select>
+        <template slot="corpIdSearch">
+          <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
         </template>
         <template slot="dateValiditySearch">
           <el-date-picker
@@ -66,6 +66,9 @@
           >
           </el-date-picker>
         </template>
+        <template slot-scope="{ row }" slot="corpId">
+          {{ row.corpCode }}
+        </template>
         <template slot-scope="{ row }" slot="grossProfitRate">
           {{ row.grossProfitRate ? scope.row.grossProfitRate : 0 }}%
         </template>
@@ -244,7 +247,7 @@ export default {
       },
       detailData: {},
       loading: false,
-      currencyList: []
+      currencyList: [],
     };
   },
   async created() {