|
|
@@ -305,6 +305,8 @@ export default {
|
|
|
},
|
|
|
// 派单
|
|
|
dispatch(row, type) {
|
|
|
+ console.log(row,'row 333');
|
|
|
+ console.log(type,'type');
|
|
|
if (row.selection.length == 0) {
|
|
|
return this.$message.warning('请最少选择一条数据');
|
|
|
}
|
|
|
@@ -347,7 +349,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
let data = null;
|
|
|
- this.toolbarLoading = true;
|
|
|
+
|
|
|
if (type == 2) {
|
|
|
data = changeIds;
|
|
|
} else {
|
|
|
@@ -367,9 +369,12 @@ export default {
|
|
|
if (this.isDispatchRow.hasExists) {
|
|
|
data.dispatchType = this.isDispatchRow.dispatchType;
|
|
|
} else {
|
|
|
+ let singFlag = this.singleReportRadio();
|
|
|
+ if (!singFlag) return;
|
|
|
data.dispatchType = this.form.singleReport;
|
|
|
}
|
|
|
}
|
|
|
+ this.toolbarLoading = true;
|
|
|
const api =
|
|
|
type == 1 ? taskAssignment : type == 2 ? taskRevoked : taskSave;
|
|
|
api(data)
|
|
|
@@ -403,12 +408,18 @@ export default {
|
|
|
}
|
|
|
this.getAssignData(row.index, arr);
|
|
|
},
|
|
|
+
|
|
|
+ singleReportRadio() {
|
|
|
+ if (this.form.singleReport === 0 || this.form.singleReport === 1) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ this.$message.warning('请先选择报工类型');
|
|
|
+ return false;
|
|
|
+ },
|
|
|
// 最后提交
|
|
|
async confirm() {
|
|
|
- if (this.form.singleReport != 1 && this.form.singleReport != 0) {
|
|
|
- this.$message.warning('请先选择报工类型');
|
|
|
- return;
|
|
|
- }
|
|
|
+ let flag = this.singleReportRadio();
|
|
|
+ if (!flag) return;
|
|
|
// if (!this.form.singleReport) {
|
|
|
|
|
|
// }
|
|
|
@@ -668,6 +679,10 @@ export default {
|
|
|
// 这里重新调用一个方法 计算出 startDate endDate
|
|
|
this.$set(dataRow, 'list', listArr);
|
|
|
this.$set(dataRow, 'radioBun', radioBun);
|
|
|
+ this.$set(dataRow, 'selection', []);
|
|
|
+ let tab = `tableRef${[dataRow.index]}`;
|
|
|
+ this.$refs[tab][0].setSelectedRowKeys([]);
|
|
|
+ console.log(dataRow, 'dataRow +++++');
|
|
|
},
|
|
|
// 时间比较与赋值方法 开始时间
|
|
|
compareAndSetTime(data, dataRow) {
|
|
|
@@ -798,7 +813,7 @@ export default {
|
|
|
selectedListData(row, item) {
|
|
|
let data = item.selection.find((el) => el.id == row.id);
|
|
|
if (!data) {
|
|
|
- let ids = item.selection.map(el=>el.id);
|
|
|
+ let ids = item.selection.map((el) => el.id);
|
|
|
ids.push(row.id);
|
|
|
let tab = `tableRef${[item.index]}`;
|
|
|
this.$refs[tab][0].setSelectedRowKeys(ids);
|