Qukatie 1 yıl önce
ebeveyn
işleme
28660edc3f

+ 7 - 0
src/util/calculate.js

@@ -187,4 +187,11 @@ export function addPrice(num, num2, num3) {
   const Sum3 = Number(num3 ? num3 : 0)
   const sum = _.add(_.add(Sum1, Sum2), Sum3)
   return Number(sum).toFixed(2)
+}
+//出厂价格调整 出厂价格*(1+调整价格/100)
+export function priceaAjustment(num, num2) {
+  const Sum1 = Number(num ? num : 0)
+  const Sum2 = Number(num2 ? num2 : 0)
+  const sum = _.multiply(Sum1,_.add(1,_.divide(Sum2, 100)))
+  return Number(sum).toFixed(2)
 }

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

@@ -302,7 +302,7 @@
           </template>
         </avue-crud>
       </trade-card> -->
-      <fee-info ref="feeInfo" :tabShow="2"  :orderFeesList="orderFeesList" :disabled="detailData.status == 1"
+      <fee-info ref="feeInfo" :tabShow="1"  :orderFeesList="orderFeesList" :disabled="detailData.status == 1"
         feeUrl="/blade-purchase-sales/orderfees/update" optionType="CK" itemType="报价" @beforeFinance="beforeFinance"
         :inCropId="true" />
       <containerTitle title="合同附件">

+ 221 - 186
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -8,9 +8,9 @@
         <el-row>
           <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
           </el-button>
-<!--          <el-button type="warning" icon="el-icon-plus" size="small"-->
-<!--            :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单-->
-<!--          </el-button>-->
+          <!--          <el-button type="warning" icon="el-icon-plus" size="small"-->
+          <!--            :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单-->
+          <!--          </el-button>-->
           <el-button type="primary" size="small" @click="cnameData">刷新基础资料</el-button>
           <el-button type="success" size="small" @click="calculate(1)" :disabled="detailData.status == 1"
             :loading="calculateLoading">分摊国内费用
@@ -18,51 +18,63 @@
           <el-button type="success" size="small" @click="calculate(2)" :disabled="detailData.status == 1"
             :loading="calculateLoading">分摊海运费
           </el-button>
-          <el-button :type="form.fudaPurchaseStatus?'success':'warning'" size="small" :disabled="!form.id" @click.native="dialog = true;fudaSatus = 1">通知采购</el-button>
-          <el-button :type="form.documentaryStatus?'primary':'warning'" size="small" :disabled="!form.id" @click.native="dialog = true;fudaSatus = 2">通知跟单</el-button>
-<!--          <el-button type="primary" size="small" :disabled="form.status > 0 || (!form.status && form.status !== 0)" @click.native="pleaseCheck">请核数据</el-button>-->
+          <el-button :type="form.fudaPurchaseStatus ? 'success' : 'warning'" size="small" :disabled="!form.id"
+            @click.native="dialog = true; fudaSatus = 1">通知采购</el-button>
+          <el-button :type="form.documentaryStatus ? 'primary' : 'warning'" size="small" :disabled="!form.id"
+            @click.native="dialog = true; fudaSatus = 2">通知跟单</el-button>
+          <el-popover placement="top" width="160" v-model="visible">
+            <div style="text-align: center;">
+              <el-input-number v-model="priceAD" size="small" controls-position="right"></el-input-number>
+            </div>
+            <div style="text-align: right; margin: 0">
+              <el-button size="mini" type="text" @click="visible = false">取消</el-button>
+              <el-button size="mini" type="text" @click="submitPriceAD">确定</el-button>
+            </div>
+            <el-button type="info" size="small" slot="reference"  :disabled="detailData.status == 1">调整出厂价</el-button>
+          </el-popover>
+          <!--          <el-button type="primary" size="small" :disabled="form.status > 0 || (!form.status && form.status !== 0)" @click.native="pleaseCheck">请核数据</el-button>-->
         </el-row>
       </template>
       <template slot="headerSerial">
-        <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
-          :disabled="detailData.status == 1" circle></el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow" :disabled="detailData.status == 1"
+          circle></el-button>
       </template>
       <template slot="codeHeader" slot-scope="{column}">
         <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{ column.label }}</span>
       </template>
       <template slot="orderQuantity" slot-scope="{row}">
