소스 검색

工单管理列表操作

NULL1222 3 일 전
부모
커밋
31860a65a5
2개의 변경된 파일74개의 추가작업 그리고 44개의 파일을 삭제
  1. 6 9
      src/bgj/workOrderManage/components/del.vue
  2. 68 35
      src/bgj/workOrderManage/index.vue

+ 6 - 9
src/bgj/workOrderManage/components/del.vue

@@ -2,9 +2,9 @@
   <div>
   <div>
     <el-button
     <el-button
       slot="reference"
       slot="reference"
-      :type="!disabled ? '' : 'primary'"
+      :type="disabled ? 'text' : 'primary'"
       size="mini"
       size="mini"
-      :disabled="!disabled"
+      
       @click="dialogTableVisible = true"
       @click="dialogTableVisible = true"
       >{{ $t("作 废") }}</el-button
       >{{ $t("作 废") }}</el-button
     >
     >
@@ -16,7 +16,7 @@
     >
     >
       <el-row :gutter="20">
       <el-row :gutter="20">
         <el-form
         <el-form
-          label-position="right"
+          label-position="top"
           ref="form"
           ref="form"
           :rules="rules"
           :rules="rules"
           inline
           inline
@@ -24,15 +24,15 @@
           :model="form"
           :model="form"
           size="small"
           size="small"
         >
         >
-          <el-col :span="24">
+         <el-col :span="24">
             <el-form-item :label="$t(`作废原因`)" prop="voidreason">
             <el-form-item :label="$t(`作废原因`)" prop="voidreason">
               <el-input
               <el-input
                 v-model="form.voidreason"
                 v-model="form.voidreason"
                 :placeholder="$t(`请填写`)"
                 :placeholder="$t(`请填写`)"
-                style="width: 100%"
+                style="width: 100%;"
               ></el-input>
               ></el-input>
             </el-form-item>
             </el-form-item>
-          </el-col>
+            </el-col>
         </el-form>
         </el-form>
       </el-row>
       </el-row>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
