|
@@ -42,6 +42,7 @@
|
|
|
size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="detailData.seeDisabled"/>
|
|
|
<el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
|
|
|
size="small" type="date" placeholder="选择日期"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
:disabled="detailData.seeDisabled"/>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"
|
|
|
:configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>
|
|
@@ -62,6 +63,7 @@
|
|
|
<el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled"/>
|
|
|
<el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
|
|
|
size="small" type="date" placeholder="选择日期"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
:disabled="detailData.seeDisabled"/>
|
|
|
<selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>
|
|
|
<el-input
|
|
@@ -106,6 +108,22 @@
|
|
|
:disabled="detailData.seeDisabled">选择</el-button>
|
|
|
<span>{{ row.code }}</span>
|
|
|
</template>
|
|
|
+ <template slot="purchaseAmount" slot-scope="{ row }">
|
|
|
+ <el-select
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.purchaseAmount"
|
|
|
+ @focus="getPurchasePrice(row)"
|
|
|
+ allow-create
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in purchasePriceOption"
|
|
|
+ :key="index"
|
|
|
+ :label="item.purchasePrice"
|
|
|
+ :value="item.purchasePrice"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ row.purchaseAmount }}</span>
|
|
|
+ </template>
|
|
|
<template slot="orderQuantity" slot-scope="{ row }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
@@ -304,7 +322,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
- title="导入"
|
|
|
+ title="导入政策"
|
|
|
append-to-body
|
|
|
class="el-dialogDeep"
|
|
|
:visible.sync="policyDialog"
|
|
@@ -381,6 +399,7 @@
|
|
|
@refresh-change="refreshChangeCost"
|
|
|
@selection-change="selectionChangeCost"
|
|
|
:page.sync="pageCost"
|
|
|
+ @search-change="feesSearch"
|
|
|
@on-load="onLoadCost">
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
@@ -428,6 +447,7 @@ import {
|
|
|
import _ from "lodash";
|
|
|
import option from "./configuration/mainList.json";
|
|
|
import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
+import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
@@ -491,7 +511,8 @@ export default {
|
|
|
lazy: true,
|
|
|
treeLoad: function (node, resolve) {
|
|
|
const parentId = (node.level === 0) ? 0 : node.data.id;
|
|
|
- policyColumn(parentId).then(res => {
|
|
|
+ const newTime = new Date().toLocaleString('chinese',{hour12:false})
|
|
|
+ policyColumn({newTime: newTime,parentId: parentId}).then(res => {
|
|
|
resolve(res.data.data.map(item => {
|
|
|
return {
|
|
|
...item,
|
|
@@ -961,6 +982,8 @@ export default {
|
|
|
oldGoodsList: [],
|
|
|
oldFeesList: [],
|
|
|
oldUploadList: [],
|
|
|
+ // 采购价格
|
|
|
+ purchasePriceOption: [],
|
|
|
}
|
|
|
},
|
|
|
//初始化查询
|
|
@@ -1035,11 +1058,11 @@ export default {
|
|
|
goodsNum.push(item.sort)
|
|
|
purchaseAmount += Number(item.purchaseAmount)
|
|
|
})
|
|
|
- if (Number(this.form.grossProfit) != 0) {
|
|
|
- this.form.grossProfitRate = (((Number(this.form.grossProfit) - Number(purchaseAmount)) / Number(this.form.grossProfit)) * 100).toFixed(2)
|
|
|
- } else {
|
|
|
- this.form.grossProfitRate = '0.00'
|
|
|
- }
|
|
|
+ // if (Number(this.form.grossProfit) != 0) {
|
|
|
+ // this.form.grossProfitRate = (((Number(this.form.grossProfit) - Number(purchaseAmount)) / Number(this.form.grossProfit)) * 100).toFixed(2)
|
|
|
+ // } else {
|
|
|
+ // this.form.grossProfitRate = '0.00'
|
|
|
+ // }
|
|
|
if (goodsNum.length == 0) {
|
|
|
this.maxGoodsNum = 0;
|
|
|
} else {
|
|
@@ -1079,6 +1102,12 @@ export default {
|
|
|
copyOrder() {
|
|
|
this.queryData(this.form.id, true)
|
|
|
},
|
|
|
+ // 采购金额获取
|
|
|
+ getPurchasePrice(row) {
|
|
|
+ getPurchasePrice({code: '3ELX978F'}).then(res => {
|
|
|
+ this.purchasePriceOption = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
// 生成采购单
|
|
|
saveSell() {
|
|
|
if (!this.form.id) {
|
|
@@ -1273,11 +1302,19 @@ export default {
|
|
|
this.$set(this.tableData[item], 'priceType', '一般')
|
|
|
this.$set(this.tableData[item], 'orderQuantity', 0)
|
|
|
this.$set(this.tableData[item], 'actualQuantity', 0)
|
|
|
+ this.$set(this.tableData[item], 'purchaseAmount', 0)
|
|
|
this.tableData[item].price = 0
|
|
|
this.tableData[item].amount = 0
|
|
|
this.tableData[item].sort = this.maxGoodsNum + 1
|
|
|
- this.maxGoodsNum++
|
|
|
delete this.tableData[item].id
|
|
|
+ delete this.tableData[item].pid
|
|
|
+ delete this.tableData[item].isDeleted
|
|
|
+ delete this.tableData[item].status
|
|
|
+ delete this.tableData[item].tenantId
|
|
|
+ delete this.tableData[item].updateTime
|
|
|
+ delete this.tableData[item].updateUser
|
|
|
+ delete this.tableData[item].updateUserName
|
|
|
+ this.maxGoodsNum++
|
|
|
this.$refs.crudContact.rowCellAdd(this.tableData[item]);
|
|
|
this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
|
|
|
})
|
|
@@ -1339,8 +1376,7 @@ export default {
|
|
|
},
|
|
|
//销售政策特价促销选中触发
|
|
|
selectionChangePolicy(list) {
|
|
|
- console.log(list)
|
|
|
- this.policyData = this.policyData.concat(list)
|
|
|
+ this.policyData = list
|
|
|
// this.policyData.forEach(item => {
|
|
|
// this.$set(item, 'price', item.specialOffer)
|
|
|
// })
|
|
@@ -1352,7 +1388,7 @@ export default {
|
|
|
},
|
|
|
//销售政策买赠促销选中触发
|
|
|
selectionChangePolicyTwo(list) {
|
|
|
- this.policyDataTwo = this.policyDataTwo.concat(list)
|
|
|
+ this.policyDataTwo = list
|
|
|
// this.policyDataTwo.forEach(item => {
|
|
|
// this.$set(item, 'price', item.salesPrice)
|
|
|
// })
|
|
@@ -1367,7 +1403,7 @@ export default {
|
|
|
let list = this.policyData.concat(this.policyDataTwo)
|
|
|
for (let item in list) {
|
|
|
selectGoodsNum({
|
|
|
- goodsId: list[item].id,
|
|
|
+ goodsId: list[item].itemId,
|
|
|
typeno: list[item].typeno
|
|
|
}).then(res => {
|
|
|
this.$set(list[item], 'storageQuantity', res.data.data)
|
|
@@ -1385,6 +1421,14 @@ export default {
|
|
|
this.$set(list[item], 'cname', list[item].productCategory)
|
|
|
this.$set(list[item], 'sort', this.maxGoodsNum + 1)
|
|
|
this.$set(list[item], 'purchaseAmount', list[item].purchasePrice)
|
|
|
+ delete list[item].id
|
|
|
+ delete list[item].pid
|
|
|
+ delete list[item].isDeleted
|
|
|
+ delete list[item].status
|
|
|
+ delete list[item].tenantId
|
|
|
+ delete list[item].updateTime
|
|
|
+ delete list[item].updateUser
|
|
|
+ delete list[item].updateUserName
|
|
|
this.maxGoodsNum++
|
|
|
this.$refs.crudContact.rowCellAdd(list[item]);
|
|
|
this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
|
|
@@ -1447,9 +1491,17 @@ export default {
|
|
|
detailList(this.treePolicyId).then(res => {
|
|
|
this.policyForm = res.data.data
|
|
|
//特价促销
|
|
|
- this.dataPolicy = res.data.data.specialItemList
|
|
|
+ if(res.data.data.specialItemList) {
|
|
|
+ this.dataPolicy = res.data.data.specialItemList
|
|
|
+ } else {
|
|
|
+ this.dataPolicy = []
|
|
|
+ }
|
|
|
//买赠促销
|
|
|
- this.contactsDataBuyFree = res.data.data.presentItemList
|
|
|
+ if (res.data.data.presentItemList) {
|
|
|
+ this.contactsDataBuyFree = res.data.data.presentItemList
|
|
|
+ } else {
|
|
|
+ this.contactsDataBuyFree = []
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
//
|
|
@@ -1469,6 +1521,11 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ // 费用查询按钮
|
|
|
+ feesSearch(params, done) {
|
|
|
+ this.onLoadCost(this.pageCost, params)
|
|
|
+ done()
|
|
|
+ },
|
|
|
//费用查询
|
|
|
onLoadCost(page, params = {}) {
|
|
|
this.loadingCost = true;
|
|
@@ -1563,7 +1620,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 计算毛利额
|
|
|
- this.$set(this.form, 'grossProfit', 0)
|
|
|
+ // this.$set(this.form, 'grossProfit', 0)
|
|
|
this.$set(this.form, 'orderAmount', 0)
|
|
|
// 成本价
|
|
|
let purchaseAmount = 0
|
|
@@ -1573,12 +1630,12 @@ export default {
|
|
|
purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
|
|
|
}
|
|
|
// this.form.grossProfit += Number(item.amount)
|
|
|
- this.form.orderAmount += Number(item.amount).toFixed(2)
|
|
|
+ this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
|
|
|
})
|
|
|
- this.form.grossProfit = (Number(this.form.orderAmount) - Number(purchaseAmount)).toFixed(2)
|
|
|
- if (this.form.orderAmount && this.form.overPayment) {
|
|
|
- this.form.debitAmount = Number(this.form.orderAmount) - Number(this.form.overPayment)
|
|
|
- }
|
|
|
+ // this.form.grossProfit = (Number(this.form.orderAmount) - Number(purchaseAmount)).toFixed(2)
|
|
|
+ // if (this.form.orderAmount && this.form.overPayment) {
|
|
|
+ // this.form.debitAmount = Number(this.form.orderAmount) - Number(this.form.overPayment)
|
|
|
+ // }
|
|
|
if (this.form.orderAmount && this.form.settlmentAmount) {
|
|
|
this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
|
|
|
}
|