|
@@ -428,34 +428,34 @@
|
|
|
:size="size"
|
|
|
v-if="lineDisable"
|
|
|
@click="confirms"
|
|
|
+ :disabled="ids.length == 0"
|
|
|
>确认</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
:size="size"
|
|
|
v-if="lineDisable"
|
|
|
+ :disabled="ids.length == 0"
|
|
|
@click="cancels"
|
|
|
>取消</el-button
|
|
|
>
|
|
|
<!-- <el-button type="primary" :size="size" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
:size="size"
|
|
|
v-if="lineDisable"
|
|
|
+ :disabled="ids.length == 0"
|
|
|
@click="audits"
|
|
|
>审核</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
:size="size"
|
|
|
v-if="lineDisable"
|
|
|
+ :disabled="ids.length == 0"
|
|
|
@click="closeLine"
|
|
|
>行关闭</el-button
|
|
|
>
|
|
|
|
|
|
<el-button
|
|
|
:size="size"
|
|
|
- type="primary"
|
|
|
style="margin: 0 10px"
|
|
|
v-if="lineDisable"
|
|
|
@click="handleCommand"
|
|
@@ -1394,7 +1394,6 @@ export default {
|
|
|
this.expanded = !this.expanded;
|
|
|
},
|
|
|
editList() {
|
|
|
- console.log("Lists`````", this.tableList);
|
|
|
this.lineDisable = false;
|
|
|
},
|
|
|
cancelEdit() {
|
|
@@ -1402,14 +1401,11 @@ export default {
|
|
|
this.getList(this.queryParams);
|
|
|
},
|
|
|
saveList() {
|
|
|
- // console.log("记录", this.record);
|
|
|
// 对记录的数据进行去重
|
|
|
let newRecord = Array.from(new Set(this.record));
|
|
|
- // console.log("去重后的", newRecord);
|
|
|
let changeList = newRecord.map((i) => {
|
|
|
return this.tableList[i];
|
|
|
});
|
|
|
- // console.log('shuzu', changeList)
|
|
|
editSummaryList(changeList).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.record = [];
|
|
@@ -1420,29 +1416,21 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
confirms() {
|
|
|
- if (this.ids.length == 0) {
|
|
|
- this.$modal.notifyWarning("请选中至少一条数据");
|
|
|
- } else {
|
|
|
- confirmSummary(this.allSelection).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$modal.notifySuccess("确认成功");
|
|
|
- this.getList(this.queryParams);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ confirmSummary(this.allSelection).then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$modal.notifySuccess("确认成功");
|
|
|
+ this.getList(this.queryParams);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
cancels() {
|
|
|
- if (this.ids.length == 0) {
|
|
|
- this.$modal.notifyWarning("请选中至少一条数据");
|
|
|
- } else {
|
|
|
- let param = this.ids.join();
|
|
|
- cancelSummary(param).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$modal.notifySuccess("取消成功");
|
|
|
- this.getList(this.queryParams);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ let param = this.ids.join();
|
|
|
+ cancelSummary(param).then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$modal.notifySuccess("取消成功");
|
|
|
+ this.getList(this.queryParams);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
cancelAudit() {
|
|
|
if (this.ids.length == 0) {
|
|
@@ -1458,21 +1446,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
audits() {
|
|
|
- if (this.ids.length == 0) {
|
|
|
- this.$modal.notifyWarning("请选中至少一条数据");
|
|
|
- } else {
|
|
|
- let param = this.ids.join();
|
|
|
- auditSummary(param)
|
|
|
- .then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$modal.notifySuccess("审核成功");
|
|
|
- this.getList(this.queryParams);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
+ let param = this.ids.join();
|
|
|
+ auditSummary(param)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$modal.notifySuccess("审核成功");
|
|
|
this.getList(this.queryParams);
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.getList(this.queryParams);
|
|
|
+ });
|
|
|
},
|
|
|
// 行关闭
|
|
|
closeitem() {
|
|
@@ -1485,24 +1469,19 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
closeLine() {
|
|
|
- if (this.ids.length == 0) {
|
|
|
- this.$modal.notifyWarning("请选中至少一条数据");
|
|
|
+ let item = this.allSelection.some((item) => {
|
|
|
+ return item.demandNum >= 2;
|
|
|
+ });
|
|
|
+ if (item) {
|
|
|
+ this.$modal
|
|
|
+ .confirm("选中项有多个需求单位,是否确定关闭?")
|
|
|
+ .then(function () {})
|
|
|
+ .then(() => {
|
|
|
+ this.closeitem();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
} else {
|
|
|
- console.log("选中数组", this.allSelection);
|
|
|
- let item = this.allSelection.some((item) => {
|
|
|
- return item.demandNum >= 2;
|
|
|
- });
|
|
|
- if (item) {
|
|
|
- this.$modal
|
|
|
- .confirm("选中项有多个需求单位,是否确定关闭?")
|
|
|
- .then(function () {})
|
|
|
- .then(() => {
|
|
|
- this.closeitem();
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- } else {
|
|
|
- this.closeitem();
|
|
|
- }
|
|
|
+ this.closeitem();
|
|
|
}
|
|
|
},
|
|
|
// 搜索区参照选择
|
|
@@ -1544,7 +1523,6 @@ export default {
|
|
|
this.queryParams.purchaseOrg = selection[0].id;
|
|
|
}
|
|
|
if (this.referCondition.title == "明细采购员") {
|
|
|
- console.log("选择进了吗", this.tableList);
|
|
|
this.record.push(this.tableIndex);
|
|
|
this.tableList[this.tableIndex].buyer = selection[0].code;
|
|
|
this.tableList[this.tableIndex].buyerName = selection[0].name;
|
|
@@ -1577,11 +1555,9 @@ export default {
|
|
|
this.$refs.materialRefer.init();
|
|
|
},
|
|
|
selectMaterial(selection) {
|
|
|
- console.log("选择的物料", selection);
|
|
|
this.queryParams.materialCodeList = selection.map((item) => {
|
|
|
return item.code;
|
|
|
});
|
|
|
- console.log(this.queryParams.materialCodeList);
|
|
|
this.queryParams.names = selection
|
|
|
.map((item) => {
|
|
|
return item.name;
|
|
@@ -1598,7 +1574,6 @@ export default {
|
|
|
this.$modal.loading("正在粘贴数据...");
|
|
|
e.preventDefault(); //阻止默认粘贴事件
|
|
|
let source = e.clipboardData.getData("Text");
|
|
|
- console.log("source", source);
|
|
|
// 这里区分普通复制和在表格内复制,判断是否包含','
|
|
|
// 没找到,就通过表格复制
|
|
|
if (source.indexOf(",") === -1) {
|
|
@@ -1613,7 +1588,6 @@ export default {
|
|
|
this.$modal.closeLoading();
|
|
|
if (res.code === 200) {
|
|
|
let rowList = res.rows;
|
|
|
- console.log("粘贴的", rowList);
|
|
|
this.queryParams.materialCodeList = rowList.map((item) => {
|
|
|
return item.code;
|
|
|
});
|
|
@@ -1630,7 +1604,6 @@ export default {
|
|
|
} else {
|
|
|
// 找到了,按,分割
|
|
|
let codelist = source.split(",");
|
|
|
- console.log("按照逗号分隔", codelist);
|
|
|
// 数组去除空字符串
|
|
|
codelist = codelist.filter((item) => {
|
|
|
return item && item.trim();
|