|
@@ -172,6 +172,15 @@
|
|
|
@click="finishedHandle(scope.row)"
|
|
|
>完成</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ v-show="scope.row.record == null || scope.row.record.status !== 3"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ v-hasPermi="['business:production:onceWork:finished']"
|
|
|
+ @click="finishedHandle2(scope.row)"
|
|
|
+ >领取</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -191,7 +200,7 @@
|
|
|
import {
|
|
|
listOnceWorkOrder,
|
|
|
saveDetail,
|
|
|
- exportOnceWork,
|
|
|
+ exportOnceWork,receive
|
|
|
} from "@/api/business/production/onceWorkOrder";
|
|
|
import { toRefs } from "vue";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
@@ -204,11 +213,17 @@ const data = reactive({
|
|
|
value: 0,
|
|
|
color: "#888",
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "办理中",
|
|
|
+ value: 1,
|
|
|
+ color: "#FFB836",
|
|
|
+ },
|
|
|
{
|
|
|
label: "已完成",
|
|
|
value: 3,
|
|
|
color: "#2FCB81",
|
|
|
},
|
|
|
+
|
|
|
],
|
|
|
});
|
|
|
|
|
@@ -356,6 +371,25 @@ function finishedHandle(row) {
|
|
|
proxy.$modal.msgError("取消完成工单");
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+function finishedHandle2(row) {
|
|
|
+ proxy.$modal
|
|
|
+ .confirm("确认领取工单么?")
|
|
|
+ .then((_) => {
|
|
|
+ console.log(row);
|
|
|
+ const finishedValue =
|
|
|
+ row.record != null
|
|
|
+ ? row.record
|
|
|
+ : {
|
|
|
+ companyId: row.companyId,
|
|
|
+ workOrderId: row.id,
|
|
|
+ tenantId: row.tenantId,
|
|
|
+ status: 1,
|
|
|
+ };
|
|
|
+ receive(finishedValue).then((res) => getList());
|
|
|
+ })
|
|
|
+ .catch((_) => {
|
|
|
+ proxy.$modal.msgError("取消领取工单");
|
|
|
+ });
|
|
|
+}
|
|
|
getList();
|
|
|
</script>
|