Bladeren bron

Merge branch 'green' into allTestUrgent

NULL1222 2 dagen geleden
bovenliggende
commit
f654aedd61

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

@@ -267,7 +267,7 @@
                                 '[]' && scope.data.column.data.brand
                                 '[]' && scope.data.column.data.brand
                         "
                         "
                     >
                     >
-                        <span v-for="item in scope.data.column.data.brand">
+                        <span v-for="item in scope.data.column.data.brand" :key="item.sa_brand_bgjid">
                             <el-tag
                             <el-tag
                                 style="
                                 style="
                                     margin-right: 10px;
                                     margin-right: 10px;
@@ -290,7 +290,7 @@
                     >
                     >
                         <span
                         <span
                             v-for="item in scope.data.column.data.itemclass"
                             v-for="item in scope.data.column.data.itemclass"
-                            :key="item.index"
+                            :key="item.sc_itemsaleclassid"
                         >
                         >
                             <el-tag
                             <el-tag
                                 style="
                                 style="

+ 1 - 1
src/bgj/headquartersServiceMaterial/modules/selectAllAddToSite.vue

@@ -60,7 +60,7 @@ export default {
                     const res = await this.$api.requested({
                     const res = await this.$api.requested({
                         id: 2026051511000002,
                         id: 2026051511000002,
                         content: {
                         content: {
-                            sc_itemids: ids.join(","),
+                            // sc_itemids: ids.join(","),不用传
                         },
                         },
                     });
                     });
                     this.tool.showMessage(res, () => {
                     this.tool.showMessage(res, () => {

+ 9 - 1
src/bgj/serviceAppointment/modules/linkedWork.vue

@@ -132,7 +132,15 @@ export default {
     },
     },
     methods: {
     methods: {
         goWork(scope) {
         goWork(scope) {
-            console.log("可跳转至【服务工单】对应数据详情页", scope);
+            let route = this.$route;
+            if (route.path !== "/workOrderManageDetail") {
+                this.oldRoute = { path: route.path, query: route.query };
+                this.$store.dispatch("setHistoryRouter", this.oldRoute);
+            }
+            this.$router.push({
+                path: "/workOrderManageDetail",
+                query: { id: scope.sc_workorderid },
+            });
         },
         },
         async listData() {
         async listData() {
             this.params.content.sc_serviceformid = this.$route.query.id;
             this.params.content.sc_serviceformid = this.$route.query.id;

+ 1 - 0
src/bgj/serviceWorkItem/modules/detail.vue

@@ -25,6 +25,7 @@
                     @onSuccess="queryMainData"
                     @onSuccess="queryMainData"
                 ></Edit>
                 ></Edit>
                 <el-button
                 <el-button
+                    style="margin-right: 10px;"
                     type="danger"
                     type="danger"
                     @click="onDelete"
                     @click="onDelete"
                     size="mini"
                     size="mini"

+ 105 - 0
src/bgj/workOrderManage/components/refuse.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <el-button
+      slot="reference"
+      type="text"
+      size="mini"
+      @click="dialogTableVisible = true"
+      style="color: #f56c6c; margin-left: 10px"
+      >{{ $t("拒绝") }}</el-button
+    >
+    <el-dialog
+      :title="$t(`提示`)"
+      append-to-body
+      :visible.sync="dialogTableVisible"
+      width="500px"
+    >
+      <el-row :gutter="20">
+        <el-form
+          label-position="top"
+          ref="form"
+          :rules="rules"
+          inline
+          :label-width="tool.onlyZh('100px')"
+          :model="form"
+          size="small"
+        >
+          <el-col :span="24">
+            <el-form-item :label="$t(`拒绝原因`)" prop="reject_reason">
+              <el-input
+                v-model="form.reject_reason"
+                :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>
+export default {
+  data() {
+    return {
+      dialogTableVisible: false,
+      form: {
+        sc_workorderid: "",
+        sc_warrantycard_applyid: "",
+        reject_reason: "",
+        isAgreed: 0,
+      },
+      rules: {
+        reject_reason: [
+          {
+            required: true,
+            message: this.$t("请填写拒绝原因"),
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  props: ["sc_workorderid",'sc_warrantycard_applyid'],
+  methods: {
+    submit() {
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false;
+        this.form.sc_workorderid = this.sc_workorderid;
+        this.form.sc_warrantycard_applyid = this.sc_warrantycard_applyid;
+        let res = await this.$api.requested({
+          id: 2026052910290102,
+          content: this.form,
+        });
+        this.tool.showMessage(res, () => {
+          this.$emit("refuseSuccess");
+          this.dialogTableVisible = false;
+        });
+      });
+    },
+  },
+  created() {},
+};
+</script>
+<style scoped>
+/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>

+ 194 - 0
src/bgj/workOrderManage/modules/applicationInfo.vue

@@ -0,0 +1,194 @@
+
+<template>
+  <div>
+    <div style="display: flex; align-items: center">
+      <el-input
+        :placeholder="$t('搜索')"
+        suffix-icon="el-icon-search"
+        v-model="params.content.where.condition"
+        style="width: 200px"
+        size="mini"
+        class="input-with-select inline-16"
+        @keyup.native.enter="listData((params.content.pageNumber = 1))"
+        @clear="clearData"
+        clearable
+      >
+      </el-input>
+      <slot name="addProduct"></slot>
+    </div>
+    <div style="margin-top: 15px">
+      <tableLayout
+        :layout="tablecols"
+        :data="list"
+        :opwidth="200"
+        :custom="true"
+        :width="false"
+        :height="tableHieght"
+        fixedName="operation"
+      >
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.columnname == 'apply_result'">
+            <span
+              :style="
+                scope.column.data.apply_result === '拒绝'
+                  ? 'color:#f56c6c'
+                  : 'color:#67c23a'
+              "
+              >{{ scope.column.data.apply_result }}</span
+            >
+          </div>
+          <div v-else>
+            {{
+              scope.column.columnname === "operation" ||
+              scope.column.data[scope.column.columnname]
+                ? scope.column.data[scope.column.columnname]
+                : "--"
+            }}
+          </div>
+        </template>
+        <template v-slot:opreation="scope">
+          <el-button
+            v-if="
+              tool.checkAuth($route.name, 'cardApproval') &&
+              scope.data.apply_result == ''
+            "
+            type="text"
+            @click="onAgree(scope.data)"
+            size="mini"
+            style="color: #67c23a"
+          >
+            {{ $t("同意") }}
+          </el-button>
+          <Refuse
+            v-if="
+              tool.checkAuth($route.name, 'cardApproval') &&
+              scope.data.apply_result == ''
+            "
+            class="inline-16"
+            :sc_workorderid="scope.data.sc_workorderid"
+            :sc_warrantycard_applyid="scope.data.sc_warrantycard_applyid"
+            @refuseSuccess="listData"
+          />
+        </template>
+      </tableLayout>
+    </div>
+    <div style="margin-top: 16px; text-align: right">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="params.content.pageNumber"
+        :page-size="params.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import Refuse from "../components/refuse.vue";
+export default {
+  props: ["data"],
+  components: { Refuse },
+
+  data() {
+    return {
+      tableHieght: "calc(100vh - 380px)",
+      tablecols: [],
+      list: [],
+      total: 0,
+      params: {
+        id: 2026052911075602,
+        version: 1,
+        content: {
+          sc_workorderid: "",
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+          },
+        },
+      },
+      options: [],
+    };
+  },
+  methods: {
+    async listData() {
+      this.params.content.sc_workorderid = this.$route.query.id;
+      const res = await this.$api.requested(this.params);
+      this.list = res.data;
+      this.total = res.total;
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val;
+      this.listData();
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val;
+      this.listData();
+    },
+    clearData() {
+      this.listData();
+    },
+    queryClick() {
+      this.listData();
+    },
+    onAgree(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: "2026052910290102",
+                  content: {
+                    sc_workorderid: value.sc_workorderid,
+                    sc_warrantycard_applyid: value.sc_warrantycard_applyid,
+                    isAgreed: 1,
+                  },
+                });
+                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.listData();
+                  }, 500);
+                });
+              } catch (error) {
+                instance.confirmButtonLoading = false;
+              }
+            } else {
+              done();
+            }
+          },
+        }
+      ).catch(() => {});
+    },
+  },
+  created() {
+    this.listData();
+    console.log(this.$route.name);
+    this.tablecols = this.tool.tabelCol(
+      this.$route.name
+    ).applicationInfoTable.tablecols;
+  },
+};
+</script>
+<style scoped>
+</style>