@@ -98,7 +98,4 @@ export default {
 /deep/.el-form-item {
 /deep/.el-form-item {
   width: 100% !important;
   width: 100% !important;
 }
 }
-/deep/.el-form-item__content {
-  width: calc(100% - 100px);
-}
 </style>
 </style>

+ 68 - 35
src/bgj/workOrderManage/index.vue

@@ -42,7 +42,7 @@
             clearable
             clearable
           >
           >
             <el-option
             <el-option
-              v-for="item in options.worktype"
+              v-for="item in options.endcustomerserviceworktype"
               :key="item.value"
               :key="item.value"
               :label="$t(item.value)"
               :label="$t(item.value)"
               :value="item.value"
               :value="item.value"
@@ -62,7 +62,7 @@
             clearable
             clearable
           >
           >
             <el-option
             <el-option
-              v-for="item in options.serviceworktype"
+              v-for="item in options.servicebookingtype"
               :key="item.value"
               :key="item.value"
               :label="$t(item.value)"
               :label="$t(item.value)"
               :value="item.value"
               :value="item.value"
@@ -132,21 +132,37 @@
         </div>
         </div>
       </template>
       </template>
       <template v-slot:tbOpreation="scope">
       <template v-slot:tbOpreation="scope">
-        <!-- v-if="tool.checkAuth($route.name, 'assignAgent')" -->
-        <el-button type="text" @click="onStop(scope.data.data)" size="mini">
+        <!-- v-if="tool.checkAuth($route.name, 'stop')" -->
+        <el-button
+          v-if="scope.data.data.statue === '进行中'"
+          type="text"
+          @click="onStop(scope.data.data)"
+          size="mini"
+        >
           {{ $t(`暂 停`) }}
           {{ $t(`暂 停`) }}
         </el-button>
         </el-button>
-        <!-- v-if="tool.checkAuth($route.name, 'assignAgent')" -->
-        <el-button type="text" @click="onTurnOn(scope.data.data)" size="mini">
+        <!-- v-if="tool.checkAuth($route.name, 'turnOn')" -->
+        <el-button
+          v-if="scope.data.data.statue === '暂停'"
+          type="text"
+          @click="onTurnOn(scope.data.data)"
+          size="mini"
+        >
           {{ $t(`启 用`) }}
           {{ $t(`启 用`) }}
         </el-button>
         </el-button>
-        <!-- v-if="tool.checkAuth($route.name, 'assignAgent')" -->
         <!-- <el-button type="text" @click="onCancellation(scope.data.data)" size="mini">
         <!-- <el-button type="text" @click="onCancellation(scope.data.data)" size="mini">
             {{$t(`作 废`)}}
             {{$t(`作 废`)}}
         </el-button> -->
         </el-button> -->
+        <!-- v-if="tool.checkAuth($route.name, 'cancellation')" -->
         <Del
         <Del
+          v-if="
+            scope.data.data.statue !== '已完成' &&
+            scope.data.data.statue !== '作废' &&
+            scope.data.data.statue !== '质保卡审批'
+          "
           class="inline-16"
           class="inline-16"
           :id="scope.data.data.sc_workorderid"
           :id="scope.data.data.sc_workorderid"
+          :disabled="true"
           @deleteSuccess="onSuccess"
           @deleteSuccess="onSuccess"
         />
         />
       </template>
       </template>
@@ -157,12 +173,12 @@
 <script>
 <script>
 import Del from "./components/del";
 import Del from "./components/del";
 export default {
 export default {
-  components: {Del},
+  components: { Del },
   data() {
   data() {
     return {
     return {
       options: {
       options: {
-        worktype: [],
-        serviceworktype: [],
+        endcustomerserviceworktype: [],
+        servicebookingtype: [],
       },
       },
       where: {
       where: {
         status: [], //工单状态,可多选
         status: [], //工单状态,可多选
@@ -180,7 +196,6 @@ export default {
   },
   },
   methods: {
   methods: {
     onStop(value) {
     onStop(value) {
-      console.log("value", value);
       this.$confirm(
       this.$confirm(
         this.$t("是否确定将工单") +
         this.$t("是否确定将工单") +
           this.$t(value.billno) +
           this.$t(value.billno) +
@@ -194,19 +209,28 @@ export default {
           beforeClose: async (action, instance, done) => {
           beforeClose: async (action, instance, done) => {
             if (action === "confirm") {
             if (action === "confirm") {
               instance.confirmButtonLoading = true;
               instance.confirmButtonLoading = true;
-              const res = await this.$api.requested({
-                id: "2026052113545402",
-                content: {
-                  sc_workorderid: value.sc_workorderid,
-                },
-              });
-              this.tool.showMessage(res, () => {
-                setTimeout(() => {
+              try {
+                const res = await this.$api.requested({
+                  id: "2026052113545402",
+                  content: {
+                    sc_workorderid: value.sc_workorderid,
+                  },
+                });
+                if (res.code !== 1) {
+                  this.$message.error(this.$t(res.msg));
                   instance.confirmButtonLoading = false;
                   instance.confirmButtonLoading = false;
-                  done();
-                  this.onSuccess();
-                }, 500);
-              });
+                  return;
+                }
+                this.tool.showMessage(res, () => {
+                  setTimeout(() => {
+                    instance.confirmButtonLoading = false;
+                    done();
+                    this.onSuccess();
+                  }, 500);
+                });
+              } catch (error) {
+                instance.confirmButtonLoading = false;
+              }
             } else {
             } else {
               done();
               done();
             }
             }
@@ -229,19 +253,28 @@ export default {
           beforeClose: async (action, instance, done) => {
           beforeClose: async (action, instance, done) => {
             if (action === "confirm") {
             if (action === "confirm") {
               instance.confirmButtonLoading = true;
               instance.confirmButtonLoading = true;
-              const res = await this.$api.requested({
-                id: "2026052113553202",
-                content: {
-                  sc_workorderid: value.sc_workorderid,
-                },
-              });
-              this.tool.showMessage(res, () => {
-                setTimeout(() => {
+              try {
+                const res = await this.$api.requested({
+                  id: "2026052113553202",
+                  content: {
+                    sc_workorderid: value.sc_workorderid,
+                  },
+                });
+                if (res.code !== 1) {
+                  this.$message.error(this.$t(res.msg));
                   instance.confirmButtonLoading = false;
                   instance.confirmButtonLoading = false;
-                  done();
-                  this.onSuccess();
-                }, 500);
-              });
+                  return;
+                }
+                this.tool.showMessage(res, () => {
+                  setTimeout(() => {
+                    instance.confirmButtonLoading = false;
+                    done();
+                    this.onSuccess();
+                  }, 500);
+                });
+              } catch (error) {
+                instance.confirmButtonLoading = false;
+              }
             } else {
             } else {
               done();
               done();
             }
             }