-                {{ row.orderQuantity|decimalFormat2 }}
-            </template>
-            <template slot="amount" slot-scope="{row}">
-                {{ row.amount|decimalFormat2 }}
-            </template>
-            <template slot="partsCost" slot-scope="{row}">
-                {{ row.partsCost|decimalFormat2 }}
-            </template>
-            <template slot="partsPrice" slot-scope="{row}">
-                {{ row.partsPrice|decimalFormat2 }}
-            </template>
-            <template slot="productPrice" slot-scope="{row}">
-                {{ row.productPrice|decimalFormat2 }}
-            </template>
-            <template slot="outFactoryPrice" slot-scope="{row}">
-                {{ row.outFactoryPrice|decimalFormat2 }}
-            </template>
-            <template slot="shareAmount" slot-scope="{row}">
-                {{ row.shareAmount|decimalFormat2 }}
-            </template>
-            <template slot="internationalAmount" slot-scope="{row}">
-                {{ row.internationalAmount|decimalFormat2 }}
-            </template>
-            <template slot="price" slot-scope="{row}">
-                {{ row.price|decimalFormat2 }}
-            </template>
-            <template slot="purchaseCost" slot-scope="{row}">
-                {{ row.purchaseCost|decimalFormat2 }}
-            </template>
-            <template slot="purchaseAmount" slot-scope="{row}">
-                {{ row.purchaseAmount|decimalFormat2 }}
-            </template>
+        {{ row.orderQuantity | decimalFormat2 }}
+      </template>
+      <template slot="amount" slot-scope="{row}">
+        {{ row.amount | decimalFormat2 }}
+      </template>
+      <template slot="partsCost" slot-scope="{row}">
+        {{ row.partsCost | decimalFormat2 }}
+      </template>
+      <template slot="partsPrice" slot-scope="{row}">
+        {{ row.partsPrice | decimalFormat2 }}
+      </template>
+      <template slot="productPrice" slot-scope="{row}">
+        {{ row.productPrice | decimalFormat2 }}
+      </template>
+      <template slot="outFactoryPrice" slot-scope="{row}">
+        {{ row.outFactoryPrice | decimalFormat2 }}
+      </template>
+      <template slot="shareAmount" slot-scope="{row}">
+        {{ row.shareAmount | decimalFormat2 }}
+      </template>
+      <template slot="internationalAmount" slot-scope="{row}">
+        {{ row.internationalAmount | decimalFormat2 }}
+      </template>
+      <template slot="price" slot-scope="{row}">
+        {{ row.price | decimalFormat2 }}
+      </template>
+      <template slot="purchaseCost" slot-scope="{row}">
+        {{ row.purchaseCost | decimalFormat2 }}
+      </template>
+      <template slot="purchaseAmount" slot-scope="{row}">
+        {{ row.purchaseAmount | decimalFormat2 }}
+      </template>
       //操作栏
       <template slot="menu" slot-scope="{ row, index }">
         <div style="display:flex;justify-content: center;">
@@ -73,8 +85,8 @@
           <div v-if="!goodsEditShow"
             style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
             <el-tooltip effect="dark" content="向上移动" placement="top">
-              <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up"
-                @click="moveUp(row, index)" style="color:#409EFF;"></i>
+              <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up" @click="moveUp(row, index)"
+                style="color:#409EFF;"></i>
             </el-tooltip>
             <el-tooltip effect="dark" content="向下移动" placement="bottom"> <i v-if="index != (data.length - 1)"
                 :disabled="detailData.status == 1" class="el-icon-arrow-down" @click="moveDown(row, index)"
@@ -186,8 +198,8 @@
       <template slot="partsAuthenticationNameForm" slot-scope="{type,disabled}">
         <div style="display:flex;">
           <el-input v-model="goodsForm.partsAuthenticationName" size="small" placeholder="" :disabled="disabled">
-            <template
-              slot="append">{{ goodsForm.partsAuthenticationSalePrice ? goodsForm.partsAuthenticationSalePrice : 0 }}</template>
+            <template slot="append">{{ goodsForm.partsAuthenticationSalePrice ? goodsForm.partsAuthenticationSalePrice : 0
+            }}</template>
           </el-input>
           <el-button icon="el-icon-edit" size="mini" @click="openpart(5, goodsForm.partsAuthenticationValue)"
             :disabled="disabled"></el-button>
@@ -207,7 +219,7 @@
       <template slot="partsDescribeForm" slot-scope="{type,disabled}">
         <el-input type="textarea" :rows="2" v-model="goodsForm.partsDescribe" size="small" placeholder=""
           @change="editChange(goodsForm)">
-        </el-input>
+        </el-input>outFactoryPrice
       </template>
       //英文名称
       <template slot="enameForm" slot-scope="{type,disabled}">
@@ -233,8 +245,8 @@
       </template>
       //分摊金额
       <template slot="shareAmountForm" slot-scope="{type,disabled}">
-        <el-input-number v-model="goodsForm.shareAmount" size="small" style="width:100%"
-          @change="priceChange(goodsForm)" :controls="false" :precision="10"></el-input-number>
+        <el-input-number v-model="goodsForm.shareAmount" size="small" style="width:100%" @change="priceChange(goodsForm)"
+          :controls="false" :precision="10"></el-input-number>
       </template>
       //分摊金额
       <template slot="internationalAmountForm" slot-scope="{type,disabled}">
@@ -267,11 +279,11 @@
       //产品型号
       <template slot="itemTypeForm" slot-scope="{type,disabled}">
         <el-input v-model="goodsForm.itemType" placeholder="请输入内容"></el-input>
-<!--        <el-select v-model="goodsForm.itemType" filterable allow-create default-first-option placeholder="请输入"-->
-<!--          size="small" @focus="itemTypeFocus(goodsForm)">-->
-<!--          <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">-->
-<!--          </el-option>-->
-<!--        </el-select>-->
+        <!--        <el-select v-model="goodsForm.itemType" filterable allow-create default-first-option placeholder="请输入"-->
+        <!--          size="small" @focus="itemTypeFocus(goodsForm)">-->
+        <!--          <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">-->
+        <!--          </el-option>-->
+        <!--        </el-select>-->
       </template>
     </avue-crud>
     <!-- <el-dialog title="导入商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