+ 18 - 4
src/bgj/workOrderManage/modules/detail.vue

@@ -20,9 +20,10 @@
           v-if="
           v-if="
             mainData.status === '进行中' && tool.checkAuth($route.name, 'stop')
             mainData.status === '进行中' && tool.checkAuth($route.name, 'stop')
           "
           "
-          type="text"
           @click="onStop(mainData)"
           @click="onStop(mainData)"
           size="mini"
           size="mini"
+          type="primary"
+          style="margin-right: 10px"
         >
         >
           {{ $t(`暂 停`) }}
           {{ $t(`暂 停`) }}
         </el-button>
         </el-button>
@@ -30,9 +31,10 @@
           v-if="
           v-if="
             mainData.status === '暂停' && tool.checkAuth($route.name, 'turnOn')
             mainData.status === '暂停' && tool.checkAuth($route.name, 'turnOn')
           "
           "
-          type="text"
           @click="onTurnOn(mainData)"
           @click="onTurnOn(mainData)"
           size="mini"
           size="mini"
+          type="primary"
+          style="margin-right: 10px"
         >
         >
           {{ $t(`启 用`) }}
           {{ $t(`启 用`) }}
         </el-button>
         </el-button>
@@ -52,7 +54,16 @@
         <base-info v-if="detailInfo" :detailInfo="detailInfo"></base-info>
         <base-info v-if="detailInfo" :detailInfo="detailInfo"></base-info>
       </div>
       </div>
       <div slot="slot1">
       <div slot="slot1">
