|
@@ -85,6 +85,7 @@
|
|
|
<template slot="storageId">
|
|
|
<warehouse-select
|
|
|
v-model="form.storageId"
|
|
|
+ @returnBack="storageChange"
|
|
|
:configuration="configurationWarehouse"
|
|
|
:disabled="disabled || confirmDisabled"/>
|
|
|
</template>
|
|
@@ -129,8 +130,33 @@
|
|
|
icon="el-icon-printer"
|
|
|
size="small"
|
|
|
@click.stop="openReport"
|
|
|
- >报 表</el-button
|
|
|
+ >报 表</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="downloadHandle"
|
|
|
+ >下载模板</el-button>
|
|
|
+ <el-upload
|
|
|
+ :action="baseURL"
|
|
|
+ :headers="headers"
|
|
|
+ :disabled="disabled || confirmDisabled || !form.storageId"
|
|
|
+ :on-progress="uploading"
|
|
|
+ :show-file-list=false
|
|
|
+ :data="uploadParam"
|
|
|
+ accept=".xls,.xlsx"
|
|
|
+ multiple
|
|
|
+ :on-success="importTemplate"
|
|
|
+ :on-error="uploadError"
|
|
|
+ style="float: right"
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-upload"
|
|
|
+ :disabled="disabled || confirmDisabled || !form.storageId"
|
|
|
+ >导 入</el-button>
|
|
|
+ </el-upload>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<el-button
|
|
@@ -150,12 +176,40 @@
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
+ <template slot="code" slot-scope="{ row, index }">
|
|
|
+ <span v-if="row.$cellEdit" style="display:flex">
|
|
|
+ <el-select
|
|
|
+ v-model="row.code"
|
|
|
+ placeholder="请选择"
|
|
|
+ filterable
|
|
|
+ size="small"
|
|
|
+ style="width:60%"
|
|
|
+ @change="codeChange(row, index)"
|
|
|
+ :disabled="!form.storageId"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in goodsoptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.code"
|
|
|
+ :value="item.code"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="small"
|
|
|
+ @click="rePick(row, index)"
|
|
|
+ ></el-button>
|
|
|
+ </span>
|
|
|
+ <span v-else> {{ row.code }}</span>
|
|
|
+ </template>
|
|
|
<template slot="cname" slot-scope="{ row, index }">
|
|
|
<span v-if="row.$cellEdit" style="display:flex">
|
|
|
<el-select
|
|
|
v-model="row.itemId"
|
|
|
placeholder="请选择"
|
|
|
size="small"
|
|
|
+ filterable
|
|
|
style="width:60%"
|
|
|
@change="cnameChange(row, index)"
|
|
|
:disabled="!form.storageId"
|
|
@@ -174,7 +228,6 @@
|
|
|
@click="rePick(row, index)"
|
|
|
></el-button>
|
|
|
</span>
|
|
|
-
|
|
|
<span v-else> {{ row.cname }}</span>
|
|
|
</template>
|
|
|
<template slot="orderQuantity" slot-scope="{ row, index }">
|
|
@@ -414,6 +467,8 @@ import checkSchedule from "@/components/check/checkSchedule";
|
|
|
import billApplication from "@/components/bill/billApplication";
|
|
|
import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
|
|
|
import {getDetail} from "@/api/basicData/inventoryAccount";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import { getCurrentDate } from "@/util/date";
|
|
|
|
|
|
export default {
|
|
|
name: "detail",
|
|
@@ -503,7 +558,7 @@ export default {
|
|
|
span: 8,
|
|
|
},
|
|
|
{
|
|
|
- label: "经办人",
|
|
|
+ label: "业务员",
|
|
|
prop: "chargeMember",
|
|
|
span: 8,
|
|
|
},
|
|
@@ -656,6 +711,9 @@ export default {
|
|
|
financialAccountDialog:false,
|
|
|
feesOption: [],
|
|
|
unitOption: [],
|
|
|
+ baseURL: '/api/blade-purchase-sales/orderitems/importDealerOrder',
|
|
|
+ headers: { "Blade-Auth": 'Bearer ' + getToken()},
|
|
|
+ uploadParam: {},
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -683,6 +741,7 @@ export default {
|
|
|
feeList().then(res => {
|
|
|
this.feesOption = res.data.data.records
|
|
|
});
|
|
|
+ this.$set(this.form, 'businesDate', getCurrentDate());
|
|
|
this.$set(this.form, 'status', 0);
|
|
|
if (this.detailData.query) {
|
|
|
this.disabled = true;
|
|
@@ -725,6 +784,11 @@ export default {
|
|
|
dataDetail(id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
this.form.amount = Number(this.form.amount).toFixed(2);
|
|
|
+ if (this.form.storageId) {
|
|
|
+ this.uploadParam = {
|
|
|
+ storageId: this.form.storageId
|
|
|
+ }
|
|
|
+ }
|
|
|
this.confirmDisabled = this.form.status == 3? true: false;
|
|
|
if (this.confirmDisabled) {
|
|
|
this.option.column.map(e => {
|
|
@@ -1121,6 +1185,47 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ codeChange(row) {
|
|
|
+ let form = {};
|
|
|
+ this.goodsoptions.forEach(async e => {
|
|
|
+ if (e.code == row.code) {
|
|
|
+ if (e.batch == 0) {
|
|
|
+ form = await this.getStockInfo({
|
|
|
+ tradeType: 'JXS',
|
|
|
+ goodsId: e.id,
|
|
|
+ storageId: this.form.storageId,
|
|
|
+ })
|
|
|
+ e.storageQuantity = form.stock;
|
|
|
+ e.purchaseAmount = form.purchaseAmount;
|
|
|
+ e.arr = [];
|
|
|
+ } else {
|
|
|
+ e.storageQuantity = 0
|
|
|
+ e.purchaseAmount = 0;
|
|
|
+ e.arr = await this.getLotNo({
|
|
|
+ itemId: e.id,
|
|
|
+ storageId: this.form.storageId,
|
|
|
+ tradeType: 'JXS'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ row.itemId = e.id;
|
|
|
+ row.storageQuantity = e.storageQuantity;
|
|
|
+ row.cname = e.cname;
|
|
|
+ row.code = e.code;
|
|
|
+ row.corpId = e.corpId;
|
|
|
+ row.corpName = e.corpName;
|
|
|
+ row.brandItem = e.brandItem;
|
|
|
+ row.specsOne = e.specsOne;
|
|
|
+ row.specsTwo = e.specsTwo;
|
|
|
+ row.typeno = e.typeno;
|
|
|
+ row.unit = e.unit;
|
|
|
+ row.size = e.size;
|
|
|
+ row.arr = e.arr;
|
|
|
+ row.priceCategory = e.goodsTypeName;
|
|
|
+ row.purchaseAmount = e.purchaseAmount;
|
|
|
+ row.batch = e.batch;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
cnameChange(row) {
|
|
|
let form = {};
|
|
|
this.goodsoptions.forEach(async e => {
|
|
@@ -1222,7 +1327,9 @@ export default {
|
|
|
amount: e.amount,
|
|
|
costType: this.feesOption.find(item => item.cname == '货款')? this.feesOption.find(item => item.cname == '货款').id: null,
|
|
|
srcFeesId: e.id,
|
|
|
- cname: e.cname
|
|
|
+ cname: e.cname,
|
|
|
+ price: e.price,
|
|
|
+ quantity: e.orderQuantity,
|
|
|
}
|
|
|
this.applyPaymentList.push(form);
|
|
|
})
|
|
@@ -1270,6 +1377,57 @@ export default {
|
|
|
this.btnLoading = false;
|
|
|
})
|
|
|
},
|
|
|
+ // 下载模板
|
|
|
+ downloadHandle() {
|
|
|
+ this.$confirm('是否下载模板文件?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ window.open(
|
|
|
+ `/api/blade-purchase-sales/orderitems/exportDealerOrder?${
|
|
|
+ this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //文件上传时
|
|
|
+ uploading(event, file, fileList) {
|
|
|
+ this.openFullScreen(false, '文件正在解析中');
|
|
|
+ },
|
|
|
+ importTemplate(res, file) {
|
|
|
+ this.openFullScreen(true)
|
|
|
+ res.data.forEach(item => {
|
|
|
+ })
|
|
|
+ this.dataList = this.dataList.concat(res.data)
|
|
|
+ },
|
|
|
+ uploadError(err, file, fileList) {
|
|
|
+ this.openFullScreen(true)
|
|
|
+ this.$message.error(JSON.parse(err.message).msg)
|
|
|
+ },
|
|
|
+ //遮罩层
|
|
|
+ openFullScreen(res, text) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: text,
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ if (res === true) loading.close();
|
|
|
+ },
|
|
|
+ // 仓库选择
|
|
|
+ storageChange(value) {
|
|
|
+ if (this.form.storageId) {
|
|
|
+ this.uploadParam = {
|
|
|
+ storageId: value
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|