|
@@ -52,7 +52,7 @@
|
|
|
@click="editCustomer"
|
|
|
size="small"
|
|
|
:loading="btnLoading"
|
|
|
- :disabled="disabled || confirmDisabled"
|
|
|
+ :disabled="disabled"
|
|
|
>保存数据
|
|
|
</el-button>
|
|
|
</div>
|
|
@@ -95,7 +95,7 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
size="small"
|
|
|
- :disabled="disabled || confirmDisabled"
|
|
|
+ :disabled="disabled"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item,index) in userList"
|
|
@@ -302,6 +302,9 @@
|
|
|
</el-select>
|
|
|
<span v-else>{{ row.lotNo }}</span>
|
|
|
</template>
|
|
|
+ <template slot="newJob" slot-scope="{ row, index }">
|
|
|
+ <span style="color: #1e9fff;cursor: pointer" @click="openHistory(row)">{{ row.newJob }}</span>
|
|
|
+ </template>
|
|
|
<template slot="remarks" slot-scope="{ row, index }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
@@ -419,7 +422,7 @@
|
|
|
<report-dialog
|
|
|
:switchDialog="switchDialog"
|
|
|
:reportId="form.id"
|
|
|
- reportName="代理商-报表"
|
|
|
+ reportName="经销商-销售单"
|
|
|
@onClose="onClose()"
|
|
|
/>
|
|
|
<!-- 账单-->
|
|
@@ -442,6 +445,13 @@
|
|
|
@choceFun="choceFun"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
+ <!-- 历史记录-->
|
|
|
+ <view-history
|
|
|
+ v-if="historyVisible"
|
|
|
+ ref="history"
|
|
|
+ :params="historyParams"
|
|
|
+ @closeDialog="closeDialog"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -454,7 +464,7 @@ import {getUserInfo} from "@/api/system/user";
|
|
|
import { gainUser } from "@/api/basicData/customerInquiry";
|
|
|
import {selectGoodsNum} from "@/api/basicData/inventoryAccount"; // 库存查询
|
|
|
import {detail as KHDetail} from "@/api/basicData/customerInformation";
|
|
|
-import {dataDetail, removeGoods, typeSave, getLotNo, dealerSubmit} from "@/api/dealer/sales";
|
|
|
+import {dataDetail, removeGoods, typeSave, getLotNo, dealerSubmit, historyPrice} from "@/api/dealer/sales";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import {
|
|
|
isDiscount,
|
|
@@ -469,6 +479,8 @@ import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
|
|
|
import {getDetail} from "@/api/basicData/inventoryAccount";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
import { getCurrentDate } from "@/util/date";
|
|
|
+import viewHistory from '../componet/history';
|
|
|
+import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
|
|
|
|
|
|
export default {
|
|
|
name: "detail",
|
|
@@ -482,6 +494,7 @@ export default {
|
|
|
billApplication,
|
|
|
financialAccount,
|
|
|
checkSchedule,
|
|
|
+ viewHistory,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -714,6 +727,8 @@ export default {
|
|
|
baseURL: '/api/blade-purchase-sales/orderitems/importDealerOrder',
|
|
|
headers: { "Blade-Auth": 'Bearer ' + getToken()},
|
|
|
uploadParam: {},
|
|
|
+ historyVisible: false,
|
|
|
+ historyParams: {},
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -791,9 +806,9 @@ export default {
|
|
|
}
|
|
|
this.confirmDisabled = this.form.status == 3? true: false;
|
|
|
if (this.confirmDisabled) {
|
|
|
- this.option.column.map(e => {
|
|
|
- this.$set(e, 'disabled', true)
|
|
|
- })
|
|
|
+ // this.option.column.map(e => {
|
|
|
+ // this.$set(e, 'disabled', true)
|
|
|
+ // })
|
|
|
}
|
|
|
this.dataList = this.form.orderItemsList? this.form.orderItemsList: [];
|
|
|
this.uploadData = this.form.orderFilesList? this.form.orderFilesList: [];
|
|
@@ -817,11 +832,17 @@ export default {
|
|
|
},
|
|
|
openEdit() {
|
|
|
this.disabled = false;
|
|
|
- if (this.form.status != 3) {
|
|
|
- this.option.column.map(e => {
|
|
|
+ this.option.column.map(e => {
|
|
|
+ if (this.confirmDisabled) {
|
|
|
+ if (e.prop == 'businesDate') {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'disabled', false)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.$set(e, 'disabled', false)
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
copyDoc() {
|
|
|
this.$emit("copyOrder", this.form.id);
|
|
@@ -949,6 +970,21 @@ export default {
|
|
|
this.selectionList.forEach(e => {
|
|
|
this.dataList.forEach(async (item, index) => {
|
|
|
if (index == this.reData.index) {
|
|
|
+ getMarketPrice({code: e.code,isFreight: 0, isLabel: 0}).then(response => {
|
|
|
+ if (response.data.data.length > 0) {
|
|
|
+ this.$set(e, 'price', response.data.data[0].salePrice)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'price', '0')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let historyData = await this.getHistoryData(e, 1); // 获得最新数据
|
|
|
+ if (historyData.length > 0) {
|
|
|
+ e.newJob = historyData[0].price;
|
|
|
+ e.newDate = historyData[0].businesDate;
|
|
|
+ } else {
|
|
|
+ e.newJob = null;
|
|
|
+ e.newDate = null;
|
|
|
+ }
|
|
|
if (e.batch == 0) {
|
|
|
form = await this.getStockInfo({
|
|
|
tradeType: 'JXS',
|
|
@@ -980,6 +1016,9 @@ export default {
|
|
|
item.priceCategory = e.goodsTypeName;
|
|
|
item.purchaseAmount = e.purchaseAmount;
|
|
|
item.batch = e.batch;
|
|
|
+ item.newDate = e.newDate;
|
|
|
+ item.newJob = e.newJob;
|
|
|
+ item.price = e.price;
|
|
|
item.$cellEdit = true;
|
|
|
}
|
|
|
});
|
|
@@ -988,6 +1027,21 @@ export default {
|
|
|
} else {
|
|
|
if (this.goodsListSave.length > 0) { // 暂存的有数据
|
|
|
this.goodsListSave.forEach(async e => {
|
|
|
+ getMarketPrice({code: e.code,isFreight: 0, isLabel: 0}).then(response => {
|
|
|
+ if (response.data.data.length > 0) {
|
|
|
+ this.$set(e, 'price', response.data.data[0].salePrice)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'price', '0')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let historyData = await this.getHistoryData(e, 1); // 获得最新数据
|
|
|
+ if (historyData.length > 0) {
|
|
|
+ e.newJob = historyData[0].price;
|
|
|
+ e.newDate = historyData[0].businesDate;
|
|
|
+ } else {
|
|
|
+ e.newJob = null;
|
|
|
+ e.newDate = null;
|
|
|
+ }
|
|
|
if (e.batch == 0) {
|
|
|
form = await this.getStockInfo({
|
|
|
tradeType: 'JXS',
|
|
@@ -1018,18 +1072,35 @@ export default {
|
|
|
corpName: e.corpName,
|
|
|
unit: e.unit,
|
|
|
size: e.size,
|
|
|
- price: 0,
|
|
|
+ price: e.price,
|
|
|
amount: 0,
|
|
|
orderQuantity: 0,
|
|
|
storageQuantity: e.storageQuantity,
|
|
|
purchaseAmount: e.purchaseAmount,
|
|
|
batch: e.batch,
|
|
|
arr: e.arr,
|
|
|
+ newJob:e.newJob,
|
|
|
+ newDate: e.newDate,
|
|
|
$cellEdit: true
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
this.selectionList.forEach(async e => {
|
|
|
+ getMarketPrice({code: e.code,isFreight: 0, isLabel: 0}).then(response => {
|
|
|
+ if (response.data.data.length > 0) {
|
|
|
+ this.$set(e, 'price', response.data.data[0].salePrice)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'price', '0')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let historyData = await this.getHistoryData(e, 1); // 获得最新数据
|
|
|
+ if (historyData.length > 0) {
|
|
|
+ e.newJob = historyData[0].price;
|
|
|
+ e.newDate = historyData[0].businesDate;
|
|
|
+ } else {
|
|
|
+ e.newJob = null;
|
|
|
+ e.newDate = null;
|
|
|
+ }
|
|
|
if (e.batch == 0) {
|
|
|
form = await this.getStockInfo({
|
|
|
tradeType: 'JXS',
|
|
@@ -1060,13 +1131,15 @@ export default {
|
|
|
corpName: e.corpName,
|
|
|
unit: e.unit,
|
|
|
size: e.size,
|
|
|
- price: 0,
|
|
|
amount: 0,
|
|
|
orderQuantity: 0,
|
|
|
storageQuantity: e.storageQuantity,
|
|
|
purchaseAmount: e.purchaseAmount,
|
|
|
batch: e.batch,
|
|
|
arr: e.arr,
|
|
|
+ newJob: e.newJob,
|
|
|
+ newDate: e.newDate,
|
|
|
+ price: e.price,
|
|
|
$cellEdit: true
|
|
|
});
|
|
|
});
|
|
@@ -1189,6 +1262,22 @@ export default {
|
|
|
let form = {};
|
|
|
this.goodsoptions.forEach(async e => {
|
|
|
if (e.code == row.code) {
|
|
|
+ getMarketPrice({code: e.code,isFreight: 0, isLabel: 0}).then(response => {
|
|
|
+ if (response.data.data.length > 0) {
|
|
|
+ this.$set(e, 'price', response.data.data[0].salePrice)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'price', '0')
|
|
|
+ }
|
|
|
+ this.$set(row, 'amount', (Number(e.price) * Number(row.orderQuantity)).toFixed(2))
|
|
|
+ })
|
|
|
+ let historyData = await this.getHistoryData(e, 1); // 获得最新数据
|
|
|
+ if (historyData.length > 0) {
|
|
|
+ e.newJob = historyData[0].price;
|
|
|
+ e.newDate = historyData[0].businesDate;
|
|
|
+ } else {
|
|
|
+ e.newJob = null;
|
|
|
+ e.newDate = null;
|
|
|
+ }
|
|
|
if (e.batch == 0) {
|
|
|
form = await this.getStockInfo({
|
|
|
tradeType: 'JXS',
|
|
@@ -1223,6 +1312,9 @@ export default {
|
|
|
row.priceCategory = e.goodsTypeName;
|
|
|
row.purchaseAmount = e.purchaseAmount;
|
|
|
row.batch = e.batch;
|
|
|
+ row.newJob = e.newJob;
|
|
|
+ row.newDate = e.newDate;
|
|
|
+ row.price = e.price;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1230,6 +1322,22 @@ export default {
|
|
|
let form = {};
|
|
|
this.goodsoptions.forEach(async e => {
|
|
|
if (e.id == row.itemId) {
|
|
|
+ getMarketPrice({code: e.code,isFreight: 0, isLabel: 0}).then(response => {
|
|
|
+ if (response.data.data.length > 0) {
|
|
|
+ this.$set(e, 'price', response.data.data[0].salePrice)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'price', '0')
|
|
|
+ }
|
|
|
+ this.$set(row, 'amount', (Number(e.price) * Number(row.orderQuantity)).toFixed(2))
|
|
|
+ })
|
|
|
+ let historyData = await this.getHistoryData(e, 1); // 获得最新数据
|
|
|
+ if (historyData.length > 0) {
|
|
|
+ e.newJob = historyData[0].price;
|
|
|
+ e.newDate = historyData[0].businesDate;
|
|
|
+ } else {
|
|
|
+ e.newJob = null;
|
|
|
+ e.newDate = null;
|
|
|
+ }
|
|
|
if (e.batch == 0) {
|
|
|
form = await this.getStockInfo({
|
|
|
tradeType: 'JXS',
|
|
@@ -1263,6 +1371,9 @@ export default {
|
|
|
row.priceCategory = e.goodsTypeName;
|
|
|
row.purchaseAmount = e.purchaseAmount;
|
|
|
row.batch = e.batch;
|
|
|
+ row.newDate = e.newDate;
|
|
|
+ row.newJob = e.newJob;
|
|
|
+ row.price = e.price;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1330,6 +1441,7 @@ export default {
|
|
|
cname: e.cname,
|
|
|
price: e.price,
|
|
|
quantity: e.orderQuantity,
|
|
|
+ unit: e.unit,
|
|
|
}
|
|
|
this.applyPaymentList.push(form);
|
|
|
})
|
|
@@ -1428,6 +1540,40 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 获得历史数据
|
|
|
+ async getHistoryData(row, typeId = null) {
|
|
|
+ let data;
|
|
|
+ const params = {
|
|
|
+ typeId,
|
|
|
+ tradeType: 'JXS',
|
|
|
+ billType: 'XS',
|
|
|
+ itemId: row.id
|
|
|
+ }
|
|
|
+ await historyPrice(params).then(res => {
|
|
|
+ data = res.data.data? res.data.data: [];
|
|
|
+ })
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ openHistory(row) {
|
|
|
+ this.historyParams = {
|
|
|
+ tradeType: 'JXS',
|
|
|
+ billType: 'XS',
|
|
|
+ itemId: row.itemId
|
|
|
+ }
|
|
|
+ this.historyVisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.history.init();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeDialog() {
|
|
|
+ this.historyVisible = false;
|
|
|
+ },
|
|
|
+ // 销售金额获取
|
|
|
+ async getMarketPrice(row) {
|
|
|
+ await getMarketPrice({code: row.code}).then(res => {
|
|
|
+ this.salesPriceOtion = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|