@@ -307,21 +319,11 @@
     </report-dialog>
     <part-library ref="partLibrary" @importPart="importPart"></part-library>
     <price-library ref="library" @importLibray="importLibray" />
-    <el-dialog
-        title="选择日期"
-        :visible.sync="dialog"
-        v-if="dialog"
-        width="30%"
-        append-to-body>
+    <el-dialog title="选择日期" :visible.sync="dialog" v-if="dialog" width="30%" append-to-body>
       <span>
-        <el-date-picker
-          v-model="pickerValue"
-          type="date"
-          style="width: 100%;"
-          size="small"
-          value-format="yyyy-MM-dd HH:ss:mm"
-          placeholder="选择日期">
-      </el-date-picker>
+        <el-date-picker v-model="pickerValue" type="date" style="width: 100%;" size="small"
+          value-format="yyyy-MM-dd HH:ss:mm" placeholder="选择日期">
+        </el-date-picker>
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialog = false">取 消</el-button>
@@ -360,18 +362,21 @@ import {
   grossProfitCal,
   costCal,
   addPrice,
-  divide
+  divide,
+  priceaAjustment
 } from "@/util/calculate";
 import _ from "lodash";
-import {getPricebankAll} from "@/api/basicData/customerInquiry";
+import { getPricebankAll } from "@/api/basicData/customerInquiry";
 import { micrometerFormat2, decimalFormat2 } from "@/util/validate";
 export default {
   name: "customerInformation",
   data() {
     return {
-      fudaSatus:null,
-      pickerValue:"",
-      dialog:false,
+      priceAD: 0,
+      visible: false,
+      fudaSatus: null,
+      pickerValue: "",
+      dialog: false,
       calculateLoading: false,
       switchDialog: false,
       loading: false,
@@ -444,10 +449,10 @@ export default {
     reportDialog
   },
   filters: {
-        decimalFormat2(num) {
-            return decimalFormat2(num);
-        }
-    },
+    decimalFormat2(num) {
+      return decimalFormat2(num);
+    }
+  },
   async created() {
     this.tableOption = await this.getColumnData(
       this.getColumnName(5),
@@ -457,21 +462,21 @@ export default {
       this.getColumnName(28),
       goodsOption
     );
-      if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
-          this.findObject(this.tableOption.column, "purchaseCost").hide = false;
-          this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
-          this.findObject(this.tableOption.column, "partsPrice").hide = false;
-          this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
-          this.findObject(this.tableOption.column, "partsCost").hide = false;
-          this.findObject(this.tableOption.column, "partsCost").showColumn = true;
-          this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
-          this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
-          this.findObject(this.tableOption.column, "corpName").hide = false;
-          this.findObject(this.tableOption.column, "corpName").showColumn = true;
-          this.findObject(this.tableOption.column, "productPrice").hide = false;
-          this.findObject(this.tableOption.column, "productPrice").showColumn = true;
-          this.findObject(this.tableOption.column, "productPrice").display = true;
-      }
+    if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
+      this.findObject(this.tableOption.column, "purchaseCost").hide = false;
+      this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
+      this.findObject(this.tableOption.column, "partsPrice").hide = false;
+      this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
+      this.findObject(this.tableOption.column, "partsCost").hide = false;
+      this.findObject(this.tableOption.column, "partsCost").showColumn = true;
+      this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
+      this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
+      this.findObject(this.tableOption.column, "corpName").hide = false;
+      this.findObject(this.tableOption.column, "corpName").showColumn = true;
+      this.findObject(this.tableOption.column, "productPrice").hide = false;
+      this.findObject(this.tableOption.column, "productPrice").showColumn = true;
+      this.findObject(this.tableOption.column, "productPrice").display = true;
+    }
     this.getWorkDicts("Thread").then(res => {
       this.ThreadList = res.data.data;
     });
@@ -487,7 +492,7 @@ export default {
     this.getWorkDicts("unit").then(res => {
       this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
     });
-    getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(res=>{
+    getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(res => {
       this.goodsoptions = res.data.data
     })
     // getPricebank(1, 10, {
@@ -521,7 +526,7 @@ export default {
     },
     pickGoods() {
       // this.dialogVisible = !this.dialogVisible;
-        this.$refs.library.search = {}
+      this.$refs.library.search = {}
       this.$refs.library.init(false);
     },
     nodeClick(data) {
@@ -688,15 +693,15 @@ export default {
           row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this
             .form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
           // 处理单品毛利率是 -00.00 的问题
-            if (Number(row.itemMargin) === 0) {
-                row.itemMargin = Number(row.itemMargin) + ''
-            }
+          if (Number(row.itemMargin) === 0) {
+            row.itemMargin = Number(row.itemMargin) + ''
+          }
           row.partsDescribe = null;
           row.remarks = null;
           row.exchangeRate = this.form.exchangeRate;
           row.productRemark = e.ename;
           row.attributeList = this.getAttribute(e.goodsSpecificationList),
-          row.referrerReason = e.referrerReason
+            row.referrerReason = e.referrerReason
         }
       })
     },
@@ -796,7 +801,7 @@ export default {
           exchangeRate: this.form.exchangeRate,
           productRemark: e.ename,
           attributeList: this.getAttribute(e.goodsSpecificationList),
-          referrerReason:e.referrerReason
+          referrerReason: e.referrerReason
         }
       });
       this.$refs.crud.rowAdd()
@@ -820,10 +825,10 @@ export default {
       this.switchDialog = val;
     },
     inInvoice() {
-      if (!this.pickerValue)return this.$message.error("请选择日期")
+      if (!this.pickerValue) return this.$message.error("请选择日期")
       const data = {
         id: this.form.id,
-        documentaryDate:this.pickerValue
+        documentaryDate: this.pickerValue
       };
       const loading = this.$loading({
         lock: true,
@@ -837,9 +842,9 @@ export default {
           this.dialog = false
           this.pickerValue = ''
           loading.close()
-          this.$emit("backToList",this.form.id)
+          this.$emit("backToList", this.form.id)
         }
-      }).catch(()=>{
+      }).catch(() => {
         loading.close()
         this.pickerValue = ''
         this.dialog = false
@@ -850,7 +855,7 @@ export default {
       if (!this.form.id) {
         return this.$message.error("此单据没有提交记录,请先提交");
       }
-      if (!this.form.buyerId){
+      if (!this.form.buyerId) {
         return this.$message.error("采购员必填");
       }
       const loading = this.$loading({
@@ -859,15 +864,15 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(255,255,255,0.7)'
       });
-      generatePurchaseNews(this.form.id,this.pickerValue).then(res => {
+      generatePurchaseNews(this.form.id, this.pickerValue).then(res => {
         if (res.data.code == 200) {
           this.$message.success("生成成功");
           this.dialog = false
           this.pickerValue = ''
           loading.close()
-          this.$emit("backToList",this.form.id)
+          this.$emit("backToList", this.form.id)
         }
-      }).catch(()=>{
+      }).catch(() => {
         this.pickerValue = ''
         this.dialog = false
         loading.close()
@@ -901,9 +906,9 @@ export default {
         }
       });
     },
-      pleaseCheck(){
-        this.$parent.pleaseCheck()
-      },
+    pleaseCheck() {
+      this.$parent.pleaseCheck()
+    },
     calculate(val) {
       this.form.totalValue = 0
       this.data.forEach((e, index) => {
@@ -1019,6 +1024,36 @@ export default {
     moveDown(row, index) {
       this.data[index] = this.data.splice(index + 1, 1, row)[0]
     },
+    submitPriceAD() {
+      this.visible = false;
+      this.data.forEach(e => {
+        e.outFactoryPrice = priceaAjustment(e.outFactoryPrice, this.priceAD)
+        e.totalValue = multiply(e.outFactoryPrice, e.orderQuantity)
+        e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount)
+        e.amount = amountCal(
+          addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount),
+          e.orderQuantity,
+          e.freight,
+          e.insurance,
+          e.discount
+        );
+        e.itemMargin = grossProfitCal(
+          e.purchaseAmount,
+          e.partsPrice,
+          e.outFactoryPrice,
+          this.form.exchangeRate
+        );
+        // 处理单品毛利率是 -00.00 的问题
+        if (Number(e.itemMargin) === 0) {
+          e.itemMargin = Number(e.itemMargin) + ''
+        }
+        // 出厂价格为零,单品毛利润为零
+        if (e.outFactoryPrice == 0) {
+          e.itemMargin = 0
+        }
+      })
+      this.priceAD=0
+    },
     purchaseAmountChange(row) {
       row.productPrice = productCal(
         row.purchaseAmount,
@@ -1046,10 +1081,10 @@ export default {
         this.form.exchangeRate
       );
     },
-      outFactoryPriceInput(row){
-          console.log(row,1005)
-          this.$set(row,'outFactoryChange',true)
-      },
+    outFactoryPriceInput(row) {
+      console.log(row, 1005)
+      this.$set(row, 'outFactoryChange', true)
+    },
     priceChange(row) {
       row.totalValue = multiply(row.outFactoryPrice, row.orderQuantity)
       row.price = addPrice(row.outFactoryPrice, row.shareAmount, row.internationalAmount)
@@ -1060,24 +1095,24 @@ export default {
         row.insurance,
         row.discount
       );
-        console.log(row.purchaseAmount,'purchaseAmount')
-        console.log(row.partsPrice,'partsPrice')
-        console.log(row.outFactoryPrice,'outFactoryPrice')
-        console.log(this.form.exchangeRate,'exchangeRate')
-        // this.$set(row,'outFactoryChange',true)
+      console.log(row.purchaseAmount, 'purchaseAmount')
+      console.log(row.partsPrice, 'partsPrice')
+      console.log(row.outFactoryPrice, 'outFactoryPrice')
+      console.log(this.form.exchangeRate, 'exchangeRate')
+      // this.$set(row,'outFactoryChange',true)
       row.itemMargin = grossProfitCal(
         row.purchaseAmount,
         row.partsPrice,
         row.outFactoryPrice,
         this.form.exchangeRate
       );
-        // 处理单品毛利率是 -00.00 的问题
-        if (Number(row.itemMargin) === 0) {
-            row.itemMargin = Number(row.itemMargin) + ''
-        }
+      // 处理单品毛利率是 -00.00 的问题
+      if (Number(row.itemMargin) === 0) {
+        row.itemMargin = Number(row.itemMargin) + ''
+      }
       // 出厂价格为零,单品毛利润为零
-      if(row.outFactoryPrice == 0) {
-          row.itemMargin = 0
+      if (row.outFactoryPrice == 0) {
+        row.itemMargin = 0
       }
 
     },
@@ -1357,63 +1392,63 @@ export default {
       done()
     },
     handleRowUpdate(row, index, done, loading) {
-      this.$set(this.data,index,row)
+      this.$set(this.data, index, row)
       loading()
       done()
     },
     summaryMethod({ columns, data }) {
-            const sums = [];
-            if (columns.length > 0) {
-                columns.forEach((column, index) => {
-                    let prop = column.property
-                    if (['orderQuantity', 'amount', 'partsCost', 'partsPrice', 'productPrice','actualQuantity'].includes(prop)) {
-                        let values = this.data.map(item => Number(item[prop] || 0));
-                        let all = values.length !== 0 ? sums[index] = values.reduce((a, b) => {
-                            return a + b;
-                        }) : 0
-                        if (prop == 'orderQuantity') {
-                            sums[index] = micrometerFormat2(all)
-                        }
-                        if (prop == 'amount') {
-                            sums[index] = micrometerFormat2(all)
-                        }
-                        if (prop == 'partsCost') {
-                            sums[index] = micrometerFormat2(all)
-                        }
-                        if (prop == 'partsPrice') {
-                            sums[index] = micrometerFormat2(all)
-                        }
-                        if (prop == 'productPrice') {
-                            sums[index] = micrometerFormat2(all)
-                        }
-                        if (prop == 'actualQuantity') {
-                            sums[index] = micrometerFormat2(all)
-                        }
-                    }
-                });
+      const sums = [];
+      if (columns.length > 0) {
+        columns.forEach((column, index) => {
+          let prop = column.property
+          if (['orderQuantity', 'amount', 'partsCost', 'partsPrice', 'productPrice', 'actualQuantity'].includes(prop)) {
+            let values = this.data.map(item => Number(item[prop] || 0));
+            let all = values.length !== 0 ? sums[index] = values.reduce((a, b) => {
+              return a + b;
+            }) : 0
+            if (prop == 'orderQuantity') {
+              sums[index] = micrometerFormat2(all)
             }
-            return sums;
-        },
+            if (prop == 'amount') {
+              sums[index] = micrometerFormat2(all)
+            }
+            if (prop == 'partsCost') {
+              sums[index] = micrometerFormat2(all)
+            }
+            if (prop == 'partsPrice') {
+              sums[index] = micrometerFormat2(all)
+            }
+            if (prop == 'productPrice') {
+              sums[index] = micrometerFormat2(all)
+            }
+            if (prop == 'actualQuantity') {
+              sums[index] = micrometerFormat2(all)
+            }
+          }
+        });
+      }
+      return sums;
+    },
     async saveColumn() {
       const inSave = await this.saveColumnData(
         this.getColumnName(5),
         this.tableOption
       );
-        if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
-            this.findObject(this.tableOption.column, "purchaseCost").hide = false;
-            this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
-            this.findObject(this.tableOption.column, "partsPrice").hide = false;
-            this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
-            this.findObject(this.tableOption.column, "partsCost").hide = false;
-            this.findObject(this.tableOption.column, "partsCost").showColumn = true;
-            this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
-            this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
-            this.findObject(this.tableOption.column, "corpName").hide = false;
-            this.findObject(this.tableOption.column, "corpName").showColumn = true;
-            this.findObject(this.tableOption.column, "productPrice").hide = false;
-            this.findObject(this.tableOption.column, "productPrice").showColumn = true;
-            this.findObject(this.tableOption.column, "productPrice").display = true;
-        }
+      if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
+        this.findObject(this.tableOption.column, "purchaseCost").hide = false;
+        this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
+        this.findObject(this.tableOption.column, "partsPrice").hide = false;
+        this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
+        this.findObject(this.tableOption.column, "partsCost").hide = false;
+        this.findObject(this.tableOption.column, "partsCost").showColumn = true;
+        this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
+        this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
+        this.findObject(this.tableOption.column, "corpName").hide = false;
+        this.findObject(this.tableOption.column, "corpName").showColumn = true;
+        this.findObject(this.tableOption.column, "productPrice").hide = false;
+        this.findObject(this.tableOption.column, "productPrice").showColumn = true;
+        this.findObject(this.tableOption.column, "productPrice").display = true;
+      }
       if (inSave) {
         this.$nextTick(() => {
           this.$refs.crud.doLayout();
@@ -1437,21 +1472,21 @@ export default {
         this.$nextTick(() => {
           this.$refs.crud.doLayout();
         });
-          if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
-              this.findObject(this.tableOption.column, "purchaseCost").hide = false;
-              this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
-              this.findObject(this.tableOption.column, "partsPrice").hide = false;
-              this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
-              this.findObject(this.tableOption.column, "partsCost").hide = false;
-              this.findObject(this.tableOption.column, "partsCost").showColumn = true;
-              this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
-              this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
-              this.findObject(this.tableOption.column, "corpName").hide = false;
-              this.findObject(this.tableOption.column, "corpName").showColumn = true;
-              this.findObject(this.tableOption.column, "productPrice").hide = false;
-              this.findObject(this.tableOption.column, "productPrice").showColumn = true;
-              this.findObject(this.tableOption.column, "productPrice").display = true;
-          }
+        if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
+          this.findObject(this.tableOption.column, "purchaseCost").hide = false;
+          this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
+          this.findObject(this.tableOption.column, "partsPrice").hide = false;
+          this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
+          this.findObject(this.tableOption.column, "partsCost").hide = false;
+          this.findObject(this.tableOption.column, "partsCost").showColumn = true;
+          this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
+          this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
+          this.findObject(this.tableOption.column, "corpName").hide = false;
+          this.findObject(this.tableOption.column, "corpName").showColumn = true;
+          this.findObject(this.tableOption.column, "productPrice").hide = false;
+          this.findObject(this.tableOption.column, "productPrice").showColumn = true;
+          this.findObject(this.tableOption.column, "productPrice").display = true;
+        }
         this.$message.success("重置成功");
         //关闭窗口
         setTimeout(() => {
@@ -1493,7 +1528,7 @@ export default {
   },
   watch: {
     dialog(newVla, oldVal) {
-      if (newVla){
+      if (newVla) {
         this.pickerValue = dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
       }
     }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 622 - 640
src/views/exportTrade/salesContract/detailsPage.vue


+ 73 - 121
src/views/exportTrade/salesContract/index.vue

@@ -1,38 +1,24 @@
 <template>
     <div>
         <basic-container v-show="show" class="page-crad">
-            <avue-crud
-                ref="crud"
-                :option="option"
-                :data="dataList"
-                v-model="form"
-                :page.sync="page"
-                :search.sync="search"
-                @search-change="searchChange"
-                @current-change="currentChange"
-                @size-change="sizeChange"
-                @refresh-change="refreshChange"
-                @on-load="onLoad"
-                @saveColumn="saveColumn"
-                @resetColumn="resetColumn"
-                :cell-style="cellStyle"
-                :summary-method="summaryMethod"
-                @expand-change="expandChange"
-                @selection-change="selectionChange"
-                @search-criteria-switch="searchCriteriaSwitch"
-            >
+            <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+                <el-tab-pane label="已完成" name="first" />
+                <el-tab-pane label="处理中" name="second" />
+                <el-tab-pane label="已取消" name="third" />
+                <el-tab-pane label="全部" name="fourth" />
+            </el-tabs>
+            <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page" :search.sync="search"
+                @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+                @refresh-change="refreshChange" @on-load="onLoad" @saveColumn="saveColumn" @resetColumn="resetColumn"
+                :cell-style="cellStyle" :summary-method="summaryMethod" @expand-change="expandChange"
+                @selection-change="selectionChange" @search-criteria-switch="searchCriteriaSwitch" :table-loading="loading">
                 <template slot-scope="{ row }" slot="expand">
-                    <avue-crud
-                        :data="row.itemData"
-                        :option="itemOption"
-                        :table-loading="row.itemLoading"
-                        :cell-style="cellStyle"
-                        class="itemTable"
-                    ></avue-crud>
+                    <avue-crud :data="row.itemData" :option="itemOption" :table-loading="row.itemLoading"
+                        :cell-style="cellStyle" class="itemTable"></avue-crud>
                 </template>
                 <template slot-scope="{ row }" slot="orderStatus">
-                    <span v-for="item in orderStatusList" :style="{color: item.colour}"
-                          v-if="item.dictValue == row.orderStatus">{{ row.orderStatus }}</span>
+                    <span v-for="item in orderStatusList" :style="{ color: item.colour }"
+                        v-if="item.dictValue == row.orderStatus">{{ row.orderStatus }}</span>
                 </template>
                 <template slot-scope="{ row }" slot="grossProfitRate">
                     {{ row.grossProfitRate }}%
@@ -50,21 +36,12 @@
                     <span>{{ row.purchaseAmount | decimalFormat2 }}</span>
                 </template>
                 <template slot-scope="{ row }" slot="grossProfit">
-                    {{ row.grossProfit|decimalFormat2}}
+                    {{ row.grossProfit | decimalFormat2 }}
                 </template>
                 <template slot="menuLeft">
-                    <el-button
-                        type="primary"
-                        icon="el-icon-plus"
-                        size="small"
-                        @click.stop="newAdd('new')"
-                    >创建单据
+                    <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd('new')">创建单据
                     </el-button>
-                    <el-button
-                        type="success"
-                        size="small"
-                        @click.stop="copyDoc()"
-                        :disabled="selectionList.length != 1">
+                    <el-button type="success" size="small" @click.stop="copyDoc()" :disabled="selectionList.length != 1">
                         复制单据
                     </el-button>
                     <el-button type="info" size="small">报表打印</el-button>
@@ -73,106 +50,58 @@
                     <crop-select v-model="search.corpId" corpType="KH"></crop-select>
                 </template>
                 <template slot="portOfLoadSearch">
-                    <port-info v-model="search.portOfLoad"/>
+                    <port-info v-model="search.portOfLoad" />
                 </template>
                 <template slot="portOfDestinationSearch">
-                    <port-info v-model="search.portOfDestination"/>
+                    <port-info v-model="search.portOfDestination" />
                 </template>
                 <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"
+                    <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="plannedDeliveryDateSearch">
-                    <el-date-picker
-                        v-model="search.plannedDeliveryDate"
-                        type="daterange"
-                        start-placeholder="开始日期"
-                        end-placeholder="结束日期"
-                        format="yyyy-MM-dd"
-                        value-format="yyyy-MM-dd HH:mm:ss"
+                    <el-date-picker v-model="search.plannedDeliveryDate" 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="createTimeSearch">
-                    <el-date-picker
-                        v-model="search.createTime"
-                        type="daterange"
-                        start-placeholder="开始日期"
-                        end-placeholder="结束日期"
-                        format="yyyy-MM-dd"
-                        value-format="yyyy-MM-dd HH:mm:ss"
+                    <el-date-picker v-model="search.createTime" 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="scope" slot="corpId">
-                  <span
-                      style="color: #409EFF;cursor: pointer"
-                      @click.stop="editOpen(scope.row, 1)">
-                      {{ scope.row.corpsName }}
-                  </span>
+                    <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">
+                        {{ scope.row.corpsName }}
+                    </span>
                 </template>
                 <template slot-scope="scope" slot="orderNo">
-                  <span
-                      style="color: #409EFF;cursor: pointer"
-                      @click.stop="editOpen(scope.row, 1)">
-                      {{ scope.row.orderNo }}
-                  </span>
+                    <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">
+                        {{ scope.row.orderNo }}
+                    </span>
                 </template>
                 <template slot-scope="scope" slot="menu">
-                    <el-button
-                        type="text"
-                        icon="el-icon-search"
-                        size="small"
-                        @click.stop="procurementProgress(scope.row, scope.index)"
-                    >采购进度
+                    <el-button type="text" icon="el-icon-search" size="small"
+                        @click.stop="procurementProgress(scope.row, scope.index)">采购进度
                     </el-button>
-                    <el-button
-                        type="text"
-                        icon="el-icon-delete"
-                        size="small"
-                        @click.stop="rowDel(scope.row, scope.index)"
-                    >删除
+                    <el-button type="text" icon="el-icon-delete" size="small"
+                        @click.stop="rowDel(scope.row, scope.index)">删除
                     </el-button>
                 </template>
             </avue-crud>
         </basic-container>
-        <detail-page
-            @goBack="goBack"
-            @copyOrder="copyOrder"
-            :detailData="detailData"
-            v-if="!show"
-        ></detail-page>
-        <el-dialog
-            title="采购进度"
-            :visible.sync="dialogVisible"
-            v-if="dialogVisible"
-            :append-to-body="true"
-            width="30%">
+        <detail-page @goBack="goBack" @copyOrder="copyOrder" :detailData="detailData" v-if="!show"></detail-page>
+        <el-dialog title="采购进度" :visible.sync="dialogVisible" v-if="dialogVisible" :append-to-body="true" width="30%">
             <span>
-                <el-table
-                    :data="purchaseStatusList"
-                    size="mini"
-                    :header-cell-style="{color: '#000000d9'}"
+                <el-table :data="purchaseStatusList" size="mini" :header-cell-style="{ color: '#000000d9' }"
                     style="width: 100%">
-                  <el-table-column
-                      prop="orderNo"
-                      align="center"
-                      :show-overflow-tooltip="true"
-                      label="采购单号">
-                  </el-table-column>
-                  <el-table-column
-                      prop="orderStatus"
-                      align="center"
-                      :show-overflow-tooltip="true"
-                      label="采购状态">
-                  </el-table-column>
+                    <el-table-column prop="orderNo" align="center" :show-overflow-tooltip="true" label="采购单号">
+                    </el-table-column>
+                    <el-table-column prop="orderStatus" align="center" :show-overflow-tooltip="true" label="采购状态">
+                    </el-table-column>
                 </el-table>
             </span>
             <span slot="footer" class="dialog-footer">
@@ -192,8 +121,8 @@ import {
     getGoodsInfo, listPurchaseStatus
 } from "@/api/basicData/salesContract";
 import detailPage from "./detailsPage.vue";
-import {defaultDate} from "@/util/date";
-import {micrometerFormat2, IntegerFormat, decimalFormat2} from "@/util/validate";
+import { defaultDate } from "@/util/date";
+import { micrometerFormat2, IntegerFormat, decimalFormat2 } from "@/util/validate";
 import _ from "lodash";
 
 export default {
@@ -202,6 +131,8 @@ export default {
         return {
             dialogVisible: false,
             purchaseStatusList: [],
+            activeName: 'first',
+            tabType: 1,
             search: {
                 // businesDate: defaultDate()
             },
@@ -277,7 +208,7 @@ export default {
             orderStatusList: []
         };
     },
-    components: {detailPage},
+    components: { detailPage },
     async created() {
         this.option = await this.getColumnData(this.getColumnName(4), option);
         getPorts().then(res => {
@@ -308,7 +239,7 @@ export default {
         }
         if (this.$route.query.id) {
             setTimeout(() => {
-                this.editOpen({id: this.$route.query.id}, 1);
+                this.editOpen({ id: this.$route.query.id }, 1);
             }, 100);
         }
         if (this.$route.query.check) {
@@ -328,6 +259,18 @@ export default {
         }
     },
     methods: {
+        handleClick(tab, event) {
+            if (this.activeName == 'first') {
+                this.tabType = 1
+            } else if (this.activeName == 'second') {
+                this.tabType = 2
+            } else if (this.activeName == 'third') {
+                this.tabType = 3
+            } else if (this.activeName == 'fourth') {
+                this.tabType = 4
+            }
+            this.onLoad(this.page, this.search);
+        },
         searchCriteriaSwitch(type) {
             if (type) {
                 this.option.height = this.option.height - 191;
@@ -344,7 +287,7 @@ export default {
         },
         expandChange(row) {
             if (!row.itemData) {
-                getGoodsInfo({id: row.id, tradeType: "CK"})
+                getGoodsInfo({ id: row.id, tradeType: "CK" })
                     .then(res => {
                         this.dataList[row.$index].itemData = res.data.data;
                     })
@@ -429,9 +372,15 @@ export default {
                 };
                 delete params.businesDate;
             }
+
             this.dataList.forEach(item => {
                 this.$refs.crud.toggleRowExpansion(item, false);
             });
+            params={
+                ...params,
+                tabType:this.tabType
+            }
+            this.loading = true
             getList(page.currentPage, page.pageSize, params).then(res => {
                 if (res.data.data.records) {
                     res.data.data.records.forEach(e => {
@@ -441,9 +390,12 @@ export default {
                 this.dataList = res.data.data.records ? res.data.data.records : [];
                 this.page.total = res.data.data.total;
                 if (this.page.total) {
-                    this.option.height = window.innerHeight - 210;
+                    this.option.height = window.innerHeight - 310;
                 }
+            }).finally(() => {
+                this.loading = false;
             });
+
         },
         refreshChange() {
             this.onLoad(this.page, this.search);
@@ -482,7 +434,7 @@ export default {
             this.onLoad(this.page, this.search);
             this.$store.commit("OUT_XS_STATUS");
         },
-        summaryMethod({columns, data}) {
+        summaryMethod({ columns, data }) {
             const sums = [];
             if (columns.length > 0) {
                 columns.forEach((item, index) => {

+ 7 - 0
src/views/iosBasicData/AirtransportExport/bills/index.vue

@@ -385,6 +385,13 @@
                       {{item.dictValue}}
                   </span>
               </template>
+              <template slot="corpCnName" slot-scope="scope">
+                    <span
+                        style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
+                        @click.stop="rowCellfun(scope.row.id, scope.row)">
+                        {{ scope.row.corpCnName }}
+                    </span>
+                </template>
               <template slot="billNo" slot-scope="scope">
                   <span style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
                         @click.stop="rowCellfun(scope.row.id, scope.row)" >

+ 7 - 0
src/views/iosBasicData/AirtransportImport/bills/index.vue

@@ -385,6 +385,13 @@
                       {{item.dictValue}}
                   </span>
               </template>
+              <template slot="corpCnName" slot-scope="scope">
+                    <span
+                        style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
+                        @click.stop="rowCellfun(scope.row.id, scope.row)">
+                        {{ scope.row.corpCnName }}
+                    </span>
+                </template>
               <template slot="billNo" slot-scope="scope">
                   <span style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
                         @click.stop="rowCellfun(scope.row.id, scope.row)" >

+ 7 - 6
src/views/iosBasicData/OceanFreightImport/bills/index.vue

@@ -400,13 +400,14 @@
                       {{item.dictValue}}
                   </span>
               </template>
+              <template slot="corpCnName" slot-scope="scope">
+                    <span
+                        style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
+                        @click.stop="rowCellfun(scope.row.id, scope.row)">
+                        {{ scope.row.corpCnName }}
+                    </span>
+                </template>
               <template slot="billNo" slot-scope="scope">
-                  <!--<span style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"-->
-                  <!--      v-if="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id == scope.row.createUser:true"-->
-                  <!--      @click.stop="rowCellfun(scope.row.id, scope.index)" >-->
-                  <!--    {{scope.row.billNo}}-->
-                  <!--</span>-->
-                  <!--<span v-else >{{scope.row.billNo}}</span>-->
                   <span style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
                         @click.stop="rowCellfun(scope.row.id, scope.row)" >
                       {{scope.row.billNo}}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1491 - 1527
src/views/iosBasicData/SeafreightExportF/bills/index.vue


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor