|
@@ -55,11 +55,27 @@
|
|
|
<el-button
|
|
|
icon="el-icon-setting"
|
|
|
text
|
|
|
- v-if="row.workOrderState === '2'"
|
|
|
- @click="distribute(row.id)"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_lock]"
|
|
|
+ v-if="row.workOrderState === '4'"
|
|
|
+ @click="lockOrUnLockWorkOrder(row.id,5)"
|
|
|
type="primary"
|
|
|
- v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
|
|
|
- :size="size">下发</el-button>
|
|
|
+ :size="size">冻结</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ text
|
|
|
+ v-if="row.workOrderState === '5'"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_lock]"
|
|
|
+ @click="lockOrUnLockWorkOrder(row.id,4)"
|
|
|
+ type="primary"
|
|
|
+ :size="size">解冻</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ text
|
|
|
+ v-if="row.workOrderState === '2'"
|
|
|
+ @click="distribute(row.id)"
|
|
|
+ type="primary"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
|
|
|
+ :size="size">下发</el-button>
|
|
|
<el-button
|
|
|
icon="el-icon-setting"
|
|
|
text
|
|
@@ -183,7 +199,7 @@
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import buttonPermission from "@/common/configs/buttonPermission";
|
|
|
-import {apsWorkOrder,distributeWorkOrder,revokeWorkOrder} from "@/api/order"
|
|
|
+import {apsWorkOrder,distributeWorkOrder,revokeWorkOrder,lockWorkOrder} from "@/api/order"
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
import ChoiceRoutePage from "./components/choice-route-page.vue";
|
|
@@ -261,6 +277,19 @@ const distribute = (id)=>{
|
|
|
// catch error
|
|
|
});
|
|
|
}
|
|
|
+const lockOrUnLockWorkOrder = (id,status)=>{
|
|
|
+ let message = status === "4" ? "解冻" : "冻结"
|
|
|
+ ElMessageBox.confirm("当前操作不可逆,确定"+message+"工单吗?")
|
|
|
+ .then(() => {
|
|
|
+ lockWorkOrder({id: id,workOrderState: status}).then((data)=>{
|
|
|
+ ElMessage.success(data.msg);
|
|
|
+ dataList()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // catch error
|
|
|
+ });
|
|
|
+}
|
|
|
const revoke = (id)=>{
|
|
|
ElMessageBox.confirm("当前操作不可逆,确定撤销工单吗?")
|
|
|
.then(() => {
|