-        <processInfo :data="mainData" ></processInfo>
+        <processInfo :data="mainData"></processInfo>
+      </div>
+      <div slot="slot2">
+        <material :data="mainData"></material>
+      </div>
+      <div slot="slot3">
+        <team :data="mainData"></team>
+      </div>
+      <div slot="slot4">
+        <applicationInfo :data="mainData"></applicationInfo>
       </div>
       </div>
     </basicDetails>
     </basicDetails>
   </div>
   </div>
@@ -62,6 +73,9 @@
 import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
 import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
 import processInfo from "./processInfo/index";
 import processInfo from "./processInfo/index";
 import Del from "../components/del";
 import Del from "../components/del";
+import material from "./material";
+import team from "./team";
+import applicationInfo from "./applicationInfo";
 export default {
 export default {
   name: "detail",
   name: "detail",
   data() {
   data() {
@@ -72,7 +86,7 @@ export default {
       btnLoading: false,
       btnLoading: false,
     };
     };
   },
   },
-  components: { BaseInfo, Del, processInfo },
+  components: { BaseInfo, Del, processInfo, material, team, applicationInfo },
   methods: {
   methods: {
     async queryMainData() {
     async queryMainData() {
       const res = await this.$api.requested({
       const res = await this.$api.requested({

+ 138 - 0
src/bgj/workOrderManage/modules/material.vue

@@ -0,0 +1,138 @@
+
+<template>
+  <div>
+    <div style="display: flex; align-items: center">
+      <el-input
+        :placeholder="$t('搜索')"
+        suffix-icon="el-icon-search"
+        v-model="params.content.where.condition"
+        style="width: 200px"
+        size="mini"
+        class="input-with-select inline-16"
+        @keyup.native.enter="listData((params.content.pageNumber = 1))"
+        @clear="clearData"
+        clearable
+      >
+      </el-input>
+      <slot name="addProduct"></slot>
+    </div>
+    <div style="margin-top: 15px">
+      <tableLayout
+        :layout="tablecols"
+        :data="list"
+        :opwidth="200"
+        :custom="true"
+        :width="false"
+        :height="tableHieght"
+        fixedName="operation"
+      >
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.data.columnname === 'brand'">
+            <span
+              v-if="
+                JSON.stringify(scope.column.data.brand) !== '[]' &&
+                scope.column.data.brand
+              "
+            >
+              <span
+                v-for="item in scope.column.data.brand"
+                :key="item.sa_brand_bgjid"
+              >
+                <el-tag
+                  style="
+                    margin-right: 10px;
+                    margin-top: 5px;
+                    margin-bottom: 5px;
+                  "
+                  type="warning"
+                  >{{ $t(item.brandname) }}</el-tag
+                >
+              </span>
+            </span>
+            <span v-else>--</span>
+          </div>
+          <div v-else>
+            {{
+              scope.column.data[[scope.column.columnname]]
+                ? $t(scope.column.data[[scope.column.columnname]])
+                : "--"
+            }}
+          </div>
+        </template>
+      </tableLayout>
+    </div>
+    <div style="margin-top: 16px; text-align: right">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="params.content.pageNumber"
+        :page-size="params.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["data"],
+  data() {
+    return {
+      tableHieght: "calc(100vh - 380px)",
+      tablecols: [],
+      list: [],
+      total: 0,
+      params: {
+        id: 2026052716201902,
+        version: 1,
+        content: {
+          sc_workorderid: "",
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+          },
+        },
+      },
+      options: [],
+    };
+  },
+  methods: {
+    async listData() {
+      this.params.content.sc_workorderid = this.$route.query.id;
+      const res = await this.$api.requested(this.params);
+      this.list = res.data;
+      this.total = res.total;
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val;
+      this.listData();
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val;
+      this.listData();
+    },
+    clearData() {
+      this.listData();
+    },
+    queryClick() {
+      this.listData();
+    },
+  },
+  created() {
+    this.listData();
+    console.log(this.$route.name);
+    this.tablecols = this.tool.tabelCol(
+      this.$route.name
+    ).workOrderMaterialTable.tablecols;
+  },
+};
+</script>
+<style scoped>
+</style>

+ 166 - 0
src/bgj/workOrderManage/modules/team.vue

@@ -0,0 +1,166 @@
+
+<template>
+  <div>
+    <div style="display: flex; align-items: center">
+      <el-input
+        :placeholder="$t('搜索')"
+        suffix-icon="el-icon-search"
+        v-model="params.content.where.condition"
+        style="width: 200px"
+        size="mini"
+        class="input-with-select inline-16"
+        @keyup.native.enter="listData((params.content.pageNumber = 1))"
+        @clear="clearData"
+        clearable
+      >
+      </el-input>
+      <slot name="addProduct"></slot>
+    </div>
+    <div style="margin-top: 15px">
+      <el-table
+        :data="tableData"
+        stripe
+        border
+        size="small"
+        :height="tableHieght"
+      >
+        <el-table-column
+          :label="$t('姓名')"
+          prop="name"
+          show-overflow-tooltip
+          min-width="120"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.name || "--" }}
+            <el-tag
+              v-if="scope.row.isLeader"
+              type="primary"
+              effect="dark"
+              style="margin-left: 10px"
+              size="small"
+            >
+              负责人
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :label="$t('联系电话')"
+          prop="phonenumber"
+          show-overflow-tooltip
+          min-width="140"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.phonenumber || "--" }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          :label="$t('职务')"
+          prop="position"
+          show-overflow-tooltip
+          min-width="120"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.position || "--" }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div style="margin-top: 16px; text-align: right">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="params.content.pageNumber"
+        :page-size="params.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["data"],
+  data() {
+    return {
+      tableHieght: "calc(100vh - 380px)",
+      tableData: [],
+      list: [],
+      total: 0,
+      params: {
+        id: 20220930103501,
+        version: 1,
+        content: {
+          ownertable: "sc_workorder",
+          ownerid: "",
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+          },
+        },
+      },
+      options: [],
+    };
+  },
+  methods: {
+    async listData() {
+      this.params.content.ownerid = this.$route.query.id;
+      const res = await this.$api.requested(this.params);
+      if (res.data && res.data.length > 0) {
+        this.list = res.data;
+        this.buildTableData(res.data);
+      } else {
+        this.list = [];
+        this.tableData = [];
+      }
+    },
+    buildTableData(list) {
+      const result = [];
+      list.forEach((group) => {
+        const leader = (group.teamleader && group.teamleader[0]) || {};
+        const members = group.team || [];
+        result.push({
+          name: leader.name || group.teamname || "--",
+          phonenumber: leader.phonenumber || "--",
+          position: leader.position || "--",
+          isLeader: true,
+        });
+        members.forEach((member) => {
+          result.push({
+            name: member.name || "--",
+            phonenumber: member.phonenumber || "--",
+            position: member.position || "--",
+            isLeader: false,
+          });
+        });
+      });
+      this.tableData = result;
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val;
+      this.listData();
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val;
+      this.listData();
+    },
+    clearData() {
+      this.listData();
+    },
+    queryClick() {
+      this.listData();
+    },
+  },
+  created() {
+    this.listData();
+  },
+};
+</script>
+<style scoped>
+</style>