|
|
@@ -1,15 +1,29 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<basic-container v-show="!detailsOpen">
|
|
|
- <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
|
|
|
- ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange" @row-del="rowDel"
|
|
|
- @expand-change="expandChange" @refresh-change="refreshChange"
|
|
|
+ <avue-crud
|
|
|
+ :option="option"
|
|
|
+ :search.sync="search"
|
|
|
+ v-model="form"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="dataList"
|
|
|
+ ref="crud"
|
|
|
+ :key="key"
|
|
|
+ @on-load="onLoad"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @row-del="rowDel"
|
|
|
+ @expand-change="expandChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
@resetColumn="resetColumnTwo('crud', 'option', 'optionList', 351)"
|
|
|
- @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 351)" :page.sync="page">
|
|
|
- <template slot-scope="{type,size,row,index}" slot="menu">
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 351)"
|
|
|
+ :page.sync="page"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ type, size, row, index }" slot="menu">
|
|
|
<!-- <el-button :size="size" :type="type" @click="check(row)">查看</el-button> -->
|
|
|
- <el-button :size="size" :type="type" :disabled="row.status != '录入' || row.numberRows != 0"
|
|
|
- @click="$refs.crud.rowDel(row, index)">删除</el-button>
|
|
|
+ <el-button :size="size" :type="type" :disabled="row.status != '录入' || row.numberRows != 0" @click="$refs.crud.rowDel(row, index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" size="small" :disabled="row.generateTask != '未生成'" @click="voided(row, index)">单据作废</el-button>
|
|
|
</template>
|
|
|
<template slot="corpNameSearch">
|
|
|
<crop-select v-model="search.corpId" corpType="GYS" :refresh="false"></crop-select>
|
|
|
@@ -17,28 +31,26 @@
|
|
|
<template slot="notCompleteSearch">
|
|
|
<el-checkbox v-model="search.notComplete" true-label="1"></el-checkbox>
|
|
|
</template>
|
|
|
- <template slot-scope="{type,size,row,$index}" slot="menuLeft">
|
|
|
+ <template slot-scope="{ type, size, row, $index }" slot="menuLeft">
|
|
|
<!-- <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新建订单</el-button> -->
|
|
|
<el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="ordNo">
|
|
|
- <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }}
|
|
|
- </span>
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }} </span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="srcOrdNo">
|
|
|
- <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }}
|
|
|
- </span>
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }} </span>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
- <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData" @backToList="backToList">
|
|
|
- </detailsPage>
|
|
|
+ <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData" @backToList="backToList"> </detailsPage>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { voidedDocument } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
import { getList, remove, getGoodsInfo } from "@/api/tirePartsMall/salesService/saleOrder";
|
|
|
-import detailsPage from "./detailsPage"
|
|
|
+import detailsPage from "./detailsPage";
|
|
|
import { getDetails } from "@/api/tirePartsMall/salesService/saleOrder";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
|
|
|
@@ -77,7 +89,7 @@ export default {
|
|
|
searchMenuPosition: "right",
|
|
|
align: "center",
|
|
|
size: "small",
|
|
|
- menuWidth: 50,
|
|
|
+ menuWidth: 120,
|
|
|
searchSpan: 6,
|
|
|
searchMenuSpan: 6,
|
|
|
searchIcon: true,
|
|
|
@@ -86,45 +98,49 @@ export default {
|
|
|
searchIndex: 3,
|
|
|
highlightCurrentRow: true,
|
|
|
dialogWidth: "70%",
|
|
|
- summaryText:this.$t("land118n.total"),
|
|
|
+ summaryText: this.$t("land118n.total"),
|
|
|
showSummary: true,
|
|
|
- sumColumnList: [{
|
|
|
- name: 'goodsTotalNum',
|
|
|
- type: 'sum',
|
|
|
- decimals: 0
|
|
|
- }, {
|
|
|
- name: 'totalMoney',
|
|
|
- type: 'sum',
|
|
|
- }, {
|
|
|
- name: 'returnsAmount',
|
|
|
- type: 'sum',
|
|
|
- }],
|
|
|
+ sumColumnList: [
|
|
|
+ {
|
|
|
+ name: "goodsTotalNum",
|
|
|
+ type: "sum",
|
|
|
+ decimals: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "totalMoney",
|
|
|
+ type: "sum"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "returnsAmount",
|
|
|
+ type: "sum"
|
|
|
+ }
|
|
|
+ ],
|
|
|
column: [
|
|
|
{
|
|
|
- label: '业务编号',
|
|
|
+ label: "业务编号",
|
|
|
prop: "ordNo",
|
|
|
search: true,
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '往来单位',
|
|
|
+ label: "往来单位",
|
|
|
prop: "customerName",
|
|
|
search: true,
|
|
|
overHidden: true,
|
|
|
- type: 'select',
|
|
|
+ type: "select",
|
|
|
filterable: true,
|
|
|
- width:140,
|
|
|
+ width: 140,
|
|
|
remote: true,
|
|
|
props: {
|
|
|
- label: 'cname',
|
|
|
- value: 'cname',
|
|
|
- res: 'data.records'
|
|
|
+ label: "cname",
|
|
|
+ value: "cname",
|
|
|
+ res: "data.records"
|
|
|
},
|
|
|
- dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=GYS&cname={{key}}',
|
|
|
+ dicUrl: "/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=GYS&cname={{key}}"
|
|
|
},
|
|
|
{
|
|
|
- label: '显示已完成',
|
|
|
- prop: 'notComplete',
|
|
|
+ label: "显示已完成",
|
|
|
+ prop: "notComplete",
|
|
|
overHidden: true,
|
|
|
hide: true,
|
|
|
search: true,
|
|
|
@@ -149,71 +165,71 @@ export default {
|
|
|
// }]
|
|
|
// },
|
|
|
{
|
|
|
- label: '仓库',
|
|
|
+ label: "仓库",
|
|
|
prop: "storageName",
|
|
|
search: true,
|
|
|
overHidden: true,
|
|
|
// remote: true,
|
|
|
- type: 'select',
|
|
|
+ type: "select",
|
|
|
props: {
|
|
|
- label: 'cname',
|
|
|
- value: 'cname'
|
|
|
+ label: "cname",
|
|
|
+ value: "cname"
|
|
|
},
|
|
|
- dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
|
|
|
+ dicUrl: "/api/blade-sales-part/storageDesc/listAll?cname={{key}}"
|
|
|
},
|
|
|
{
|
|
|
- label: '行数',
|
|
|
+ label: "行数",
|
|
|
prop: "numberRows",
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '商品名称',
|
|
|
+ label: "商品名称",
|
|
|
prop: "goodsNameJoin",
|
|
|
search: true,
|
|
|
overHidden: true,
|
|
|
filterable: true,
|
|
|
remote: true,
|
|
|
- type: 'select',
|
|
|
+ type: "select",
|
|
|
props: {
|
|
|
- label: 'cname',
|
|
|
- value: 'cname',
|
|
|
- res: 'data.records'
|
|
|
+ label: "cname",
|
|
|
+ value: "cname",
|
|
|
+ res: "data.records"
|
|
|
},
|
|
|
dicUrl: "/api/blade-sales-part/goodsDesc/list?current=1&size=20&cname={{key}}"
|
|
|
},
|
|
|
{
|
|
|
- label: '数量',
|
|
|
+ label: "数量",
|
|
|
prop: "goodsTotalNum",
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '退货数量',
|
|
|
+ label: "退货数量",
|
|
|
prop: "returnsNumber",
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '金额',
|
|
|
+ label: "金额",
|
|
|
prop: "totalMoney",
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '退货金额',
|
|
|
+ label: "退货金额",
|
|
|
prop: "returnsAmount",
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '采购单号',
|
|
|
+ label: "采购单号",
|
|
|
prop: "srcNo",
|
|
|
search: true,
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '状态',
|
|
|
+ label: "状态",
|
|
|
prop: "status",
|
|
|
- overHidden: true,
|
|
|
+ overHidden: true
|
|
|
},
|
|
|
{
|
|
|
- label: '业务日期',
|
|
|
+ label: "业务日期",
|
|
|
prop: "businesDate",
|
|
|
searchProp: "businesDateList",
|
|
|
type: "date",
|
|
|
@@ -250,7 +266,7 @@ export default {
|
|
|
props: {
|
|
|
label: "account",
|
|
|
value: "account",
|
|
|
- res: 'data.records'
|
|
|
+ res: "data.records"
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -264,7 +280,7 @@ export default {
|
|
|
searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd HH:mm:ss"
|
|
|
- },
|
|
|
+ }
|
|
|
// {
|
|
|
// label: "原业务日期",
|
|
|
// prop: "oldBusinesDate",
|
|
|
@@ -282,7 +298,7 @@ export default {
|
|
|
// },
|
|
|
]
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
activated() {
|
|
|
setTimeout(() => {
|
|
|
@@ -291,7 +307,7 @@ export default {
|
|
|
this.detailsOpen = true;
|
|
|
}
|
|
|
if (this.$route.query.check) {
|
|
|
- this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
|
|
|
+ this.editOpen({ id: this.$route.query.check.srcBillId }, 1);
|
|
|
this.$store.commit("CGTH_IN_DETAIL");
|
|
|
this.detailData = {
|
|
|
id: this.$route.query.check.billId,
|
|
|
@@ -299,76 +315,88 @@ export default {
|
|
|
auditId: this.$route.query.check.id
|
|
|
};
|
|
|
}
|
|
|
- if (this.$route.query.type == 'S') {
|
|
|
- this.editOpen({ id: this.$route.query.detail.srcParentId }, 1)
|
|
|
+ if (this.$route.query.type == "S") {
|
|
|
+ this.editOpen({ id: this.$route.query.detail.srcParentId }, 1);
|
|
|
}
|
|
|
if (this.$route.query.jumpId) {
|
|
|
- this.editOpen({ id: this.$route.query.jumpId }, 1)
|
|
|
+ this.editOpen({ id: this.$route.query.jumpId }, 1);
|
|
|
}
|
|
|
- if (this.$route.query.bsType == 'TKCG') {
|
|
|
+ if (this.$route.query.bsType == "TKCG") {
|
|
|
this.$store.commit("CGTH_IN_DETAIL");
|
|
|
- this.editOpen({ id: this.$route.query.id }, 1)
|
|
|
+ this.editOpen({ id: this.$route.query.id }, 1);
|
|
|
}
|
|
|
}, 100);
|
|
|
},
|
|
|
async created() {
|
|
|
this.option = await this.getColumnData(this.getColumnName(351), this.optionList);
|
|
|
- this.key++
|
|
|
+ this.key++;
|
|
|
let i = 0;
|
|
|
this.option.column.forEach(item => {
|
|
|
- if (item.search) i++
|
|
|
- })
|
|
|
+ if (item.search) i++;
|
|
|
+ });
|
|
|
// if (i % 3 !== 0) {
|
|
|
// const num = 3 - Number(i % 3)
|
|
|
// this.option.searchMenuSpan = num * 8;
|
|
|
// this.option.searchMenuPosition = "right";
|
|
|
// }
|
|
|
this.getWorkDicts("sales_Status").then(res => {
|
|
|
- this.orderStatusList = res.data.data
|
|
|
+ this.orderStatusList = res.data.data;
|
|
|
console.log(this.orderStatusList);
|
|
|
});
|
|
|
this.getWorkDicts("settlement_Status").then(res => {
|
|
|
- this.actualStatusList = res.data.data
|
|
|
+ this.actualStatusList = res.data.data;
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ voided(row) {
|
|
|
+ this.$confirm("是否继续操作?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ voidedDocument({ id: row.id }).then(res => {
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
// 导出
|
|
|
outExport() {
|
|
|
- console.log(this.search, 412)
|
|
|
- let config = { params: { ...this.search } }
|
|
|
+ console.log(this.search, 412);
|
|
|
+ let config = { params: { ...this.search } };
|
|
|
if (config.params) {
|
|
|
for (const propName of Object.keys(config.params)) {
|
|
|
const value = config.params[propName];
|
|
|
- if (value !== null && typeof (value) !== "undefined") {
|
|
|
+ if (value !== null && typeof value !== "undefined") {
|
|
|
if (value instanceof Array) {
|
|
|
for (const key of Object.keys(value)) {
|
|
|
- let params = propName + '[' + key + ']';
|
|
|
- config.params[params] = value[key]
|
|
|
+ let params = propName + "[" + key + "]";
|
|
|
+ config.params[params] = value[key];
|
|
|
}
|
|
|
- delete config.params[propName]
|
|
|
+ delete config.params[propName];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(config, 427)
|
|
|
- config.params.bsType = 'TKCG'
|
|
|
+ console.log(config, 427);
|
|
|
+ config.params.bsType = "TKCG";
|
|
|
const routeData = this.$router.resolve({
|
|
|
- path: '/api/blade-sales-part/returns/listExport', //跳转目标下载地址
|
|
|
+ path: "/api/blade-sales-part/returns/listExport", //跳转目标下载地址
|
|
|
query: {
|
|
|
- ...config.params //括号内是要传递给新窗口的参数
|
|
|
+ ...config.params //括号内是要传递给新窗口的参数
|
|
|
}
|
|
|
- })
|
|
|
- window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
|
|
|
+ });
|
|
|
+ window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
|
|
|
},
|
|
|
check(row) {
|
|
|
- this.form = row
|
|
|
- this.detailsOpen = true
|
|
|
+ this.form = row;
|
|
|
+ this.detailsOpen = true;
|
|
|
},
|
|
|
backToList(type) {
|
|
|
- this.form = {}
|
|
|
- this.detailsOpen = false
|
|
|
+ this.form = {};
|
|
|
+ this.detailsOpen = false;
|
|
|
if (type === 0) {
|
|
|
- this.detailData = {}
|
|
|
+ this.detailData = {};
|
|
|
}
|
|
|
if (this.$route.query.bsType) {
|
|
|
this.$router.$avueRouter.closeTag(this.$route.fullPath);
|
|
|
@@ -376,12 +404,11 @@ export default {
|
|
|
path: "/tirePartsMall/purchaseService/returns/index"
|
|
|
});
|
|
|
}
|
|
|
- this.onLoad(this.page, this.search)
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
this.$store.commit("CGTH_OUT_DETAIL");
|
|
|
-
|
|
|
},
|
|
|
editOpen(row, status) {
|
|
|
- this.form = row
|
|
|
+ this.form = row;
|
|
|
this.detailData = {
|
|
|
id: row.id,
|
|
|
status: status
|
|
|
@@ -391,7 +418,7 @@ export default {
|
|
|
},
|
|
|
//刷新
|
|
|
refreshChange() {
|
|
|
- this.onLoad(this.page, this.search)
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
},
|
|
|
expandChange(row) {
|
|
|
if (!row.itemData) {
|
|
|
@@ -405,26 +432,27 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
rowDel(form, index) {
|
|
|
- this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- remove({ ids: form.id }).then(res => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
+ this.$confirm("此操作将永久删除该行, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ remove({ ids: form.id }).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.dataList.splice(index, 1);
|
|
|
+ this.onLoad(this.page);
|
|
|
});
|
|
|
- this.dataList.splice(index, 1);
|
|
|
- this.onLoad(this.page)
|
|
|
})
|
|
|
- }).catch(() => {
|
|
|
- });
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
searchChange(params, done) {
|
|
|
- this.page.currentPage = 1
|
|
|
+ this.page.currentPage = 1;
|
|
|
done();
|
|
|
- this.onLoad(this.page, params)
|
|
|
+ this.onLoad(this.page, params);
|
|
|
},
|
|
|
onLoad(page, params = {}) {
|
|
|
params = {
|
|
|
@@ -433,27 +461,29 @@ export default {
|
|
|
size: page.pageSize,
|
|
|
bsType: "TKCG",
|
|
|
...Object.assign(params, this.search)
|
|
|
- }
|
|
|
- this.loading = true
|
|
|
+ };
|
|
|
+ this.loading = true;
|
|
|
this.dataList.forEach(item => {
|
|
|
this.$refs.crud.toggleRowExpansion(item, false);
|
|
|
});
|
|
|
- getList(params).then(res => {
|
|
|
- if (res.data.data.records) {
|
|
|
- res.data.data.records.forEach(e => {
|
|
|
- e.itemLoading = true;
|
|
|
+ getList(params)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.data.records) {
|
|
|
+ res.data.data.records.forEach(e => {
|
|
|
+ e.itemLoading = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.dataList = res.data.data.records;
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ this.$refs.crud.dicInit();
|
|
|
});
|
|
|
- }
|
|
|
- this.dataList = res.data.data.records
|
|
|
- this.page.total = res.data.data.total
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.crud.doLayout()
|
|
|
- this.$refs.crud.dicInit()
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
- this.loading = false
|
|
|
- }).finally(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
//自定义列保存
|
|
|
async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
@@ -479,7 +509,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|