فهرست منبع

工单管理详情

NULL1222 2 روز پیش
والد
کامیت
c700a4848b
3فایلهای تغییر یافته به همراه372 افزوده شده و 265 حذف شده
  1. 6 0
      src/bgj/workOrderManage/components/del.vue
  2. 14 50
      src/bgj/workOrderManage/index.vue
  3. 352 215
      src/bgj/workOrderManage/modules/detail.vue

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

@@ -98,4 +98,10 @@ export default {
 /deep/.el-form-item {
   width: 100% !important;
 }
+/deep/.el-dialog__header{
+  border-bottom: 1px solid #dcdfe6;
+}
+/deep/.el-dialog__footer{
+  border-top: 1px solid #dcdfe6;
+}
 </style>

+ 14 - 50
src/bgj/workOrderManage/index.vue

@@ -154,33 +154,34 @@
         </div>
       </template>
       <template v-slot:tbOpreation="scope">
-        <!-- v-if="tool.checkAuth($route.name, 'stop')" -->
         <el-button
-          v-if="scope.data.data.statue === '进行中'"
+          v-if="
+            scope.data.data.status === '进行中' &&
+            tool.checkAuth($route.name, 'stop')
+          "
           type="text"
           @click="onStop(scope.data.data)"
           size="mini"
         >
           {{ $t(`暂 停`) }}
         </el-button>
-        <!-- v-if="tool.checkAuth($route.name, 'turnOn')" -->
         <el-button
-          v-if="scope.data.data.statue === '暂停'"
+          v-if="
+            scope.data.data.status === '暂停' &&
+            tool.checkAuth($route.name, 'turnOn')
+          "
           type="text"
           @click="onTurnOn(scope.data.data)"
           size="mini"
         >
           {{ $t(`启 用`) }}
         </el-button>
-        <!-- <el-button type="text" @click="onCancellation(scope.data.data)" size="mini">
-            {{$t(`作 废`)}}
-        </el-button> -->
-        <!-- v-if="tool.checkAuth($route.name, 'cancellation')" -->
         <Del
           v-if="
-            scope.data.data.statue !== '已完成' &&
-            scope.data.data.statue !== '作废' &&
-            scope.data.data.statue !== '质保卡审批'
+            scope.data.data.status !== '已完成' &&
+            scope.data.data.status !== '作废' &&
+            scope.data.data.status !== '质保卡审批' &&
+            tool.checkAuth($route.name, 'cancellation')
           "
           class="inline-16"
           :id="scope.data.data.sc_workorderid"
@@ -204,8 +205,8 @@ export default {
       },
       where: {
         status: [], //工单状态,可多选
-        type: "", //服务类型
-        servicetype: "",
+        type: "", //工单类型
+        servicetype: "", //服务类型
         begindate_createdate: "",
         enddate_createdate: "",
         begindate_finishdate: "",
@@ -261,7 +262,6 @@ export default {
       ).catch(() => {});
     },
     onTurnOn(value) {
-      console.log("value", value);
       this.$confirm(
         this.$t("是否确定将工单") +
           this.$t(value.billno) +
@@ -304,42 +304,6 @@ export default {
         }
       ).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);

+ 352 - 215
src/bgj/workOrderManage/modules/detail.vue

@@ -1,232 +1,369 @@
 <template>
-    <div>
-        <basicDetails
-            ref="details"
-            :titleText="mainData.billno"
-            :editData="mainData"
-            :mainAreaData="mainAreaData"
-            turnPageId="2026051510000003"
-            idname="sc_serviceformid"
-            ownertable="sc_serviceform"
-            tags=""
-            :tabs="['工单信息', '工序信息','工单物料','团队信息','质保卡申请记录']"
-            :column="5"
-            @pageChange="pageChange"
-            @onEditSuccess="queryMainData($route.query.id)"
+  <div>
+    <basicDetails
+      ref="details"
+      :titleText="mainData.billno"
+      :editData="mainData"
+      :mainAreaData="mainAreaData"
+      turnPageId="2026051510000003"
+      idname="sc_workorderid"
+      ownertable="sc_workorder"
+      tags=""
+      :tabs="['工单信息', '工序信息', '工单物料', '团队信息', '质保卡申请记录']"
+      :column="5"
+      @pageChange="pageChange"
+      @onEditSuccess="queryMainData($route.query.id)"
+    >
+      <div slot="tags"></div>
+      <template slot="customOperation">
+        <el-button
+          v-if="
+            mainData.status === '进行中' && tool.checkAuth($route.name, 'stop')
+          "
+          type="text"
+          @click="onStop(mainData)"
+          size="mini"
         >
-            <div slot="tags"></div>
-            <template slot="customOperation">
-                
-            </template>
-            <div slot="slot0">
-                <base-info
-                    v-if="detailInfo"
-                    :detailInfo="detailInfo"
-                ></base-info>
-            </div>
-            <div slot="slot1">
-            </div>
-        </basicDetails>
-    </div>
+          {{ $t(`暂 停`) }}
+        </el-button>
+        <el-button
+          v-if="
+            mainData.status === '暂停' && tool.checkAuth($route.name, 'turnOn')
+          "
+          type="text"
+          @click="onTurnOn(mainData)"
+          size="mini"
+        >
+          {{ $t(`启 用`) }}
+        </el-button>
+        <Del
+          v-if="
+            mainData.status !== '已完成' &&
+            mainData.status !== '作废' &&
+            mainData.status !== '质保卡审批' &&
+            tool.checkAuth($route.name, 'cancellation')
+          "
+          class="inline-16"
+          :id="mainData.sc_workorderid"
+          @deleteSuccess="queryMainData"
+        />
+      </template>
+      <div slot="slot0">
+        <base-info v-if="detailInfo" :detailInfo="detailInfo"></base-info>
+      </div>
+      <div slot="slot1"></div>
+    </basicDetails>
+  </div>
 </template>
 
 <script>
 import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
+import Del from "../components/del";
 export default {
-    name: "detail",
-    data() {
-        return {
-            mainData: {},
-            mainAreaData: {},
-            detailInfo: "",
-            btnLoading: false,
-        };
+  name: "detail",
+  data() {
+    return {
+      mainData: {},
+      mainAreaData: {},
+      detailInfo: "",
+      btnLoading: false,
+    };
+  },
+  components: { BaseInfo, Del },
+  methods: {
+    async queryMainData() {
+      const res = await this.$api.requested({
+        id: 2026052113534102,
+        content: {
+          nocache: true,
+          sc_workorderid: this.$route.query.id,
+        },
+      });
+      this.mainData = res.data;
+      this.changeDataStructure();
+      console.log("this.mainData", this.mainData);
+    },
+    changeDataStructure() {
+      let that = this;
+      this.mainAreaData = [
+        {
+          label: "工单号",
+          value: this.mainData.billno,
+        },
+        {
+          label: "预约单号",
+          value: this.mainData.servicebillno,
+        },
+        {
+          label: "工单状态",
+          value: this.$t(this.mainData.status),
+          style: function () {
+            let style = that.tool.getStatusColor(that.mainData.status);
+            return style;
+          },
+        },
+        {
+          label: "客户姓名",
+          value: this.mainData.name,
+        },
+        {
+          label: "客户电话",
+          value: this.mainData.phonenumber,
+        },
+        {
+          label: "省市县",
+          value:
+            this.mainData.province + this.mainData.city + this.mainData.county,
+        },
+        {
+          label: "详细地址",
+          value: this.mainData.address,
+        },
+        {
+          label: "服务类型",
+          value: this.$t(this.mainData.servicetype),
+          style: function () {
+            let style = that.tool.getStatusColor(that.mainData.servicetype);
+            return style;
+          },
+        },
+        {
+          label: "工单类型",
+          value: this.$t(this.mainData.type),
+          style: function () {
+            let style = that.tool.getStatusColor(that.mainData.type);
+            return style;
+          },
+        },
+        {
+          label: "现场联系人",
+          value: this.mainData.scenecontact,
+        },
+        {
+          label: "现场联系人电话",
+          value: this.mainData.scenecontactphonenumber,
+        },
+        {
+          label: "负责人",
+          value: this.mainData.leadername,
+        },
+        {
+          label: "经销商",
+          value: this.mainData.enterprisename,
+        },
+        {
+          label: "创建时间",
+          value: this.mainData.createdate,
+        },
+        {
+          label: "完成时间",
+          value: this.mainData.finishdate,
+        },
+        {
+          label: "作废原因",
+          value: this.mainData.voidreason,
+        },
+        {
+          label: "备注",
+          value: this.mainData.remarks,
+        },
+      ];
+      this.detailInfo = {
+        baseInfo: [
+          {
+            label: "工单号",
+            value: this.mainData.billno,
+          },
+          {
+            label: "预约单号",
+            value: this.mainData.servicebillno,
+          },
+          {
+            label: "工单状态",
+            value: this.$t(this.mainData.status),
+            style: function () {
+              let style = that.tool.getStatusColor(that.mainData.status);
+              return style;
+            },
+          },
+          {
+            label: "服务类型",
+            value: this.$t(this.mainData.servicetype),
+            style: function () {
+              let style = that.tool.getStatusColor(that.mainData.servicetype);
+              return style;
+            },
+          },
+          {
+            label: "工单类型",
+            value: this.$t(this.mainData.type),
+            style: function () {
+              let style = that.tool.getStatusColor(that.mainData.type);
+              return style;
+            },
+          },
+          {
+            label: "客户姓名",
+            value: this.mainData.name,
+          },
+          {
+            label: "客户电话",
+            value: this.mainData.phonenumber,
+          },
+          {
+            label: "省市县",
+            value:
+              this.mainData.province +
+              this.mainData.city +
+              this.mainData.county,
+          },
+          {
+            label: "详细地址",
+            value: this.mainData.address,
+          },
+          {
+            label: "厨房数",
+            value: this.mainData.kitchen,
+          },
+          {
+            label: "卫生间数",
+            value: this.mainData.toilet,
+          },
+          {
+            label: "阳台数",
+            value: this.mainData.balcony,
+          },
+          {
+            label: "现场联系人",
+            value: this.mainData.scenecontact,
+          },
+          {
+            label: "现场联系人电话",
+            value: this.mainData.scenecontactphonenumber,
+          },
+          {
+            label: "负责人",
+            value: this.mainData.leadername,
+          },
+          {
+            label: "经销商",
+            value: this.mainData.enterprisename,
+          },
+          {
+            label: "备注",
+            value: this.mainData.remarks,
+          },
+        ],
+        systemInfo: [
+          {
+            label: "创建时间",
+            value: this.mainData.createdate,
+          },
+          {
+            label: "开始时间",
+            value: this.mainData.startdate,
+          },
+          {
+            label: "完成时间",
+            value: this.mainData.finishdate,
+          },
+          {
+            label: "作废时间",
+            value: this.mainData.voiddate,
+          },
+          {
+            label: "作废原因",
+            value: this.mainData.voidreason,
+          },
+        ],
+      };
     },
-    components: { BaseInfo },
-    methods: {
-        async queryMainData() {
-            const res = await this.$api.requested({
-                id: 2026052013170002,
+    onStop(value) {
+      this.$confirm(this.$t("是否确定暂停执行该工单") + "?", this.$t("提示"), {
+        confirmButtonText: this.$t("确定"),
+        cancelButtonText: this.$t("取消"),
+        type: "warning",
+        beforeClose: async (action, instance, done) => {
+          if (action === "confirm") {
+            instance.confirmButtonLoading = true;
+            try {
+              const res = await this.$api.requested({
+                id: "2026052113545402",
                 content: {
-                    nocache: true,
-                    sc_serviceformid: this.$route.query.id,
-                },
-            });
-            this.mainData = res.data;
-            this.changeDataStructure();
-            console.log("this.mainData", this.mainData);
-        },
-        changeDataStructure() {
-            let that = this;
-            this.mainAreaData = [
-                {
-                    label: "预约单号",
-                    value: this.mainData.billno,
-                },
-                {
-                    label: "状态",
-                    value: this.$t(this.mainData.status),
-                    style: function () {
-                        let style = that.tool.getStatusColor(
-                            that.mainData.status
-                        );
-                        return style;
-                    },
-                },
-                {
-                    label: "服务类型",
-                    value: this.mainData.type,
-                },
-                {
-                    label: "客户姓名",
-                    value: this.mainData.name,
-                },
-                {
-                    label: "客户电话",
-                    value: this.mainData.phonenumber,
-                },
-                {
-                    label: "省市县",
-                    value:
-                        this.mainData.province +
-                        this.mainData.city +
-                        this.mainData.county,
-                },
-                {
-                    label: "详细地址",
-                    value: this.mainData.address,
+                  sc_workorderid: value.sc_workorderid,
                 },
-                {
-                    label: "厨房数",
-                    value: this.mainData.kitchen,
-                },
-                {
-                    label: "卫生间数",
-                    value: this.mainData.toilet,
-                },
-                {
-                    label: "阳台数",
-                    value: this.mainData.balcony,
-                },
-                {
-                    label: "经销商",
-                    value: this.mainData.enterprisename,
-                },
-                {
-                    label: "创建时间",
-                    value: this.mainData.createdate,
-                },
-                {
-                    label: "完成时间",
-                    value: this.mainData.finishdate,
-                },
-                {
-                    label: "备注",
-                    value: this.mainData.remarks,
+              });
+              if (res.code !== 1) {
+                this.$message.error(this.$t(res.msg));
+                instance.confirmButtonLoading = false;
+                return;
+              }
+              this.tool.showMessage(res, () => {
+                setTimeout(() => {
+                  instance.confirmButtonLoading = false;
+                  done();
+                  this.onSuccess();
+                }, 500);
+              });
+            } catch (error) {
+              instance.confirmButtonLoading = false;
+            }
+          } else {
+            done();
+          }
+        },
+      }).catch(() => {});
+    },
+    onTurnOn(value) {
+      this.$confirm(this.$t("是否启用继续执行该工单") + "?", this.$t("提示"), {
+        confirmButtonText: this.$t("确定"),
+        cancelButtonText: this.$t("取消"),
+        type: "warning",
+        beforeClose: async (action, instance, done) => {
+          if (action === "confirm") {
+            instance.confirmButtonLoading = true;
+            try {
+              const res = await this.$api.requested({
+                id: "2026052113553202",
+                content: {
+                  sc_workorderid: value.sc_workorderid,
                 },
-            ];
-            this.detailInfo = {
-                baseInfo: [
-                    {
-                        label: "预约单号",
-                        value: this.mainData.billno,
-                    },
-                    {
-                        label: "服务类型",
-                        value: this.mainData.type,
-                    },
-                    {
-                        label: "状态",
-                        value: this.$t(this.mainData.status),
-                        style: function () {
-                            let style = that.tool.getStatusColor(
-                                that.mainData.status
-                            );
-                            return style;
-                        },
-                    },
-                    {
-                        label: "客户姓名",
-                        value: this.mainData.name,
-                    },
-                    {
-                        label: "客户电话",
-                        value: this.mainData.phonenumber,
-                    },
-                    {
-                        label: "省市县",
-                        value:
-                            this.mainData.province +
-                            this.mainData.city +
-                            this.mainData.county,
-                    },
-                    {
-                        label: "详细地址",
-                        value: this.mainData.address,
-                    },
-                    {
-                        label: "厨房数",
-                        value: this.mainData.kitchen,
-                    },
-                    {
-                        label: "卫生间数",
-                        value: this.mainData.toilet,
-                    },
-                    {
-                        label: "阳台数",
-                        value: this.mainData.balcony,
-                    },
-                    {
-                        label: "现场联系人",
-                        value: this.mainData.scenecontact,
-                    },
-                    {
-                        label: "现场联系人电话",
-                        value: this.mainData.scenecontactphonenumber,
-                    },
-                    {
-                        label: "经销商",
-                        value: this.mainData.enterprisename,
-                    },
-                ],
-                systemInfo: [
-                    {
-                        label: "创建时间",
-                        value: this.mainData.createdate,
-                    },
-                    {
-                        label: "创建人",
-                        value: this.mainData.createby,
-                    },
-                    {
-                        label: "指派时间",
-                        value: this.mainData.assigndate,
-                    },
-                    {
-                        label: "转单人",
-                        value: this.mainData.transformby,
-                    },
-                    {
-                        label: "转单时间",
-                        value: this.mainData.transformdate,
-                    },
-                ],
-            };
-        },
-        // 监听切换数据,上一页,下一页
-        pageChange(id, rowindex, tabIndex) {
-            this.flag = false;
-            tabIndex = this.$route.query.tabIndex;
-            this.$router.replace({
-                path: "/ourServiceMaterialDetail",
-                query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
-            });
-            this.queryMainData(id);
+              });
+              if (res.code !== 1) {
+                this.$message.error(this.$t(res.msg));
+                instance.confirmButtonLoading = false;
+                return;
+              }
+              this.tool.showMessage(res, () => {
+                setTimeout(() => {
+                  instance.confirmButtonLoading = false;
+                  done();
+                  this.onSuccess();
+                }, 500);
+              });
+            } catch (error) {
+              instance.confirmButtonLoading = false;
+            }
+          } else {
+            done();
+          }
         },
+      }).catch(() => {});
     },
-    mounted() {
-        this.queryMainData(this.$route.query.id);
+    // 监听切换数据,上一页,下一页
+    pageChange(id, rowindex, tabIndex) {
+      this.flag = false;
+      tabIndex = this.$route.query.tabIndex;
+      this.$router.replace({
+        path: "/ourServiceMaterialDetail",
+        query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
+      });
+      this.queryMainData(id);
     },
+  },
+  mounted() {
+    this.queryMainData(this.$route.query.id);
+  },
 };
 </script>