NULL1222 пре 4 дана
родитељ
комит
5c96896321

+ 3 - 3
src/bgj/serviceAppointment/index.vue

@@ -44,8 +44,8 @@
                     <el-select
                         class="inline-24"
                         v-model="where.type"
-                        :placeholder="$t(`请选择工单类型`)"
-                        @focus="queryType('serviceworktype')"
+                        :placeholder="$t(`请选择服务类型`)"
+                        @focus="queryType('servicebookingtype')"
                         @change="selectChange"
                         size="small"
                         clearable
@@ -185,7 +185,7 @@ export default {
             if (this.options[type].length == 0) {
                 const res = await this.$store.dispatch(
                     "optiontypeselect",
-                    "servicebookingtype"
+                    type
                 );
                 this.options[type] = res.data;
             }

+ 2 - 2
src/bgj/terminalWorkBillModule/index.vue

@@ -73,9 +73,9 @@ export default {
     },
     methods: {
         switchChange(data, newVal) {
-            const actionText = newVal == 1 ? "启用" : "用";
+            const actionText = newVal == 1 ? "启用" : "用";
             this.$confirm(
-                this.$t(`确认${actionText}当前工单模板吗`) + "?",
+                this.$t('确认') + this.$t(actionText) + this.$t('当前工单模板')+'?',
                 this.$t("提示"),
                 {
                     confirmButtonText: this.$t("确定"),

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

@@ -0,0 +1,104 @@
+<template>
+  <div>
+    <el-button
+      slot="reference"
+      :type="!disabled ? '' : 'primary'"
+      size="mini"
+      :disabled="!disabled"
+      @click="dialogTableVisible = true"
+      >{{ $t("作 废") }}</el-button
+    >
+    <el-dialog
+      :title="$t(`提示`)"
+      append-to-body
+      :visible.sync="dialogTableVisible"
+      width="500px"
+    >
+      <el-row :gutter="20">
+        <el-form
+          label-position="right"
+          ref="form"
+          :rules="rules"
+          inline
+          :label-width="tool.onlyZh('100px')"
+          :model="form"
+          size="small"
+        >
+          <el-col :span="24">
+            <el-form-item :label="$t(`作废原因`)" prop="voidreason">
+              <el-input
+                v-model="form.voidreason"
+                :placeholder="$t(`请填写`)"
+                style="width: 100%"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">{{
+            $t("取 消")
+          }}</el-button>
+          <el-button type="primary" @click="submit" size="small">{{
+            $t("确 定")
+          }}</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+/*
+id:数据id
+nameId:接口id
+nameKey:接口字段
+ */
+export default {
+  data() {
+    return {
+      dialogTableVisible: false,
+      form: {
+        sc_workorderid: "",
+        voidreason: "",
+      },
+      rules: {
+        voidreason: [
+          {
+            required: true,
+            message: this.$t("请填写作废原因"),
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  props: ["id", "disabled"],
+  methods: {
+    submit() {
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false;
+        this.form.sc_workorderid = this.id;
+        let res = await this.$api.requested({
+          id: 2026052113565202,
+          content: this.form,
+        });
+        this.tool.showMessage(res, () => {
+          this.$emit("deleteSuccess");
+          this.dialogTableVisible = false;
+        });
+      });
+    },
+  },
+  created() {},
+};
+</script>
+<style scoped>
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-form-item__content {
+  width: calc(100% - 100px);
+}
+</style>

+ 324 - 0
src/bgj/workOrderManage/index.vue

@@ -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>

+ 233 - 0
src/bgj/workOrderManage/modules/detail.vue

@@ -0,0 +1,233 @@
+<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 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>
+</template>
+
+<script>
+import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
+export default {
+    name: "detail",
+    data() {
+        return {
+            mainData: {},
+            mainAreaData: {},
+            detailInfo: "",
+            btnLoading: false,
+        };
+    },
+    components: { BaseInfo },
+    methods: {
+        async queryMainData() {
+            const res = await this.$api.requested({
+                id: 2026052013170002,
+                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,
+                },
+                {
+                    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,
+                },
+            ];
+            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);
+        },
+    },
+    mounted() {
+        this.queryMainData(this.$route.query.id);
+    },
+};
+</script>
+
+<style scoped></style>

+ 23 - 0
src/router/bgj.js

@@ -173,6 +173,29 @@ const bgj = [
           import(/* webpackChunkName: "about" */ '@/bgj/pointsbasedorder/modules/detail'),
       },
     ],
+  },
+  {
+    path: '/workOrderManage',
+    name: 'workOrderManage',
+    meta: {
+      title: '工单管理',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/bgj/workOrderManage/index'),
+    children: [
+      {
+        path: '/workOrderManageDetail',
+        name: 'workOrderManage',
+        meta: {
+          title: '工单管理详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () =>
+          import(/* webpackChunkName: "about" */ '@/bgj/workOrderManage/modules/detail'),
+      },
+    ],
   }
 ];
 export default bgj;