Просмотр исходного кода

Merge branch 'green' into allTestUrgent

NULL1222 1 день назад
Родитель
Сommit
9b3ede1509

+ 3 - 4
src/Form/serviceWorkItem/add.vue

@@ -73,9 +73,8 @@
             <el-col :span="24">
               <el-form-item :label="$t('是否合格:')" prop="passcheck">
                 <el-radio-group v-model="form.passcheck">
-                  <el-radio :label="11">{{ $t("必填") }}</el-radio>
-                  <el-radio :label="1">{{ $t("非必填") }}</el-radio>
-                  <el-radio :label="0">{{ $t("无") }}</el-radio>
+                <el-radio :label="1">{{ $t("是") }}</el-radio>
+                  <el-radio :label="0">{{ $t("否") }}</el-radio>
                 </el-radio-group>
               </el-form-item>
             </el-col>
@@ -158,7 +157,7 @@ export default {
         fileupload: 0, //附件上传,0不需要 1可上传 11必须上传
         signature: 0, //客户签名,0不需要 1可填写 11必须填写
         additem: 0, //物料添加,0不添加 1添加 11必须添加
-        passcheck: 0, //合格确认,0不需要 1需要 11必须
+        passcheck: 0, //合格确认,0否1是
         formcheck: 0, //表单验证,0 不需要 1 需要
         panorama: 0, //全景影像,0不需要 1可上传 11必须上传
         servicenode: 0, //服务节点,0 不需要 1 需要

+ 1 - 1
src/bgj/serviceWorkItem/index.vue

@@ -37,7 +37,7 @@ export default {
   data() {
     return {
       // 是否类型字段
-      booleanFields: ["formcheck", "servicenode", "logreport"],
+      booleanFields: ["formcheck", "servicenode", "logreport", "passcheck"],
       // 通用状态
       commonStatusMap: { 0: "无", 1: "非必填", 11: "必填" },
       // 是否状态

+ 4 - 11
src/bgj/serviceWorkItem/modules/detail.vue

@@ -160,23 +160,16 @@ export default {
 
                 {
                     label: "是否合格",
-                    value: this.mainData.passcheck
-                        ? this.mainData.passcheck == 1
-                            ? "非必填"
-                            : "必填"
-                        : "无",
+                    value: this.mainData.passcheck ? "是" : "否",
                     style: function () {
                         let style = {};
                         switch (that.mainData.passcheck) {
-                            case 0:
-                                style = { color: "#333333" };
-                                break;
                             case 1:
-                                style = { color: "#008000" };
-                                break;
-                            case 11:
                                 style = { color: "#ff0000" };
                                 break;
+                            case 0:
+                                style = { color: "#666666" };
+                                break;
                             default:
                                 break;
                         }

+ 7 - 11
src/bgj/terminalWorkBillModule/modules/taskDetail/components/addTop.vue

@@ -113,20 +113,16 @@
                         </div>
                         <div
                             v-else-if="scope.column.columnname == 'passcheck'"
-                            :style="
-                                scope.column.data.passcheck
-                                    ? scope.column.data.passcheck == 1
-                                        ? 'color:#008000'
-                                        : 'color:#ff0000'
-                                    : ''
+                             :style="
+                                scope.column.data.passcheck == 1
+                                    ? 'color:#ff0000'
+                                    : 'color:#666666'
                             "
                         >
                             {{
-                                scope.column.data.passcheck
-                                    ? scope.column.data.passcheck == 1
-                                        ? $t("非必填")
-                                        : $t("必填")
-                                    : $t("无")
+                                scope.column.data.passcheck == 1
+                                    ? $t("是")
+                                    : $t("否")
                             }}
                         </div>
                         <div

+ 1 - 7
src/bgj/terminalWorkBillModule/modules/taskDetail/index.vue

@@ -122,13 +122,7 @@
                 width="120"
             >
                 <template slot-scope="scope">
-                    {{
-                        scope.row.passcheck
-                            ? scope.row.passcheck == 1
-                                ? $t("非必填")
-                                : $t("必填")
-                            : $t("无")
-                    }}
+                    {{ scope.row.passcheck == 1 ? $t("是") : $t("否") }}
                 </template>
             </el-table-column>
             <el-table-column

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

@@ -187,6 +187,7 @@
           :id="scope.data.data.sc_workorderid"
           :disabled="true"
           @deleteSuccess="onSuccess"
+          style="padding-left: 10px;"
         />
       </template>
     </basicLayout>

+ 5 - 2
src/bgj/workOrderManage/modules/detail.vue

@@ -51,13 +51,16 @@
       <div slot="slot0">
         <base-info v-if="detailInfo" :detailInfo="detailInfo"></base-info>
       </div>
-      <div slot="slot1"></div>
+      <div slot="slot1">
+        <processInfo :data="mainData" ></processInfo>
+      </div>
     </basicDetails>
   </div>
 </template>
 
 <script>
 import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
+import processInfo from "./processInfo/index";
 import Del from "../components/del";
 export default {
   name: "detail",
@@ -69,7 +72,7 @@ export default {
       btnLoading: false,
     };
   },
-  components: { BaseInfo, Del },
+  components: { BaseInfo, Del, processInfo },
   methods: {
     async queryMainData() {
       const res = await this.$api.requested({

+ 219 - 0
src/bgj/workOrderManage/modules/processInfo/detail.vue

@@ -0,0 +1,219 @@
+<template>
+  <el-drawer
+    :visible.sync="drawerVisible"
+    size="800px"
+    direction="rtl"
+    :append-to-body="true"
+    @close="$emit('close')"
+  >
+    <div
+      style="
+        display: flex;
+        margin: 0 10px 10px;
+        font-weight: bold;
+        font-size: 16px;
+      "
+    >
+      {{ $t(data?.workpresetjson.workname) }}
+      <div
+        class="status"
+        v-if="data?.parentid != 0"
+        :style="{
+          backgroundColor:
+            data?.status == 0
+              ? tool.getStatusColor('未完成', true)
+              : data?.status == 1
+              ? tool.getStatusColor('已完成', true)
+              : tool.getStatusColor('进行中', true),
+        }"
+      >
+        {{
+          data?.status == 0
+            ? $t("未完成")
+            : data?.status == 1
+            ? $t("已完成")
+            : $t("进行中")
+        }}
+      </div>
+      <div v-else></div>
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">
+      <div class="item-label">{{ $t("操作说明") }}:</div>
+      <div class="item-text">
+        {{ $t(data?.workpresetjson.remarks) || "--" }}
+      </div>
+      <div class="item-label">{{ $t("操作人员") }}:</div>
+      <div class="item-text">
+        {{ data?.trainers.map((item) => $t(item.name)).join(",") || "--" }}
+      </div>
+    </div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      {{ $t("上传附件") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">图片</div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      {{ $t("物料添加") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">
+      <el-table
+        :data="materialData"
+        :header-cell-style="{ background: '#fff', color: '#333' }"
+        size="mini"
+        border
+      >
+        <el-table-column min-width="100" :label="$t('物料名称')">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{
+              scope.row.companyName ? scope.row.companyName : "--"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column min-width="100" :label="$t('物料编号')">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{
+              scope.row.companyName ? scope.row.companyName : "--"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column width="100" :label="$t('型号')">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{
+              scope.row.companyName ? scope.row.companyName : "--"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column width="100" :label="$t('规格')">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{
+              scope.row.companyName ? scope.row.companyName : "--"
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column width="100" :label="$t('数量')">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{
+              scope.row.companyName ? scope.row.companyName : "--"
+            }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      {{ $t("全息影像") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">
+      <div style="display: flex">
+        <div class="item-label" style="font-size: 14px; font-weight: 500">
+          {{ $t("全景影象链接") }}:
+        </div>
+        <el-input
+          style="flex: 1; padding-bottom: 10px"
+          v-model="data.panoramaurl"
+          disabled
+        ></el-input>
+      </div>
+      <div style="display: flex">
+        <div class="item-label" style="font-size: 14px; font-weight: 500">
+          {{ $t("全景影象二维码") }}:
+        </div>
+        <el-input
+          style="flex: 1; padding-bottom: 10px"
+          v-model="data.panoramaurl"
+          disabled
+        ></el-input>
+      </div>
+    </div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      <span style="color: #f56c6c">*</span>{{ $t("是否确认合格") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">
+      <el-radio-group v-model="data.ispasscheck" disabled>
+        <el-radio :label="1">{{ $t(`是`) }}</el-radio>
+        <el-radio :label="0">{{ $t(`否`) }}</el-radio>
+      </el-radio-group>
+    </div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      {{ $t("不合格原因") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">
+      <el-input v-model="data.nopassreason" disabled></el-input>
+    </div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      <span style="color: #f56c6c">*</span>{{ $t("上传不合格附件") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">图片</div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      {{ $t("客户签字") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">图片</div>
+    <div style="height: 10px; background: #f5f5f5"></div>
+    <div style="margin: 10px; font-weight: bold; font-size: 16px">
+      {{ $t("备注") }}:
+    </div>
+    <div class="drawer__panel" style="margin-bottom: 0 !important">
+      <el-input v-model="data.remarks" disabled type="textarea"></el-input>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+export default {
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    data: {
+      type: Object,
+      default: null,
+    },
+  },
+  data() {
+    return {
+      //  data:{},
+      materialData:[]
+    };
+  },
+  computed: {
+    drawerVisible: {
+      get() {
+        return this.visible;
+      },
+      set(val) {
+        this.$emit("update:visible", val);
+      },
+    },
+  },
+};
+</script>
+
+<style scoped>
+.item-label {
+  padding-bottom: 10px;
+  font-weight: 600;
+  font-size: 16px;
+  color: #333;
+}
+.item-text {
+  font-size: 14px;
+  color: #333;
+}
+.status {
+  margin-left: 10px;
+  font-size: 12px;
+  font-weight: lighter;
+  padding: 2px 4px;
+  border-radius: 4px;
+  color: #fff;
+  white-space: nowrap; /* 防止文字换行 */
+  display: inline-flex;
+  align-items: center;
+}
+</style>

+ 186 - 0
src/bgj/workOrderManage/modules/processInfo/index.vue

@@ -0,0 +1,186 @@
+<template>
+  <div class="brand">
+    <el-table
+      :data="tableData"
+      stripe
+      border
+      row-key="sc_workorder_nodeid"
+      size="small"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+    >
+      <el-table-column width="55"> </el-table-column>
+      <el-table-column
+        prop="workname"
+        :label="$t(`工序内容`)"
+        show-overflow-tooltip
+        width="400"
+      >
+        <template slot-scope="scope">
+          <span>{{ $t(scope.row.workname) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="status" :label="$t(`状态`)" width="70">
+        <template slot-scope="scope">
+          <div
+            v-if="scope.row.parentid != 0"
+            :style="{
+              color:
+                scope.row.status == 0
+                  ? tool.getStatusColor('未完成', true)
+                  : scope.row.status == 1
+                  ? tool.getStatusColor('已完成', true)
+                  : tool.getStatusColor('进行中', true),
+            }"
+          >
+            {{
+              scope.row.status == 0
+                ? $t("未完成")
+                : scope.row.status == 1
+                ? $t("已完成")
+                : $t("进行中")
+            }}
+          </div>
+          <div v-else>--</div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="remarks"
+        show-overflow-tooltip
+        :label="$t(`操作说明`)"
+        min-width="400"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.remarks ? $t(scope.row.remarks) : "--" }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="trainers"
+        show-overflow-tooltip
+        :label="$t(`操作人员`)"
+        width="300"
+      >
+        <template slot-scope="scope">
+          {{
+            scope.row.trainers?.length
+              ? scope.row.trainers.map((item) => $t(item.name)).join(",")
+              : "--"
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="remarksBz"
+        show-overflow-tooltip
+        :label="$t(`备注说明`)"
+        min-width="400"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.remarksBz ? $t(scope.row.remarksBz) : "--" }}
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('操作')" width="110" fixed="right">
+        <template slot-scope="scope">
+          <el-button type="text" @click="goDetail(scope.row)" size="mini">
+            {{ $t(`详情`) }}
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <detail
+      :visible.sync="drawerVisible"
+      :data="detailData"
+      @close="drawerVisible = false"
+    />
+  </div>
+</template>
+
+<script>
+import detail from "./detail.vue";
+export default {
+  props: ["data"],
+  components: { detail },
+  data() {
+    return {
+      tableData: [],
+      drawerVisible: false,
+      detailData: null,
+    };
+  },
+  created() {},
+  methods: {
+    async department(callback) {
+      this.tableData = this.sortBySequence(
+        this.createTreeData(this.data.nodes)
+      );
+      console.log("this.tableData", this.tableData);
+    },
+    createTreeData(array) {
+      var that = this;
+      let arr = [];
+      function convertToElementTree(node) {
+        // 新节点
+        var elNode = {
+          parentid: node["parentid"],
+          sc_workorder_nodeid: node["sc_workorder_nodeid"],
+          sc_workorderid: node["sc_workorderid"],
+          workname: node["workpresetjson"]?.workname,
+          status: node["status"],
+          parentid: node["parentid"],
+          remarks: node["workpresetjson"]?.remarks,
+          trainers: node["trainers"],
+          remarksBz: node["remarks"],
+          sequence: node["sequence"],
+          children: [],
+        };
+        if (Array.isArray(node.child) && node.child.length > 0) {
+          // 如果存在子节点
+          for (var index = 0; index < node.child.length; index++) {
+            // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
+            elNode.children.push(convertToElementTree(node.child[index]));
+          }
+          elNode.children = that.sortBySequence(elNode.children);
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        console.log("element-----------", element);
+        arr.push(convertToElementTree(element));
+      });
+      console.log("arr-----------", arr);
+      return arr;
+    },
+    sortBySequence(list) {
+      return [...list].sort(
+        (a, b) => (Number(a.sequence) || 0) - (Number(b.sequence) || 0)
+      );
+    },
+    async goDetail(row) {
+      const res = await this.$api.requested({
+        id: 2026052615161102,
+        content: {
+          sc_workorderid: row.sc_workorderid,
+          sc_workorder_nodeid: row.sc_workorder_nodeid,
+        },
+      });
+      if (res.code === 1) {
+        this.detailData = res.data;
+        this.drawerVisible = true;
+      }
+    },
+    handleSizeChange(val) {
+      this.params.content.pageSize = val;
+      this.department();
+    },
+    handleCurrentChange(val) {
+      this.params.content.pageNumber = val;
+      this.department();
+    },
+  },
+  mounted() {
+    this.department();
+  },
+};
+</script>
+
+<style scoped>
+</style>