lichao 3 yıl önce
ebeveyn
işleme
ccbc22e867

+ 9 - 0
src/api/financialManagement/paymentRequest.js

@@ -130,3 +130,12 @@ export function deleteDetail(data) {
   })
 }
 
+// 账单明细删除
+export function removeDetail(data) {
+  return request({
+    url: '/api/trade-finance/acc/remove',
+    method: 'post',
+    params: data
+  })
+}
+

+ 2 - 1
src/components/crop-select/configuration/mainList.json

@@ -16,12 +16,13 @@
             "prop": "code",
             "index": 1,
             "width":100,
+          "search": true,
           "overHidden": true
         },{
             "label": "名称",
             "prop": "cname",
             "search": true,
-            "searchSpan": 16,
+            "searchSpan": 8,
             "index": 2,
             "width":180,
         "overHidden": true

+ 5 - 3
src/components/finance/financialAccount.vue

@@ -500,9 +500,9 @@
         this.submitButton = true
         const itemsList = this.data.map(item => {
           item.corpId = this.corpId;
-          item.tradeType = this.billData.optionType?this.billData.optionType: item.tradeType
-          item.srcType = this.srcType
-          return item
+          item.tradeType = this.billData.optionType?this.billData.optionType: item.tradeType;
+          item.srcType = item.srcType? item.srcType: this.srcType;
+          return item;
         })
         const params = {
           url: this.checkData.url,
@@ -520,6 +520,7 @@
             if(res.data.success){
               this.$message.success("操作成功!")
               this.$emit("choceFun");
+              this.$emit("submit")
               //跳转付款申请页面
 
               // if(this.$store.getters.pqStatus){
@@ -548,6 +549,7 @@
             if(res.data.success){
               this.$message.success("操作成功!")
               this.$emit("choceFun");
+              this.$emit("submit")
             }
           }).finally(()=>{
             this.submitButton = false

+ 0 - 1
src/views/approval/processConfig/index.vue

@@ -418,7 +418,6 @@ export default {
         item.levelId = _.add(item.$index,1)
         delete item.id
         if (item.auditMoldId) {
-          console.log(item.auditMoldId)
           item.auditMoldId = item.auditMoldId.join(',');
         }
         if (item.auditUserId) {

+ 1 - 1
src/views/approveData/configuration/mainList.json

@@ -113,7 +113,7 @@
     },
     {
       "label": "申请人",
-      "prop": "sendName",
+      "prop": "sendRealName",
       "overHidden": true,
       "search": true,
       "index": 7,

+ 38 - 65
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -174,7 +174,7 @@
               <el-select
                 v-if="row.$cellEdit"
                 v-model="row.purchaseAmount"
-                @focus="changeContractAmt(row)"
+                @change="changeContractAmt(row)"
                 allow-create
                 filterable
                 v-input-limit="2"
@@ -364,25 +364,6 @@
         </span>
     </el-dialog>
 
-    <el-dialog
-      title="账单"
-      append-to-body
-      class="el-dialogDeep"
-      :visible.sync="applyPaymentDialog"
-      width="60%"
-      :close-on-click-modal="false"
-      :destroy-on-close="true"
-      :close-on-press-escape="false"
-      v-dialog-drag
-    >
-      <apply-payment
-        :billType="billType"
-        :billData="billData"
-        itemType="采购"
-        @choceFun="choceFun"
-      >
-      </apply-payment>
-    </el-dialog>
 
     <el-dialog
       append-to-body
@@ -396,11 +377,13 @@
       v-dialog-drag
     >
       <financial-account
+        v-if="financialAccountDialog"
         :billType="billType"
         :billData="{}"
         :arrList="applyPaymentList"
         :checkData="financeData"
         @choceFun="choceFun"
+        @submit="feeSubmit"
       >
       </financial-account>
     </el-dialog>
@@ -884,13 +867,13 @@ export default {
       detail(id).then(res => {
         this.form = res.data.data;
         this.browse = this.form.status > 0? true: false
-        this.contactsData = this.form.itemsVOList? this.form.itemsVOList: []
+        this.contactsData = this.form.orderItemsList? this.form.orderItemsList: []
         this.advantageProjectData = this.form.orderFeesList? this.form.orderFeesList: []
         this.bankOfDepositData = this.form.orderFilesList? this.form.orderFilesList: []
-        if (!this.form.itemsVOList) {
+        if (!this.form.orderItemsList) {
           this.contactsData = []
         } else {
-          this.contactsData = this.form.itemsVOList
+          this.contactsData = this.form.orderItemsList
         }
         // if (!this.form.orderFeesList) {
         //   this.advantageProjectData = []
@@ -926,7 +909,7 @@ export default {
         })
         this.goodsConfiguration.dicData = [].concat(goodsData)
         this.removeGoodsRepeat()
-        delete this.form.itemsVOList
+        delete this.form.orderItemsList
         delete this.form.orderFeesList
         delete this.form.orderFilesList
         // delete this.form.corpsName
@@ -1485,34 +1468,36 @@ export default {
         checkType: 'ffsq'
       }
       this.contactsData.map(e => {
-        const form = {
-          belongCompany: this.form.belongCompany,
-          srcOrderno:this.form.orderNo,
-          itemType:"采购",
-          corpsName:this.form.corpsName,
-          corpId:this.form.corpId,
-          srcParentId: this.form.id,
-          currency: 'CNY',
-          exchangeRate: '1',
-          taxRate: '0',
-          accDate: this.form.businesDate,
-          srcType: 1, // 1.采购or销售主表货款申请 2. 采购or销售-费用明细申请  3.收发货-费用明细
-          tradeType: 'GN',
-          optionType: 'GN',
-          amount: e.amount,
-          goodName: e.cname,
-          price: e.price,
-          unit: e.unit,
-          quantity: e.orderQuantity,
-          srcFeesId: e.id,
-          costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+        if (e.submitPay != 1) {
+          const form = {
+            belongCompany: this.form.belongCompany,
+            srcOrderno:this.form.orderNo,
+            itemType:"采购",
+            corpsName:this.form.corpsName,
+            corpId:this.form.corpId,
+            srcParentId: this.form.id,
+            currency: 'CNY',
+            exchangeRate: '1',
+            taxRate: '0',
+            accDate: this.form.businesDate,
+            srcType: 1, // 1.采购or销售主表货款申请 2. 采购or销售-费用明细申请  3.收发货-费用明细
+            tradeType: 'GN',
+            optionType: 'GN',
+            amount: e.amount,
+            goodName: e.cname,
+            price: e.purchaseAmount,
+            unit: e.unit,
+            quantity: e.orderQuantity,
+            srcFeesId: e.id,
+            costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+          }
+          arr.push(form)
         }
-        arr.push(form)
       })
-      let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 2)
+      let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 2 && item.submitPay != 1)
       getFeeList.forEach(item => {
         let form = {
-          srcOrderno:this.form.orgOrderNo,
+          srcOrderno:this.form.orderNo,
           itemType:"采购",
           corpsName:item.corpName,
           corpId: item.corpId,
@@ -1549,28 +1534,16 @@ export default {
     },
     //申请货款
     applyPayment(type){
-      // if (contrastObj(this.form, this.oldForm) ||
-      //   contrastList(this.contactsData, this.oldGoodsList) ||
-      //   contrastList(this.advantageProjectData, this.oldFeesList) ||
-      //   contrastList(this.bankOfDepositData, this.oldUploadList)
-      // ) {
-      //   this.$confirm("您已改动数据,是否先保存在进行操作!", {
-      //     confirmButtonText: "保存",
-      //     cancelButtonText: "取消",
-      //     type: "warning"
-      //   }).then(() => {
-      //     this.editCustomer();
-      //   })
-      // }else{
-        this.beforeBillData(true,type);
-        this.financialAccountDialog = true;
-      // }
-
+      this.beforeBillData(true,type);
+      this.financialAccountDialog = true;
     },
     //关闭账单
     choceFun(){
       this.financialAccountDialog  = false
     },
+    feeSubmit() {
+      this.queryData(this.form.id);
+    },
     //返回列表
     backToList() {
       if (contrastObj(this.form, this.oldForm) ||

+ 53 - 33
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -337,15 +337,6 @@
               ></el-input>
               <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
             </template>
-<!--            <template slot="cname" slot-scope="{ row }">-->
-<!--              <goods-select v-if="row.$cellEdit" v-model="row.cname" @getRow="getGoodsRow($event, row)"-->
-<!--                               :configuration="goodsConfiguration" @receiveList="receiveGoodList" @returnRow="getRow($event, row)"-->
-<!--                            :artsVision="form.belongToCorpId"-->
-<!--              />-->
-<!--              <span v-else>-->
-<!--                {{row.cname}}-->
-<!--              </span>-->
-<!--            </template>-->
             <template slot="shopQuality" slot-scope="{ row }">
               <el-switch
                 v-model="row.shopQuality"
@@ -432,6 +423,12 @@
                   :disabled="detailData.seeDisabled || browse"
                 >导 入</el-button>
               </el-upload>
+              <el-button
+                type="warning"
+                icon="el-icon-refresh"
+                size="small"
+                @click="resetStock"
+              >库存刷新</el-button>
             </template>
           </avue-crud>
         </basic-container>
@@ -661,11 +658,13 @@
       v-dialog-drag
     >
       <financial-account
+        v-if="financialAccountDialog"
         :billType="billType"
         :billData="{}"
         :arrList="applyPaymentList"
         :belongCompany="form.belongCompany"
         @choceFun="choceFun"
+        @submit="feeSubmit"
       >
       </financial-account>
     </el-dialog>
@@ -1809,6 +1808,7 @@ export default {
     },
     // 复制新单
     copyOrder() {
+      this.saveActives = ''
       this.queryData(this.form.id, true)
     },
     getcorpId(row) {
@@ -2116,32 +2116,34 @@ export default {
       this.billType = type
       const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData
       data.map(e => {
-        const form = {
-          belongCompany: this.form.belongCompany,
-          srcOrderno:this.form.orgOrderNo,
-          itemType:"销售",
-          corpsName:this.form.corpName,
-          corpId:this.form.corpId,
-          srcParentId: this.form.id,
-          currency: 'CNY',
-          exchangeRate: '1',
-          taxRate: '0',
-          accDate: this.form.businesDate,
-          srcType: 1,
-          tradeType: 'GN',
-          optionType: 'GN',
-          chargeMember: this.form.chargeMember,
-          amount: e.amount,
-          quantity: e.orderQuantity, // 数量
-          price: e.price,
-          unit: e.unit,
-          goodName: e.cname,
-          srcFeesId: e.id,
-          costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+        if (e.submitPay != 1) {
+          const form = {
+            belongCompany: this.form.belongCompany,
+            srcOrderno:this.form.orgOrderNo,
+            itemType:"销售",
+            corpsName:this.form.corpName,
+            corpId:this.form.corpId,
+            srcParentId: this.form.id,
+            currency: 'CNY',
+            exchangeRate: '1',
+            taxRate: '0',
+            accDate: this.form.businesDate,
+            srcType: 1,
+            tradeType: 'GN',
+            optionType: 'GN',
+            chargeMember: this.form.chargeMember,
+            amount: e.amount,
+            quantity: e.orderQuantity, // 数量
+            price: e.price,
+            unit: e.unit,
+            goodName: e.cname,
+            srcFeesId: e.id,
+            costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+          }
+          arr.push(form)
         }
-        arr.push(form)
       })
-      let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 1)
+      let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 1 && item.submitPay != 1)
       getFeeList.forEach(item => {
         let form = {
           srcOrderno:this.form.orgOrderNo,
@@ -2175,6 +2177,10 @@ export default {
     choceFun(){
       this.financialAccountDialog  = false
     },
+    feeSubmit() {
+      this.saveActives = ''
+      this.queryData(this.form.id);
+    },
     //商品选中触发
     productSelection(selection) {
       this.selection = selection
@@ -3468,6 +3474,20 @@ export default {
       }
       row.amount = Number(row.price) * Number(row.orderQuantity)
     },
+    // 库存刷新
+    resetStock() {
+      this.goodsShowData.forEach(item => {
+        selectGoodsNum({
+          goodsId: item.itemId,
+          itemType: item.itemType? item.itemType: item.typeno,
+          tradeType: 'GN',
+          storageId: this.form.storageId
+        }).then(res => {
+          item.storageQuantity = res.data.data
+        })
+      })
+      this.$message.success('刷新成功')
+    },
   },
   computed: {
     ...mapGetters(["userInfo", "permission"])

+ 25 - 2
src/views/financialManagement/billDetails/billDetails.vue

@@ -47,7 +47,7 @@
           icon="el-icon-delete"
           size="small"
           :disabled="scope.row.billType === '申请' ||  scope.row.settlementAmount != 0"
-          @click.stop=""
+          @click.stop="rowDel(scope.row)"
         >删除
         </el-button>
       </template>
@@ -57,7 +57,7 @@
 
 <script>
   import option from "./configuration/mainList.json";
-  import { getBillList } from "@/api/financialManagement/paymentRequest";
+  import { getBillList, removeDetail } from "@/api/financialManagement/paymentRequest";
   import _ from "lodash";
 
   export default {
@@ -201,6 +201,29 @@
           this.$refs.crud.$refs.dialogColumn.columnBox = false;
         }
       },
+      rowDel(row){
+        this.$confirm("确定删除数据?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          if (row.id) {
+            removeDetail({ids: row.id}).then(res => {
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              })
+              this.dataList.splice(row.$index, 1);
+            })
+          } else {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.dataList.splice(row.$index, 1);
+          }
+        });
+      },
     }
   }
 </script>

+ 6 - 6
src/views/maintenance/salesPolicy/configuration/customerContact.json

@@ -25,7 +25,7 @@
       "prop": "code",
       "index": 1,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {
@@ -39,7 +39,7 @@
       "prop": "brand",
       "index": 1,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {
@@ -53,7 +53,7 @@
       "prop": "productCategory",
       "index": 2,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {
@@ -67,7 +67,7 @@
       "prop": "typeno",
       "index": 3,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {
@@ -81,7 +81,7 @@
       "prop": "brandItem",
       "index": 3,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {
@@ -94,7 +94,7 @@
       "label": "供应商",
       "prop": "corpId",
       "index": 3,
-      "width":100,
+      "width":160,
       "cell": false,
       "slot": true,
       "overHidden": true,

+ 16 - 9
src/views/maintenance/salesPolicy/detailsPageEdit.vue

@@ -169,7 +169,7 @@
               </el-upload>
             </template>
             <template slot-scope="{ row, index }" slot="menu">
-              <el-button type="text" size="small" @click="rowCell(row, index)" :disabled="!form.id"
+              <el-button type="text" size="small" @click="rowCell(row, index)"
                 >{{ row.$cellEdit ? "保存" : "修改" }}
               </el-button>
               <el-button
@@ -321,6 +321,7 @@ import {
 import goodsOption from "./configuration/commodity.json";
 import { contrastObj, contrastList } from "@/util/contrastData";
 import { getToken } from "@/util/auth";
+import { getPurchasePrice } from "@/api/basicData/fees"
 
 export default {
   name: "detailsPage",
@@ -636,8 +637,9 @@ export default {
         } else {
           this.selectionList.forEach(e => {
             if (this.reData.salesType == 1) {
-              this.contactsData.forEach((item, index) => {
+              this.contactsData.forEach(async (item, index) => {
                 if (index == this.reData.index) {
+                  item.purchasePrice = await this.getPurchasePrice(e);
                   item.itemId = e.id;
                   item.code = e.code;
                   item.cname = e.cname;
@@ -654,7 +656,7 @@ export default {
                 }
               });
             } else {
-              this.contactsDataBuyFree.forEach((item, index) => {
+              this.contactsDataBuyFree.forEach(async (item, index) => {
                 item.itemId = e.id;
                 item.code = e.code;
                 item.cname = e.cname;
@@ -675,9 +677,9 @@ export default {
         }
       } else {
         if (this.salesType == 1) {
-          this.selectionList.forEach(item => {
-            console.log(item);
+          this.selectionList.forEach(async item => {
             this.contactsData.push({
+              purchasePrice: await this.getPurchasePrice(item),
               itemId: item.id,
               code: item.code,
               brand: item.brand,
@@ -686,7 +688,6 @@ export default {
               brandItem: item.brandItem,
               corpId: item.corpId,
               corpName: item.corpName,
-              purchasePrice: "",
               salesPrice: "",
               specialOffer: "",
               updateUserName: "",
@@ -771,8 +772,7 @@ export default {
     },
     //商品编辑
     rowCell(row, index) {
-      console.log(row);
-      if (row.$cellEdit) {
+      if (row.$cellEdit && this.form.id) {
         itemSubmit({...row,pid: this.form.id}).then(res => {
           this.$message.success('保存成功')
           this.$refs.crudContact.rowCell(row, index);
@@ -909,7 +909,14 @@ export default {
         arr.push(e.id);
       });
       this.form.corps = arr;
-    }
+    },
+    async getPurchasePrice(row) {
+      let data;
+      await getPurchasePrice({code: row.code}).then(res => {
+        data = res.data.data.length > 0? res.data.data[0].purchasePrice: 0
+      })
+      return data;
+    },
   }
 };
 </script>