|
|
@@ -0,0 +1,324 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basicLayout
|
|
|
+ ref="list"
|
|
|
+ formPath="workOrderManage"
|
|
|
+ tableName="workOrderManageTable"
|
|
|
+ idName="sc_workorderid"
|
|
|
+ :apiId="{ query: 2026052113525502 }"
|
|
|
+ :detailPath="{
|
|
|
+ path: '/workOrderManageDetail',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <template #custom>
|
|
|
+ <div class="mt-10">
|
|
|
+ <label class="search__label">{{ $t("状态") }}:</label>
|
|
|
+ <el-select
|
|
|
+ class="inline-24"
|
|
|
+ v-model="status"
|
|
|
+ :placeholder="$t(`请选择状态`)"
|
|
|
+ @change="selectChange"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option :label="$t(`待开始`)" value="待开始"></el-option>
|
|
|
+ <el-option :label="$t(`进行中`)" value="进行中"></el-option>
|
|
|
+ <el-option :label="$t(`暂停`)" value="暂停"></el-option>
|
|
|
+ <el-option :label="$t(`已完成`)" value="已完成"> </el-option>
|
|
|
+ <el-option :label="$t(`质保卡审批`)" value="质保卡审批">
|
|
|
+ </el-option>
|
|
|
+ <el-option :label="$t(`作废`)" value="作废"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="mt-10">
|
|
|
+ <label class="search__label">{{ $t("工单类型") }}:</label>
|
|
|
+ <el-select
|
|
|
+ class="inline-24"
|
|
|
+ v-model="where.type"
|
|
|
+ :placeholder="$t(`请选择工单类型`)"
|
|
|
+ @focus="queryType('endcustomerserviceworktype')"
|
|
|
+ @change="selectChange"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.worktype"
|
|
|
+ :key="item.value"
|
|
|
+ :label="$t(item.value)"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="mt-10">
|
|
|
+ <label class="search__label">{{ $t("服务类型") }}:</label>
|
|
|
+ <el-select
|
|
|
+ class="inline-24"
|
|
|
+ v-model="where.servicetype"
|
|
|
+ :placeholder="$t(`请选择服务类型`)"
|
|
|
+ @focus="queryType('servicebookingtype')"
|
|
|
+ @change="selectChange"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.serviceworktype"
|
|
|
+ :key="item.value"
|
|
|
+ :label="$t(item.value)"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="mt-10">
|
|
|
+ <label class="search__label">{{ $t("创建时间") }}:</label>
|
|
|
+ <el-date-picker
|
|
|
+ style="margin-right: 24px !important"
|
|
|
+ size="small"
|
|
|
+ @change="selectChange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ v-model="createDate"
|
|
|
+ type="daterange"
|
|
|
+ :range-separator="$t(`至`)"
|
|
|
+ :start-placeholder="$t(`开始日期`)"
|
|
|
+ :end-placeholder="$t(`结束日期`)"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div class="mt-10">
|
|
|
+ <label class="search__label">{{ $t("完成时间") }}:</label>
|
|
|
+ <el-date-picker
|
|
|
+ style="margin-right: 24px !important"
|
|
|
+ size="small"
|
|
|
+ @change="selectChange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ v-model="finishDate"
|
|
|
+ type="daterange"
|
|
|
+ :range-separator="$t(`至`)"
|
|
|
+ :start-placeholder="$t(`开始日期`)"
|
|
|
+ :end-placeholder="$t(`结束日期`)"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:tbList="scope">
|
|
|
+ <div v-if="scope.data.column.columnname == 'status'">
|
|
|
+ <span
|
|
|
+ :style="
|
|
|
+ tool.getStatusColor(
|
|
|
+ scope.data.column.data[[scope.data.column.columnname]]
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >{{
|
|
|
+ $t(scope.data.column.data[[scope.data.column.columnname]])
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.data.column.columnname == 'city'">
|
|
|
+ <span>
|
|
|
+ {{ $t(scope.data.column.data.province)
|
|
|
+ }}{{ $t(scope.data.column.data.city)
|
|
|
+ }}{{ $t(scope.data.column.data.county) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{
|
|
|
+ scope.data.column.data[[scope.data.column.columnname]]
|
|
|
+ ? $t(scope.data.column.data[[scope.data.column.columnname]])
|
|
|
+ : "--"
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:tbOpreation="scope">
|
|
|
+ <!-- v-if="tool.checkAuth($route.name, 'assignAgent')" -->
|
|
|
+ <el-button type="text" @click="onStop(scope.data.data)" size="mini">
|
|
|
+ {{ $t(`暂 停`) }}
|
|
|
+ </el-button>
|
|
|
+ <!-- v-if="tool.checkAuth($route.name, 'assignAgent')" -->
|
|
|
+ <el-button type="text" @click="onTurnOn(scope.data.data)" size="mini">
|
|
|
+ {{ $t(`启 用`) }}
|
|
|
+ </el-button>
|
|
|
+ <!-- v-if="tool.checkAuth($route.name, 'assignAgent')" -->
|
|
|
+ <!-- <el-button type="text" @click="onCancellation(scope.data.data)" size="mini">
|
|
|
+ {{$t(`作 废`)}}
|
|
|
+ </el-button> -->
|
|
|
+ <Del
|
|
|
+ class="inline-16"
|
|
|
+ :id="scope.data.data.sc_workorderid"
|
|
|
+ @deleteSuccess="onSuccess"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </basicLayout>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Del from "./components/del";
|
|
|
+export default {
|
|
|
+ components: {Del},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ options: {
|
|
|
+ worktype: [],
|
|
|
+ serviceworktype: [],
|
|
|
+ },
|
|
|
+ where: {
|
|
|
+ status: [], //工单状态,可多选
|
|
|
+ type: "", //服务类型
|
|
|
+ servicetype: "",
|
|
|
+ begindate_createdate: "",
|
|
|
+ enddate_createdate: "",
|
|
|
+ begindate_finishdate: "",
|
|
|
+ enddate_finishdate: "",
|
|
|
+ },
|
|
|
+ status: "",
|
|
|
+ createDate: "",
|
|
|
+ finishDate: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onStop(value) {
|
|
|
+ console.log("value", value);
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("是否确定将工单") +
|
|
|
+ this.$t(value.billno) +
|
|
|
+ this.$t("暂停") +
|
|
|
+ "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
+ if (action === "confirm") {
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "2026052113545402",
|
|
|
+ content: {
|
|
|
+ sc_workorderid: value.sc_workorderid,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
+ done();
|
|
|
+ this.onSuccess();
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ done();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ },
|
|
|
+ onTurnOn(value) {
|
|
|
+ console.log("value", value);
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("是否确定将工单") +
|
|
|
+ this.$t(value.billno) +
|
|
|
+ this.$t("启用") +
|
|
|
+ "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
+ if (action === "confirm") {
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "2026052113553202",
|
|
|
+ content: {
|
|
|
+ sc_workorderid: value.sc_workorderid,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
+ done();
|
|
|
+ this.onSuccess();
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ done();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ },
|
|
|
+ onCancellation(value) {
|
|
|
+ console.log("value", value);
|
|
|
+ this.$confirm(
|
|
|
+ this.$t("是否确定将工单") +
|
|
|
+ this.$t(value.billno) +
|
|
|
+ this.$t("启用") +
|
|
|
+ "?",
|
|
|
+ this.$t("提示"),
|
|
|
+ {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
+ if (action === "confirm") {
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "2026052113565202",
|
|
|
+ content: {
|
|
|
+ sc_workorderid: value.sc_workorderid,
|
|
|
+ voidreason: "作废原因",
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
+ done();
|
|
|
+ this.onSuccess();
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ done();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ },
|
|
|
+ async queryType(type) {
|
|
|
+ if (this.options[type].length == 0) {
|
|
|
+ const res = await this.$store.dispatch("optiontypeselect", type);
|
|
|
+ this.options[type] = res.data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectChange() {
|
|
|
+ if (this.status) {
|
|
|
+ this.where.status = [this.status];
|
|
|
+ } else {
|
|
|
+ this.where.status = [];
|
|
|
+ }
|
|
|
+ if (this.createDate) {
|
|
|
+ this.where.begindate_createdate = this.createDate[0];
|
|
|
+ this.where.enddate_createdate = this.createDate[1];
|
|
|
+ } else {
|
|
|
+ this.where.begindate_createdate = "";
|
|
|
+ this.where.enddate_createdate = "";
|
|
|
+ }
|
|
|
+ if (this.finishDate) {
|
|
|
+ this.where.begindate_finishdate = this.finishDate[0];
|
|
|
+ this.where.enddate_finishdate = this.finishDate[1];
|
|
|
+ } else {
|
|
|
+ this.where.begindate_finishdate = "";
|
|
|
+ this.where.enddate_finishdate = "";
|
|
|
+ }
|
|
|
+ this.$refs.list.param.content.where = this.where;
|
|
|
+ this.$refs.list.param.content.pageNumber = 1;
|
|
|
+ this.$refs.list.listData();
|
|
|
+ },
|
|
|
+ onSuccess() {
|
|
|
+ this.$refs.list.listData();
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style></style>
|