|
@@ -4,7 +4,10 @@
|
|
@onDispatch="onDispatch" @onRefresh="onRefresh" @detail="openEdit" @onSave="onSave" @clickTab="clickTab"
|
|
@onDispatch="onDispatch" @onRefresh="onRefresh" @detail="openEdit" @onSave="onSave" @clickTab="clickTab"
|
|
@onChangeRow="onChangeRow" @pagination="pagination">
|
|
@onChangeRow="onChangeRow" @pagination="pagination">
|
|
</by-bill>
|
|
</by-bill>
|
|
|
|
+ <!-- 选择物料 -->
|
|
<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
|
|
<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
|
|
|
|
+ <!-- 选择机构名称 -->
|
|
|
|
+ <!-- <supplierModal /> -->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -13,10 +16,11 @@
|
|
import api from "@/api/order";
|
|
import api from "@/api/order";
|
|
import Assembly from "@/components/Assembly/order.vue";
|
|
import Assembly from "@/components/Assembly/order.vue";
|
|
import productModal from "./components/productModal.vue";
|
|
import productModal from "./components/productModal.vue";
|
|
- @Component({ components: { productModal } })
|
|
|
|
|
|
+ import Focus from "./components/focus.vue";
|
|
|
|
+ @Component({ components: { productModal,Focus } })
|
|
export default class OrderTask extends Vue {
|
|
export default class OrderTask extends Vue {
|
|
// 左边
|
|
// 左边
|
|
- tabType : any = 'all';
|
|
|
|
|
|
+ tabType : any = 'bill';
|
|
isAdd : any = false
|
|
isAdd : any = false
|
|
// 右边
|
|
// 右边
|
|
tableData : any = []
|
|
tableData : any = []
|
|
@@ -26,7 +30,7 @@
|
|
timer : any = null
|
|
timer : any = null
|
|
config : any = {
|
|
config : any = {
|
|
attr: {
|
|
attr: {
|
|
- activeName: 'all'
|
|
|
|
|
|
+ activeName: 'bill'
|
|
},
|
|
},
|
|
// 单据
|
|
// 单据
|
|
bill: {
|
|
bill: {
|
|
@@ -52,15 +56,15 @@
|
|
[
|
|
[
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
|
|
+ label: '单据编号',
|
|
|
|
+ prop: 'orderNumber',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
- label: '单据编号',
|
|
|
|
- prop: 'orderNumber',
|
|
|
|
- component: 'by-input',
|
|
|
|
|
|
+ label: '机构名称',
|
|
|
|
+ prop: 'organizationName',
|
|
|
|
+ component: Focus,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
@@ -166,6 +170,7 @@
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
size: 'mini',
|
|
size: 'mini',
|
|
|
|
+ type: 'number',
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -183,7 +188,7 @@
|
|
attr: {
|
|
attr: {
|
|
size: 'mini',
|
|
size: 'mini',
|
|
type: 'number',
|
|
type: 'number',
|
|
- defaultValue: 0,
|
|
|
|
|
|
+ defaultValue: '0',
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -203,7 +208,6 @@
|
|
event: {
|
|
event: {
|
|
click: (item : any) => {
|
|
click: (item : any) => {
|
|
(this as any).changeTable(item)
|
|
(this as any).changeTable(item)
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}]
|
|
}]
|
|
@@ -223,27 +227,27 @@
|
|
[
|
|
[
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
|
|
+ label: '单据编号',
|
|
|
|
+ prop: 'orderNumber',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入机构名称',
|
|
|
|
|
|
+ placeholder: '请输入单据编号',
|
|
clearable: true
|
|
clearable: true
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '单据编号',
|
|
|
|
- prop: 'orderNumber',
|
|
|
|
|
|
+ label: '机构名称',
|
|
|
|
+ prop: 'organizationName',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入单据编号',
|
|
|
|
|
|
+ placeholder: '请输入机构名称',
|
|
clearable: true
|
|
clearable: true
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
@@ -294,15 +298,15 @@
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
- width: 200,
|
|
|
|
- title: '机构名称',
|
|
|
|
- field: 'organizationName',
|
|
|
|
|
|
+ width: 168,
|
|
|
|
+ title: '单据编号',
|
|
|
|
+ field: 'orderNumber',
|
|
isDetail: true,
|
|
isDetail: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: 150,
|
|
|
|
- title: '单据编号',
|
|
|
|
- field: 'orderNumber',
|
|
|
|
|
|
+ width: 180,
|
|
|
|
+ title: '机构名称',
|
|
|
|
+ field: 'organizationName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
width: 80,
|
|
width: 80,
|
|
@@ -368,27 +372,27 @@
|
|
[
|
|
[
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
|
|
+ label: '单据编号',
|
|
|
|
+ prop: 'orderNumber',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入机构名称',
|
|
|
|
|
|
+ placeholder: '请输入单据编号',
|
|
clearable: true
|
|
clearable: true
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '单据编号',
|
|
|
|
- prop: 'orderNumber',
|
|
|
|
|
|
+ label: '机构名称',
|
|
|
|
+ prop: 'organizationName',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入单据编号',
|
|
|
|
|
|
+ placeholder: '请输入机构名称',
|
|
clearable: true
|
|
clearable: true
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
@@ -440,15 +444,15 @@
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
- width: 200,
|
|
|
|
- title: '机构名称',
|
|
|
|
- field: 'organizationName',
|
|
|
|
|
|
+ width: 168,
|
|
|
|
+ title: '单据编号',
|
|
|
|
+ field: 'orderNumber',
|
|
isDetail: true,
|
|
isDetail: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: 150,
|
|
|
|
- title: '单据编号',
|
|
|
|
- field: 'orderNumber',
|
|
|
|
|
|
+ width: 180,
|
|
|
|
+ title: '机构名称',
|
|
|
|
+ field: 'organizationName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
width: 80,
|
|
width: 80,
|
|
@@ -514,27 +518,27 @@
|
|
[
|
|
[
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
|
|
+ label: '单据编号',
|
|
|
|
+ prop: 'orderNumber',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入机构名称',
|
|
|
|
|
|
+ placeholder: '请输入单据编号',
|
|
clearable: true
|
|
clearable: true
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '单据编号',
|
|
|
|
- prop: 'orderNumber',
|
|
|
|
|
|
+ label: '机构名称',
|
|
|
|
+ prop: 'organizationName',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入单据编号',
|
|
|
|
|
|
+ placeholder: '请输入机构名称',
|
|
clearable: true
|
|
clearable: true
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
@@ -587,15 +591,15 @@
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
- width: 200,
|
|
|
|
- title: '机构名称',
|
|
|
|
- field: 'organizationName',
|
|
|
|
|
|
+ width: 168,
|
|
|
|
+ title: '单据编号',
|
|
|
|
+ field: 'orderNumber',
|
|
isDetail: true,
|
|
isDetail: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: 150,
|
|
|
|
- title: '单据编号',
|
|
|
|
- field: 'orderNumber',
|
|
|
|
|
|
+ width: 180,
|
|
|
|
+ title: '机构名称',
|
|
|
|
+ field: 'organizationName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
width: 80,
|
|
width: 80,
|
|
@@ -661,27 +665,27 @@
|
|
[
|
|
[
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
|
|
+ label: '单据编号',
|
|
|
|
+ prop: 'orderNumber',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入机构名称',
|
|
|
|
|
|
+ placeholder: '请输入单据编号',
|
|
clearable: true
|
|
clearable: true
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
- label: '单据编号',
|
|
|
|
- prop: 'orderNumber',
|
|
|
|
|
|
+ label: '机构名称',
|
|
|
|
+ prop: 'organizationName',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入单据编号',
|
|
|
|
|
|
+ placeholder: '请输入机构名称',
|
|
clearable: true
|
|
clearable: true
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
@@ -731,15 +735,15 @@
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
- width: 200,
|
|
|
|
- title: '机构名称',
|
|
|
|
- field: 'organizationName',
|
|
|
|
|
|
+ width: 168,
|
|
|
|
+ title: '单据编号',
|
|
|
|
+ field: 'orderNumber',
|
|
isDetail: true,
|
|
isDetail: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: 150,
|
|
|
|
- title: '单据编号',
|
|
|
|
- field: 'orderNumber',
|
|
|
|
|
|
+ width: 180,
|
|
|
|
+ title: '机构名称',
|
|
|
|
+ field: 'organizationName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
width: 80,
|
|
width: 80,
|
|
@@ -797,11 +801,39 @@
|
|
this.getDataList()
|
|
this.getDataList()
|
|
}, 500)
|
|
}, 500)
|
|
}
|
|
}
|
|
|
|
+ getFocus(e:any){
|
|
|
|
+ console.log(e);
|
|
|
|
+ }
|
|
// 监听表格数据变化
|
|
// 监听表格数据变化
|
|
onChangeRow(e : any) {
|
|
onChangeRow(e : any) {
|
|
e.realityPrice = e.number * e.unitPrice;
|
|
e.realityPrice = e.number * e.unitPrice;
|
|
e.totalPrice = e.realityPrice - e.prePrice;
|
|
e.totalPrice = e.realityPrice - e.prePrice;
|
|
}
|
|
}
|
|
|
|
+ // 确定商品新增
|
|
|
|
+ confirmProduct(e : any) {
|
|
|
|
+ let contents = '', goodsData = e;
|
|
|
|
+ goodsData = goodsData.map((item : any) => {
|
|
|
|
+ item.materialName = item.skuTitle
|
|
|
|
+ item.prePrice = 0
|
|
|
|
+ // item.materialId = item.materialId
|
|
|
|
+ item.unitPrice = item.price
|
|
|
|
+ item.materialSku = item.id
|
|
|
|
+ const { id, ...newData } = item
|
|
|
|
+ // const { skuTitle, price, id, materialId, ...newData } = item
|
|
|
|
+ return newData
|
|
|
|
+ })
|
|
|
|
+ this.tableData = this.tableData.concat(goodsData);
|
|
|
|
+ console.log('this.tableData ==> ', this.tableData);
|
|
|
|
+ this.tableData.map((v : any, i : any) => {
|
|
|
|
+ v.dataIndex = i
|
|
|
|
+ });
|
|
|
|
+ if (contents) {
|
|
|
|
+ this.$alert('商品id' + contents + '已存在!', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
|
+ }
|
|
// 保存
|
|
// 保存
|
|
onSave(e : any) {
|
|
onSave(e : any) {
|
|
console.log('保存 ==>', this.tabType);
|
|
console.log('保存 ==>', this.tabType);
|
|
@@ -820,6 +852,7 @@
|
|
v.splice(i, 1)
|
|
v.splice(i, 1)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
if (this.isAdd) {
|
|
if (this.isAdd) {
|
|
query.submitState = 0
|
|
query.submitState = 0
|
|
console.log('保存进草稿箱 ==>', query);
|
|
console.log('保存进草稿箱 ==>', query);
|
|
@@ -848,29 +881,6 @@
|
|
})
|
|
})
|
|
|
|
|
|
}
|
|
}
|
|
- // 确定商品新增
|
|
|
|
- confirmProduct(e : any) {
|
|
|
|
- let contents = '', goodsData = e;
|
|
|
|
- goodsData = goodsData.map((item : any) => {
|
|
|
|
- item.materialName = item.skuTitle
|
|
|
|
- item.materialId = item.materialId
|
|
|
|
- item.unitPrice = item.price
|
|
|
|
- item.materialSku = item.id
|
|
|
|
- const { skuTitle, price, id, materialId, ...newData } = item
|
|
|
|
- return newData
|
|
|
|
- })
|
|
|
|
- this.tableData = this.tableData.concat(goodsData);
|
|
|
|
- this.tableData.map((v : any, i : any) => {
|
|
|
|
- v.dataIndex = i
|
|
|
|
- });
|
|
|
|
- if (contents) {
|
|
|
|
- this.$alert('商品id' + contents + '已存在!', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- });
|
|
|
|
- };
|
|
|
|
- console.log('this.tableData ==> ', this.tableData);
|
|
|
|
- (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
|
- }
|
|
|
|
// 打开新增
|
|
// 打开新增
|
|
onAdd(e : any) {
|
|
onAdd(e : any) {
|
|
console.log('新增 ==>', e);
|
|
console.log('新增 ==>', e);
|
|
@@ -884,7 +894,11 @@
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
billConfig.tool.tools = { save: true, };
|
|
billConfig.tool.tools = { save: true, };
|
|
- if (e === 'all') billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
|
|
+ if (e === 'all') {
|
|
|
|
+ billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
+ this.tableData = [];
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
|
+ }
|
|
billConfig.tableConfig[0].tool.tools = { add: true };
|
|
billConfig.tableConfig[0].tool.tools = { add: true };
|
|
this.isAdd = true;
|
|
this.isAdd = true;
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
@@ -905,6 +919,7 @@
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
billConfig.tool.tools = { save: true, };
|
|
billConfig.tool.tools = { save: true, };
|
|
|
|
+ if (this.tabType === 'draftsBox') billConfig.tool.tools = { save: true, smt: true };
|
|
billConfig.tableConfig[0].tool.tools = { add: true };
|
|
billConfig.tableConfig[0].tool.tools = { add: true };
|
|
this.tableData = data;
|
|
this.tableData = data;
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
@@ -921,7 +936,9 @@
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
readonly.tool.tools = {};
|
|
readonly.tool.tools = {};
|
|
|
|
+ readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
readonly.tableConfig[0].tool.tools = {};
|
|
readonly.tableConfig[0].tool.tools = {};
|
|
|
|
+ console.log(readonly.tableConfig[0].table.columns.slice(0, -1));
|
|
let data = e.suborderList;
|
|
let data = e.suborderList;
|
|
(this.$refs.bill as any).setBillConfig(readonly);
|
|
(this.$refs.bill as any).setBillConfig(readonly);
|
|
(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
@@ -937,29 +954,29 @@
|
|
// 提交
|
|
// 提交
|
|
onSmt(e : any) {
|
|
onSmt(e : any) {
|
|
console.log('提交 ==>', e);
|
|
console.log('提交 ==>', e);
|
|
- // (this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
|
|
- // let query = (this as any).$refs.bill.$refs.billForm.getValue();
|
|
|
|
- // api.saveList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
|
- // if (res.code === 200) {
|
|
|
|
- // this.$message({
|
|
|
|
- // type: 'success',
|
|
|
|
- // message: '提交成功!'
|
|
|
|
- // });
|
|
|
|
- // this.getDataList();
|
|
|
|
- // (this.$refs.bill as any).showTab = 'all';
|
|
|
|
- // (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
- // } else this.failHandle(res)
|
|
|
|
- // })
|
|
|
|
- // })
|
|
|
|
|
|
+ (this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
|
|
+ let query = (this as any).$refs.bill.$refs.billForm.getValue();
|
|
|
|
+ if (this.tabType === 'all') {
|
|
|
|
+ // api.saveList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
|
+ // if (res.code === 200) {
|
|
|
|
+ // this.$message.success('提交成功');
|
|
|
|
+ // this.getDataList();
|
|
|
|
+ // (this.$refs.bill as any).showTab = 'all';
|
|
|
|
+ // (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
+ // } else this.failHandle(res)
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
// 切换tab栏
|
|
// 切换tab栏
|
|
clickTab(e : any) {
|
|
clickTab(e : any) {
|
|
console.log('切换tab ==> ', e);
|
|
console.log('切换tab ==> ', e);
|
|
this.tabType = e;
|
|
this.tabType = e;
|
|
// submitState: 提交状态
|
|
// submitState: 提交状态
|
|
|
|
+ if (e === 'all') this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 草稿箱数据
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
- if (e === 'recycleBin') this.getSelectDeleteList('supplyTaskOrder'); // 回收站数据
|
|
|
|
|
|
+ if (e === 'recycleBin') this.getSelectDeleteList({ pageNo: 1, pageSize: 10 }); // 回收站数据
|
|
}
|
|
}
|
|
// 初始化
|
|
// 初始化
|
|
getDataList() {
|
|
getDataList() {
|
|
@@ -971,21 +988,32 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
- this.getPageList({pageSize:10,pageNo:1}, 'all'); // 综合数据
|
|
|
|
|
|
+ this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 综合数据
|
|
}
|
|
}
|
|
// 分页
|
|
// 分页
|
|
- pagination(e:any){
|
|
|
|
|
|
+ pagination(e : any) {
|
|
|
|
+ console.log('分页 ==> ', e);
|
|
let query = {
|
|
let query = {
|
|
- pageNo:e.page.pageNum,
|
|
|
|
- pageSize:e.page.pageSize,
|
|
|
|
|
|
+ pageNo: e.page.pageNum,
|
|
|
|
+ pageSize: e.page.pageSize,
|
|
};
|
|
};
|
|
- let loading = this.$loading({ target: '.main-container' })
|
|
|
|
- api.pageList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- (this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
|
|
|
|
- loading.close()
|
|
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ if (e.type === 'recycleBin') {
|
|
|
|
+ api.selectDeleteList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
|
|
+ loading.close()
|
|
|
|
+ } else this.failHandle(res)
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ api.pageList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
|
|
|
|
+ loading.close()
|
|
|
|
+ } else this.failHandle(res)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
// 获取分页数据
|
|
// 获取分页数据
|
|
getPageList(query : any, type : any) {
|
|
getPageList(query : any, type : any) {
|
|
@@ -1002,10 +1030,10 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
// 回收站数据
|
|
// 回收站数据
|
|
- getSelectDeleteList(url : any) {
|
|
|
|
- api.selectDeleteList(url).then((res : any) => {
|
|
|
|
|
|
+ getSelectDeleteList(query : any) {
|
|
|
|
+ api.selectDeleteList(query, 'supplyTaskOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- (this.$refs.bill as any).setTabTableValue('recycleBin', res.data);
|
|
|
|
|
|
+ (this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
|
|
let page = {
|
|
let page = {
|
|
pageNo: res.data.current, //当前页
|
|
pageNo: res.data.current, //当前页
|
|
pageSize: res.data.size, //每页条数
|
|
pageSize: res.data.size, //每页条数
|
|
@@ -1030,7 +1058,7 @@
|
|
if (e === 'all') this.getPageList({}, 'all'); // 综合查询
|
|
if (e === 'all') this.getPageList({}, 'all'); // 综合查询
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
- if (e === 'recycleBin') this.getSelectDeleteList('supplyTaskOrder') // 回收站数据
|
|
|
|
|
|
+ if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
}
|
|
}
|
|
// 单据表格删除
|
|
// 单据表格删除
|
|
changeTable(item : any) {
|
|
changeTable(item : any) {
|
|
@@ -1045,16 +1073,8 @@
|
|
console.log('原表格数据 ==> ', this.tableData);
|
|
console.log('原表格数据 ==> ', this.tableData);
|
|
console.log('新表格数据 ==> ', newData);
|
|
console.log('新表格数据 ==> ', newData);
|
|
(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '删除成功!'
|
|
|
|
- });
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: '已取消删除'
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
+ }).catch(() => this.$message.info('已取消删除'));
|
|
}
|
|
}
|
|
// 工具栏删除
|
|
// 工具栏删除
|
|
onDelete(e : any) {
|
|
onDelete(e : any) {
|
|
@@ -1075,7 +1095,8 @@
|
|
}).then(() => {
|
|
}).then(() => {
|
|
api.deleteList({ ids: ids }, 'supplyTaskOrder').then((res : any) => {
|
|
api.deleteList({ ids: ids }, 'supplyTaskOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.getDataList();
|
|
|
|
|
|
+ // this.getDataList();
|
|
|
|
+ this.clickTab(this.tabType);
|
|
this.$message.success('删除成功!');
|
|
this.$message.success('删除成功!');
|
|
} else this.failHandle(res)
|
|
} else this.failHandle(res)
|
|
})
|
|
})
|
|
@@ -1092,7 +1113,8 @@
|
|
}).then(() => {
|
|
}).then(() => {
|
|
api.deleteList({ ids: item.id }, 'supplyTaskOrder').then((res : any) => {
|
|
api.deleteList({ ids: item.id }, 'supplyTaskOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.getDataList();
|
|
|
|
|
|
+ // this.getDataList();
|
|
|
|
+ this.clickTab(this.tabType);
|
|
this.$message.success('删除成功!');
|
|
this.$message.success('删除成功!');
|
|
} else this.failHandle(res)
|
|
} else this.failHandle(res)
|
|
})
|
|
})
|