|
@@ -87,7 +87,7 @@
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
- @click="batchDelete"
|
|
|
+ @click="myDeleteHandler"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -136,7 +136,7 @@
|
|
|
ref="tableRef"
|
|
|
:cell-style="cellStyle"
|
|
|
:reserve-selection="true"
|
|
|
- :row-key="getRowKey"
|
|
|
+ row-key="saleOrderId"
|
|
|
>
|
|
|
<el-table-column
|
|
|
type="selection"
|
|
@@ -440,11 +440,6 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="productAmounts" label="金额">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <el-input
|
|
|
- v-model="scope.row.productAmounts"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- ></el-input> -->
|
|
|
{{ scope.row.productAmounts }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -725,6 +720,7 @@ import {
|
|
|
getStatisticList,
|
|
|
getTableList1,
|
|
|
checkOrderNo,
|
|
|
+ delOrder,
|
|
|
} from "@/api/tablelist/commonTable";
|
|
|
import { listData } from "@/api/system/tenant/data";
|
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -745,6 +741,7 @@ export default {
|
|
|
components: { Queryfrom, Menu, DialogTemplate },
|
|
|
data() {
|
|
|
return {
|
|
|
+ myDelIds: [], //新增接口 删除的id
|
|
|
// 详情弹窗数据
|
|
|
detailShow: false,
|
|
|
printDomData: "",
|
|
@@ -1212,7 +1209,8 @@ export default {
|
|
|
btnName: "编辑",
|
|
|
btnType: "myEdit",
|
|
|
btnIcon: "",
|
|
|
- btnShowCondition: "",
|
|
|
+ btnShowCondition:
|
|
|
+ '[{"fieldName":"sale_order.status","mark":"6","refValue":"1"}]',
|
|
|
children: [],
|
|
|
},
|
|
|
{
|
|
@@ -1221,6 +1219,14 @@ export default {
|
|
|
btnIcon: "",
|
|
|
btnShowCondition: "",
|
|
|
children: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ btnName: "删除",
|
|
|
+ btnType: "myDelete",
|
|
|
+ btnIcon: "",
|
|
|
+ btnShowCondition:
|
|
|
+ '[{"fieldName":"sale_order.status","mark":"6","refValue":"1"}]',
|
|
|
+ children: [],
|
|
|
}
|
|
|
);
|
|
|
// }
|
|
@@ -1273,9 +1279,9 @@ export default {
|
|
|
// });
|
|
|
this.tableList = await this.setFieldStyleData(tempTableList);
|
|
|
this.total = res.total;
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs.tableRef?.clearSelection();
|
|
|
- // });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tableRef?.clearSelection();
|
|
|
+ });
|
|
|
this.loading = false;
|
|
|
});
|
|
|
|
|
@@ -1331,6 +1337,7 @@ export default {
|
|
|
if (valid) {
|
|
|
console.log(valid);
|
|
|
let {
|
|
|
+ id,
|
|
|
//订单表数据
|
|
|
saleNo,
|
|
|
saleCustomNo,
|
|
@@ -1451,7 +1458,8 @@ export default {
|
|
|
Object.keys(craftValue).map((k) => {
|
|
|
craftData.commMap[k] = craftValue[k];
|
|
|
});
|
|
|
- saleData.conditionMap.saleNo = saleValue.saleNo;
|
|
|
+ // saleData.conditionMap.saleNo = saleValue.saleNo;
|
|
|
+ saleData.conditionMap.id = this.formData.id;
|
|
|
craftData.conditionMap.saleCraftNo = craftValue.saleCraftNo;
|
|
|
// for(let i = 0;i<this.)
|
|
|
let deletPayload = {
|
|
@@ -1720,6 +1728,8 @@ export default {
|
|
|
// )
|
|
|
// ]
|
|
|
// );
|
|
|
+ this.myDelIds = selection.map((item) => item.saleOrderId);
|
|
|
+ console.log(this.myDelIds);
|
|
|
this.ids = selection.map((item) => item.saleOrderSaleNo);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
@@ -2071,11 +2081,11 @@ export default {
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- let primary = camelCase(this.templateInfo.template?.primaryKey);
|
|
|
- let realyKey = camelCase(this.tableName + "_" + primary);
|
|
|
- if (this.ids.length > 0) {
|
|
|
+ let primary = "saleOrderId";
|
|
|
+ let realyKey = "saleOrderId";
|
|
|
+ if (this.myDelIds.length > 0) {
|
|
|
this.queryParams["execlMap"] = [];
|
|
|
- this.ids.forEach((item) => {
|
|
|
+ this.myDelIds.forEach((item) => {
|
|
|
this.queryParams.execlMap.push(
|
|
|
this.tableList.find((ttem) => {
|
|
|
return ttem[realyKey] === item;
|
|
@@ -2743,6 +2753,30 @@ export default {
|
|
|
// </tr>
|
|
|
}
|
|
|
},
|
|
|
+ // 自定义删除按钮
|
|
|
+ async myDeleteHandler(row) {
|
|
|
+ console.log(row);
|
|
|
+ await this.$confirm("是否确认删除选中的数据?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ let payLoad = row.saleOrderId ? [row.saleOrderId] : this.myDelIds;
|
|
|
+ console.log(payLoad);
|
|
|
+ try {
|
|
|
+ let res = await delOrder(payLoad);
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ this.getList();
|
|
|
+ this.myDelIds = [];
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.tableRef?.clearSelection();
|
|
|
+ // });
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ },
|
|
|
|
|
|
// 操作列回调
|
|
|
excuteHandler(btnData, row) {
|
|
@@ -2780,6 +2814,8 @@ export default {
|
|
|
case "myDetail":
|
|
|
this.handleDetail(row);
|
|
|
break;
|
|
|
+ case "myDelete":
|
|
|
+ this.myDeleteHandler(row, btnData);
|
|
|
default:
|
|
|
break;
|
|
|
}
|