Ver Fonte

修改部分模块表格展示列宽调整

wangyani há 9 meses atrás
pai
commit
a234d61584

+ 37 - 16
src/views/mes/email/emailTemplates/index.vue

@@ -84,9 +84,15 @@
         prop="templateCode"
         label="邮件模板编号"
       ></el-table-column>
-      <el-table-column prop="templateName" label="邮件模板名称"></el-table-column>
-      <el-table-column prop="templateTitle" label="邮件模板标题"></el-table-column>
-      <el-table-column prop="templateContent" label="内容">
+      <el-table-column
+        prop="templateName"
+        label="邮件模板名称"
+      ></el-table-column>
+      <el-table-column
+        prop="templateTitle"
+        label="邮件模板标题"
+      ></el-table-column>
+      <el-table-column prop="templateContent" label="内容" width="120">
         <template slot-scope="scope">
           <el-button type="text" @click="check(scope.row)">查看</el-button>
         </template>
@@ -95,7 +101,7 @@
         label="添加时间"
         align="center"
         prop="createTime"
-        width="200"
+        width="150"
       >
         <template slot-scope="scope">
           <span>{{ scope.row.createTime }}</span>
@@ -146,10 +152,16 @@
           />
         </el-form-item>
         <el-form-item label="邮件模板名称" prop="templateName">
-          <el-input v-model="form.templateName" placeholder="请输入邮件模板名称" />
+          <el-input
+            v-model="form.templateName"
+            placeholder="请输入邮件模板名称"
+          />
         </el-form-item>
         <el-form-item label="邮件模板标题" prop="templateTitle">
-          <el-input v-model="form.templateTitle" placeholder="请输入邮件模板标题" />
+          <el-input
+            v-model="form.templateTitle"
+            placeholder="请输入邮件模板标题"
+          />
         </el-form-item>
         <el-form-item label="邮件模板内容" prop="templateContent">
           <el-input
@@ -167,9 +179,18 @@
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-    <el-dialog title="内容查看" :visible.sync="openCheck" width="600px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" >
-        <el-input type="textarea" autosize v-model="form.templateContent" ></el-input>
+    <el-dialog
+      title="内容查看"
+      :visible.sync="openCheck"
+      width="600px"
+      append-to-body
+    >
+      <el-form ref="form" :model="form" :rules="rules">
+        <el-input
+          type="textarea"
+          autosize
+          v-model="form.templateContent"
+        ></el-input>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click @click="cancel">关 闭</el-button>
@@ -217,7 +238,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
-      openCheck:false,//内容查看
+      openCheck: false, //内容查看
       // 重新渲染表格状态
       refreshTable: true,
       // 查询参数
@@ -307,7 +328,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       this.isEdit = true;
-      console.log(row,'row');
+      console.log(row, "row");
       getEmailTemplatesInfo(row.templateId).then((response) => {
         this.form = response.data;
         this.open = true;
@@ -335,16 +356,16 @@ export default {
       });
     },
     /* 查看 */
-    check(row){
-        console.log(row);
-        this.openCheck = true;
-        this.form = row;
+    check(row) {
+      console.log(row);
+      this.openCheck = true;
+      this.form = row;
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const templateIds = row.templateId || this.codes;
       this.$modal
-        .confirm('是否确认删除所选数据项?')
+        .confirm("是否确认删除所选数据项?")
         .then(function () {
           return delEmailTemplates(templateIds);
         })

+ 146 - 141
src/views/mes/material/collectionmanagement/index.vue

@@ -100,33 +100,32 @@
           />
         </el-select>
       </el-form-item>
-<!--      <el-form-item label="领取柜" prop="loanFormName">-->
-<!--        <el-select v-model="queryParams.loanFromId" placeholder="请选择领取柜">-->
-<!--          <el-option-->
-<!--            v-for="dict in cabinets"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
+      <!--      <el-form-item label="领取柜" prop="loanFormName">-->
+      <!--        <el-select v-model="queryParams.loanFromId" placeholder="请选择领取柜">-->
+      <!--          <el-option-->
+      <!--            v-for="dict in cabinets"-->
+      <!--            :key="dict.value"-->
+      <!--            :label="dict.label"-->
+      <!--            :value="dict.value"-->
+      <!--          />-->
+      <!--        </el-select>-->
+      <!--      </el-form-item>-->
 
-<!--      <el-form-item label="归还柜" prop="restitutionToName">-->
-<!--        <el-select-->
-<!--          v-model="queryParams.restitutionToId"-->
-<!--          placeholder="请选择归还柜"-->
-<!--        >-->
-<!--          <el-option-->
-<!--            v-for="dict in cabinets"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
+      <!--      <el-form-item label="归还柜" prop="restitutionToName">-->
+      <!--        <el-select-->
+      <!--          v-model="queryParams.restitutionToId"-->
+      <!--          placeholder="请选择归还柜"-->
+      <!--        >-->
+      <!--          <el-option-->
+      <!--            v-for="dict in cabinets"-->
+      <!--            :key="dict.value"-->
+      <!--            :label="dict.label"-->
+      <!--            :value="dict.value"-->
+      <!--          />-->
+      <!--        </el-select>-->
+      <!--      </el-form-item>-->
 
       <el-form-item>
-
         <el-button
           v-no-more-click
           type="primary"
@@ -152,7 +151,7 @@
         size="mini"
         v-if="!visibleSelect"
         @click="handleQueryStatus"
-      >超时未还</el-button
+        >超时未还</el-button
       >
     </el-row>
 
@@ -161,24 +160,31 @@
       :data="teamList"
       @selection-change="handleSelectionChange"
     >
-<!--      <el-table-column type="selection" width="55" align="center" />-->
-      <el-table-column v-if="!visibleSelect" label="物资柜" align="center" prop="loanFromName">
+      <!--      <el-table-column type="selection" width="55" align="center" />-->
+      <el-table-column
+        v-if="!visibleSelect"
+        label="物资柜"
+        align="center"
+        prop="loanFromName"
+      >
       </el-table-column>
       <el-table-column label="物资编号" align="center" prop="materialsId">
       </el-table-column>
       <el-table-column label="物资名称" align="center" prop="materialsName" />
-      <el-table-column label="物资类型" align="center" prop="materialsTypeName" />
       <el-table-column
-        label="物资图片"
-        prop="materialsTypePicture"
-      >
+        label="物资类型"
+        align="center"
+        prop="materialsTypeName"
+        width="180"
+      />
+      <el-table-column label="物资图片" prop="materialsTypePicture" width="90">
         <template slot-scope="scope">
           <div class="img-box" v-if="scope.row.materialsTypePicture">
             <el-image
               style="width: 50px; height: 50px"
               :preview-teleported="true"
               class="images"
-              :hide-on-click-modal=true
+              :hide-on-click-modal="true"
               :src="scope.row.materialsTypePicture"
               :zoom-rate="1.2"
               :preview-src-list="[scope.row.materialsTypePicture]"
@@ -196,17 +202,13 @@
       <el-table-column label="领取时间" align="center" prop="loanTime" />
       <el-table-column label="归还人" align="center" prop="restitutionUserName">
       </el-table-column>
-<!--      实际归还时间-->
+      <!--      实际归还时间-->
       <el-table-column
         label="归还时间"
         align="center"
         prop="actualRestitutionTime"
       />
-      <el-table-column
-        label="借出时长"
-        align="center"
-        prop="loanDuration"
-      />
+      <el-table-column label="借出时长" align="center" prop="loanDuration" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
           <dict-tag
@@ -215,27 +217,27 @@
           />
         </template>
       </el-table-column>
-<!--      <el-table-column label="领取柜" align="center" prop="loanFromName" />-->
-<!--      <el-table-column-->
-<!--        label="是否需要归还"-->
-<!--        align="center"-->
-<!--        prop="restitutionRequired"-->
-<!--      >-->
-<!--        <template slot-scope="scope">-->
-<!--          <el-tag type="primary" v-if="scope.row.restitutionRequired == 1"-->
-<!--            >是</el-tag-->
-<!--          >-->
-<!--          <el-tag type="danger" v-else>否</el-tag>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="归还柜" align="center" prop="restitutionToName" />-->
+      <!--      <el-table-column label="领取柜" align="center" prop="loanFromName" />-->
+      <!--      <el-table-column-->
+      <!--        label="是否需要归还"-->
+      <!--        align="center"-->
+      <!--        prop="restitutionRequired"-->
+      <!--      >-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <el-tag type="primary" v-if="scope.row.restitutionRequired == 1"-->
+      <!--            >是</el-tag-->
+      <!--          >-->
+      <!--          <el-tag type="danger" v-else>否</el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <!--      <el-table-column label="归还柜" align="center" prop="restitutionToName" />-->
       <!-- <el-table-column label="创建时间" align="center" prop="createTime">
       </el-table-column> -->
-<!--      <el-table-column-->
-<!--        label="理应归还时间"-->
-<!--        align="center"-->
-<!--        prop="restitutionTime"-->
-<!--      />-->
+      <!--      <el-table-column-->
+      <!--        label="理应归还时间"-->
+      <!--        align="center"-->
+      <!--        prop="restitutionTime"-->
+      <!--      />-->
       <!-- <el-table-column
         label="操作"
         align="center"
@@ -268,20 +270,20 @@
 import { listLoan } from "@/api/mes/loan/loan";
 import { getIsMaterialsCabinets } from "@/api/mes/material/information";
 import { genCode } from "@/api/system/autocode/rule";
-import Template from '@/views/print/printtemplate/list.vue'
-import { listType } from '@/api/mes/material/typeindex'
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import Template from "@/views/print/printtemplate/list.vue";
+import { listType } from "@/api/mes/material/typeindex";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "Team",
   components: { Treeselect, Template },
-  props:{
-    cabinetId:{
-      type:String,
-      required:false
-    }
+  props: {
+    cabinetId: {
+      type: String,
+      required: false,
+    },
   },
-  dicts: ["sys_yes_no","record_of_collection"],
+  dicts: ["sys_yes_no", "record_of_collection"],
   data() {
     return {
       //自动生成编码
@@ -302,7 +304,7 @@ export default {
       total: 0,
       // 班组表格数据
       teamList: [],
-      cabinets:null,//物资柜子数据
+      cabinets: null, //物资柜子数据
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -313,22 +315,21 @@ export default {
         size: 10,
         materialsName: null,
         materialsCode: null,
-        loanUserName: null,//领取人姓名
-        loanTimeStart: null,//领取开始时间
-        loanTimeEnd: null,//领取结束时间
-        restitutionUserName: null,//归还人姓名
-        restitutionTimeStart:null,//归还开始时间
-        restitutionTimeEnd:null,//归还结束时间
+        loanUserName: null, //领取人姓名
+        loanTimeStart: null, //领取开始时间
+        loanTimeEnd: null, //领取结束时间
+        restitutionUserName: null, //归还人姓名
+        restitutionTimeStart: null, //归还开始时间
+        restitutionTimeEnd: null, //归还结束时间
         restitutionRequired: null, //是否需要归还
         restitutionToName: null, //归还柜
         restitutionToId: null, //归还柜id
         loanFormName: null, //领取柜
         loanFromId: null, //领取柜id
         status: null,
-
       },
-      loanTime:null,//领取时间回显
-      restitutionTime:null,//归还时间回显
+      loanTime: null, //领取时间回显
+      restitutionTime: null, //归还时间回显
       // 查询参数
       queryParamsCabinets: {
         current: 1,
@@ -368,17 +369,17 @@ export default {
       value2: "",
       // 表单参数
       form: {},
-      machinerytypeOptions:[],
-      visibleSelect:false
+      machinerytypeOptions: [],
+      visibleSelect: false,
     };
   },
   created() {
-    this.queryParams.loanFromId = this.cabinetId||null
-    if(this.cabinetId){
-      this.visibleSelect=true;
+    this.queryParams.loanFromId = this.cabinetId || null;
+    if (this.cabinetId) {
+      this.visibleSelect = true;
     }
     this.getList();
-    this.getTreeselect()
+    this.getTreeselect();
     this.materialsCabinets();
   },
   methods: {
@@ -387,11 +388,11 @@ export default {
       if (date && date instanceof Date && !isNaN(date)) {
         // 使用本地时间
         const year = date.getFullYear();
-        const month = String(date.getMonth() + 1).padStart(2, '0');
-        const day = String(date.getDate()).padStart(2, '0');
-        const hours = String(date.getHours()).padStart(2, '0');
-        const minutes = String(date.getMinutes()).padStart(2, '0');
-        const seconds = String(date.getSeconds()).padStart(2, '0');
+        const month = String(date.getMonth() + 1).padStart(2, "0");
+        const day = String(date.getDate()).padStart(2, "0");
+        const hours = String(date.getHours()).padStart(2, "0");
+        const minutes = String(date.getMinutes()).padStart(2, "0");
+        const seconds = String(date.getSeconds()).padStart(2, "0");
         return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
       }
       return null;
@@ -400,13 +401,20 @@ export default {
     getList() {
       this.loading = true;
       if (Array.isArray(this.loanTime) && this.loanTime.length === 2) {
-        console.log()
-        this.queryParams.loanTimeStart = this.formatDate(this.loanTime[0])
-        this.queryParams.loanTimeEnd = this.formatDate(this.loanTime[1])
+        console.log();
+        this.queryParams.loanTimeStart = this.formatDate(this.loanTime[0]);
+        this.queryParams.loanTimeEnd = this.formatDate(this.loanTime[1]);
       }
-      if (Array.isArray(this.restitutionTime) && this.restitutionTime.length === 2) {
-        this.queryParams.restitutionTimeStart = this.formatDate(this.restitutionTime[0])
-        this.queryParams.restitutionTimeEnd = this.formatDate(this.restitutionTime[1])
+      if (
+        Array.isArray(this.restitutionTime) &&
+        this.restitutionTime.length === 2
+      ) {
+        this.queryParams.restitutionTimeStart = this.formatDate(
+          this.restitutionTime[0]
+        );
+        this.queryParams.restitutionTimeEnd = this.formatDate(
+          this.restitutionTime[1]
+        );
       }
       listLoan(this.queryParams).then((response) => {
         // console.log(response, "领取管理列表");
@@ -446,13 +454,12 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-
       this.queryParams.current = 1;
       this.getList();
     },
     // 专门查询超时未还的
     handleQueryStatus() {
-      this.queryParams.status='2'
+      this.queryParams.status = "2";
       this.queryParams.current = 1;
       this.getList();
     },
@@ -473,8 +480,8 @@ export default {
       this.restitutionTime = null;
       this.queryParams.restitutionTimeEnd = null;
       this.queryParams.restitutionTimeStart = null;
-      this.queryParams.restitutionUserName=null;
-      this.queryParams.status=null;
+      this.queryParams.restitutionUserName = null;
+      this.queryParams.status = null;
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -490,28 +497,28 @@ export default {
     getTreeselect() {
       const data = {
         current: 1,
-        size: -1
-      }
+        size: -1,
+      };
 
       listType(data).then((response) => {
         this.machinerytypeOptions = this.handleTree(
           response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
-      })
+          "materialsTypeId",
+          "parentId",
+          "children"
+        );
+      });
     },
     /** 转换数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.materialsTypeId,
         label: node.materialsTypeName,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -534,20 +541,19 @@ export default {
       }
     },
     //领取时间清空
-    handleClearLoanTime(value){
-      if(value==null){
-        this.queryParams.loanTimeStart=null
-        this.queryParams.loanTimeEnd=null
+    handleClearLoanTime(value) {
+      if (value == null) {
+        this.queryParams.loanTimeStart = null;
+        this.queryParams.loanTimeEnd = null;
       }
     },
     //归还时间情况
-    handleClearRestitutionTime(value){
-      if(value==null){
-        this.queryParams.restitutionTimeStart=null
-        this.queryParams.restitutionTimeEnd=null
+    handleClearRestitutionTime(value) {
+      if (value == null) {
+        this.queryParams.restitutionTimeStart = null;
+        this.queryParams.restitutionTimeEnd = null;
       }
     },
-
   },
 };
 </script>
@@ -557,33 +563,32 @@ export default {
 }
 </style>
   <style lang="scss" >
-  //图片放大
-  .img-box {
-    width: 50px;
-    height: 50px;
-    position: relative;
+//图片放大
+.img-box {
+  width: 50px;
+  height: 50px;
+  position: relative;
 
-    #eyeicon {
-      display: none;
-    }
+  #eyeicon {
+    display: none;
   }
+}
 
-  .img-box:hover {
-    background: #000;
-
-    .images {
-      opacity: 0.6;
-    }
+.img-box:hover {
+  background: #000;
 
-    #eyeicon {
-      display: block;
-      position: absolute;
-      top: 40%;
-      left: 40%;
-      z-index: 100;
-      color: white;
-      pointer-events: none
-    }
+  .images {
+    opacity: 0.6;
   }
 
-  </style>
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 100;
+    color: white;
+    pointer-events: none;
+  }
+}
+</style>

+ 173 - 141
src/views/mes/material/instructions/index.vue

@@ -42,17 +42,15 @@
           icon="el-icon-search"
           size="mini"
           @click="handleQuery"
-        >搜索
-        </el-button
-        >
+          >搜索
+        </el-button>
         <el-button
           v-no-more-click
           icon="el-icon-refresh"
           size="mini"
           @click="resetQuery"
-        >重置
-        </el-button
-        >
+          >重置
+        </el-button>
       </el-form-item>
     </el-form>
 
@@ -66,11 +64,10 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['iscs:instructions:add']"
-        >新增
+          >新增
         </el-button>
       </el-col>
 
-
       <el-col :span="1.5">
         <el-button
           v-no-more-click
@@ -81,7 +78,7 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['iscs:instructions:remove']"
-        >批量删除
+          >批量删除
         </el-button>
       </el-col>
       <right-toolbar
@@ -95,31 +92,45 @@
       :data="materialsList"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="说明编号" align="center" prop="instructionsId">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column
+        label="说明编号"
+        align="center"
+        prop="instructionsId"
+        width="200"
+      >
       </el-table-column>
-      <el-table-column prop="orderNum" label="排序" ></el-table-column>
-      <el-table-column label="标题" align="center" prop="instructionsTitle"/>
       <el-table-column
-        label="物资类型"
+        prop="orderNum"
+        label="排序"
+        width="100"
+      ></el-table-column>
+      <el-table-column
+        label="标题"
         align="center"
-        prop="materialsTypeName"
+        prop="instructionsTitle"
       />
       <el-table-column
-        label="类型"
+        label="物资类型"
         align="center"
-        prop="fileType"
-      >
+        prop="materialsTypeName"
+      />
+      <el-table-column label="类型" align="center" prop="fileType">
         <template slot-scope="scope">
-        <dict-tag :options="dict.type.file_type" :value="scope.row.fileType"/>
+          <dict-tag
+            :options="dict.type.file_type"
+            :value="scope.row.fileType"
+          />
         </template>
       </el-table-column>
       <el-table-column label="文件" align="center" prop="fileUrl">
         <template slot-scope="scope">
-          <a :href="scope.row.fileUrl" target="_blank" style="color:#1890ff">查看</a>
+          <a :href="scope.row.fileUrl" target="_blank" style="color: #1890ff"
+            >查看</a
+          >
         </template>
       </el-table-column>
-      <el-table-column label="添加时间" prop="createTime" align="center" >
+      <el-table-column label="添加时间" prop="createTime" align="center">
       </el-table-column>
       <el-table-column
         label="操作"
@@ -134,7 +145,7 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['iscs:instructions:edit']"
-          >编辑
+            >编辑
           </el-button>
           <el-button
             v-no-more-click
@@ -143,7 +154,7 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['iscs:instructions:remove']"
-          >删除
+            >删除
           </el-button>
         </template>
       </el-table-column>
@@ -179,7 +190,11 @@
           />
         </el-form-item>
         <el-form-item label="类型" prop="fileType">
-          <el-select v-model="form.fileType" placeholder="文件类型" style="width: 350px">
+          <el-select
+            v-model="form.fileType"
+            placeholder="文件类型"
+            style="width: 350px"
+          >
             <el-option
               v-for="dict in dict.type.file_type"
               :key="dict.value"
@@ -199,38 +214,53 @@
         <el-form-item label="文件" prop="fileUrl">
           <div v-if="form.fileUrl">
             <div v-if="isVideo(form.fileUrl)">
-              <video :src="form.fileUrl" width="300" height="200" controls></video>
+              <video
+                :src="form.fileUrl"
+                width="300"
+                height="200"
+                controls
+              ></video>
             </div>
             <div v-if="isPdf(form.fileUrl)">
-              <embed :src="form.fileUrl" width="300" height="200" type="application/pdf">
+              <embed
+                :src="form.fileUrl"
+                width="300"
+                height="200"
+                type="application/pdf"
+              />
             </div>
-            <el-button v-no-more-click
-                       type="danger"
-                       size="mini"
-                       @click="deleteFile">删除</el-button>
+            <el-button
+              v-no-more-click
+              type="danger"
+              size="mini"
+              @click="deleteFile"
+              >删除</el-button
+            >
           </div>
           <div v-else>
-            <el-button v-no-more-click
-                       type="info"
-                       plain
-                       icon="el-icon-upload2"
-                       size="mini"
-                       @click="handleFileUpload"
-                       v-hasPermi="['iscs:sop:import']">导入</el-button>
+            <el-button
+              v-no-more-click
+              type="info"
+              plain
+              icon="el-icon-upload2"
+              size="mini"
+              @click="handleFileUpload"
+              v-hasPermi="['iscs:sop:import']"
+              >导入</el-button
+            >
           </div>
         </el-form-item>
       </el-form>
 
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click type="primary" @click="submitForm"
-        >确 定
-        </el-button
-        >
+          >确 定
+        </el-button>
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
 
-<!--  说明上传-->
+    <!--  说明上传-->
     <el-dialog
       :title="upload.title"
       :visible.sync="upload.open"
@@ -257,10 +287,10 @@
       </el-upload>
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click type="primary" @click="submitFileForm"
-        >确 定</el-button
+          >确 定</el-button
         >
         <el-button v-no-more-click @click="upload.open = false"
-        >取 消</el-button
+          >取 消</el-button
         >
       </div>
     </el-dialog>
@@ -273,23 +303,23 @@ import {
   getInstructionsInfo,
   addInstructions,
   updateInstructions,
-  delInstructions
-} from '@/api/mes/instructions/index.js'
+  delInstructions,
+} from "@/api/mes/instructions/index.js";
 
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
-import Template from '@/views/print/printtemplate/list.vue'
-import { listType } from '@/api/mes/material/typeindex'
-import { getToken } from '@/utils/auth'
+import Template from "@/views/print/printtemplate/list.vue";
+import { listType } from "@/api/mes/material/typeindex";
+import { getToken } from "@/utils/auth";
 
 export default {
-  name: 'Team',
+  name: "Team",
   components: {
     Template,
-    Treeselect
+    Treeselect,
   },
-  dicts: ['material_status','file_type'],
+  dicts: ["material_status", "file_type"],
   data() {
     return {
       //自动生成编码
@@ -311,28 +341,28 @@ export default {
       // 班组表格数据
       materialsList: [],
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
       // 查询参数
-      createTime: '',
+      createTime: "",
       queryParams: {
         current: 1,
         size: 10,
-        instructionsTitle:'',
+        instructionsTitle: "",
       },
       // 表单参数
       form: {
-        fileUrl:''
+        fileUrl: "",
       },
       // 表单校验
       rules: {
         materialsName: [
-          { required: true, message: '物资名称不能为空', trigger: 'blur' }
+          { required: true, message: "物资名称不能为空", trigger: "blur" },
         ],
         materialsTypeId: [
-          { required: true, message: '物资类型不能为空', trigger: 'blur' }
-        ]
+          { required: true, message: "物资类型不能为空", trigger: "blur" },
+        ],
       },
       materialstypeOptions: [],
       // 用户导入参数
@@ -348,30 +378,28 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/common/upload"
+        url: process.env.VUE_APP_BASE_API + "/common/upload",
       },
-    }
+    };
   },
   created() {
-
-    this.getList()
-    this.getTreeselect()
-
+    this.getList();
+    this.getTreeselect();
   },
 
   methods: {
     isVideo(url) {
-      return url && (url.endsWith('.mp4') || url.includes('mp4'));
+      return url && (url.endsWith(".mp4") || url.includes("mp4"));
     },
     isPdf(url) {
-      return url && (url.endsWith('.pdf') || url.includes('pdf'));
+      return url && (url.endsWith(".pdf") || url.includes("pdf"));
     },
-    handleFileUpload(){
+    handleFileUpload() {
       this.upload.title = "导入";
       this.upload.open = true;
     },
     deleteFile() {
-      this.form.fileUrl = ''; // 删除文件
+      this.form.fileUrl = ""; // 删除文件
     },
     // 提交上传文件
     submitFileForm() {
@@ -379,46 +407,46 @@ export default {
     },
     /** 查询物资信息列表 */
     getList() {
-      this.loading = true
+      this.loading = true;
       listInstructions(this.queryParams).then((response) => {
-        console.log(response, '获取物资说明 ')
-        this.materialsList = response.data.records
-        this.total = response.data.total
+        console.log(response, "获取物资说明 ");
+        this.materialsList = response.data.records;
+        this.total = response.data.total;
         this.machinerytypeList = this.handleTree(
           response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
-        this.loading = false
-      })
+          "materialsTypeId",
+          "parentId",
+          "children"
+        );
+        this.loading = false;
+      });
     },
     /** 查询物资类型下拉树结构 */
     getTreeselect() {
       const data = {
         current: 1,
-        size: -1
-      }
+        size: -1,
+      };
       listType(data).then((response) => {
-        console.log(response,'物资类型树形结构')
+        console.log(response, "物资类型树形结构");
         this.materialstypeOptions = this.handleTree(
           response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
-      })
+          "materialsTypeId",
+          "parentId",
+          "children"
+        );
+      });
     },
     /** 查询物资类型下拉树结构 */
     materialnormalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.materialsTypeId,
         label: node.materialsTypeName,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -427,105 +455,109 @@ export default {
     // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
       // console.log(response,file, fileList,'文件上传成功回返')
-      this.form.fileUrl=response.url
+      this.form.fileUrl = response.url;
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          "</div>",
+        "导入结果",
+        { dangerouslyUseHTMLString: true }
+      );
       this.getList();
     },
     // 取消按钮
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     // 表单重置
     reset() {
       this.form = {
-        instructionsTitle:'',
-        fileType:'',
-        fileUrl:'',
-        orderNum:0
-      }
-      this.resetForm('form')
-      this.autoGenFlag = false
+        instructionsTitle: "",
+        fileType: "",
+        fileUrl: "",
+        orderNum: 0,
+      };
+      this.resetForm("form");
+      this.autoGenFlag = false;
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.getList()
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.instructionsId)
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.instructionsId);
+      this.multiple = !selection.length;
     },
 
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset()
-      this.open = true
-      this.title = '新增物资说明'
-      this.optType = 'add'
+      this.reset();
+      this.open = true;
+      this.title = "新增物资说明";
+      this.optType = "add";
     },
 
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset()
+      this.reset();
       getInstructionsInfo(row.instructionsId).then((response) => {
-        this.form = response.data
-        this.open = true
-        this.title = '编辑物资说明'
-        this.optType = 'edit'
-      })
+        this.form = response.data;
+        this.open = true;
+        this.title = "编辑物资说明";
+        this.optType = "edit";
+      });
     },
 
     /** 提交按钮 */
     submitForm() {
-      this.$refs['form'].validate((valid) => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.instructionsId != null) {
             updateInstructions(this.form).then((response) => {
-              console.log(response, '修改返回')
-              this.$modal.msgSuccess('修改成功')
-              this.open = false
-              this.getList()
-            })
+              console.log(response, "修改返回");
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
           } else {
-            console.log(this.form, '新增参数')
+            console.log(this.form, "新增参数");
             addInstructions(this.form).then((response) => {
-              console.log(response, '新增返回')
-              this.$modal.msgSuccess('新增成功')
-              this.open = false
-              this.getList()
-            })
+              console.log(response, "新增返回");
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
         }
-      })
+      });
     },
 
     /** 删除按钮操作 */
     handleDelete(row) {
-      const instructionsId = row.instructionsId || this.ids
+      const instructionsId = row.instructionsId || this.ids;
       this.$modal
         .confirm('是否确认删除编号为"' + instructionsId + '"的数据项?')
-        .then(function() {
-          return delInstructions(instructionsId)
+        .then(function () {
+          return delInstructions(instructionsId);
         })
         .then(() => {
-          this.getList()
-          this.$modal.msgSuccess('删除成功')
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {
-        })
-    }
-
-  }
-}
+        .catch(() => {});
+    },
+  },
+};
 </script>
 <style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
 .el-input-width {

Diff do ficheiro suprimidas por serem muito extensas
+ 383 - 354
src/views/mes/material/materialinformation/index.vue


+ 348 - 265
src/views/mes/sop/sopm/index.vue

@@ -1,14 +1,20 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
-<!--      <el-form-item label="SOP编号" prop="sopCode">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.sopCode"-->
-<!--          placeholder="请输入SOP编号"-->
-<!--          clearable-->
-<!--          @keyup.enter.native="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+    >
+      <!--      <el-form-item label="SOP编号" prop="sopCode">-->
+      <!--        <el-input-->
+      <!--          v-model="queryParams.sopCode"-->
+      <!--          placeholder="请输入SOP编号"-->
+      <!--          clearable-->
+      <!--          @keyup.enter.native="handleQuery"-->
+      <!--        />-->
+      <!--      </el-form-item>-->
       <el-form-item label="SOP名称" prop="sopName">
         <el-input
           v-model="queryParams.sopName"
@@ -19,106 +25,135 @@
       </el-form-item>
 
       <el-form-item>
-        <el-button v-no-more-click type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
+        <el-button
+          v-no-more-click
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索
         </el-button>
-        <el-button v-no-more-click icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          v-no-more-click
+          icon="el-icon-refresh"
+          size="mini"
+          @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button v-no-more-click
-                   type="primary"
-                   plain
-                   icon="el-icon-plus"
-                   size="mini"
-                   @click="handleAdd"
-                   v-hasPermi="['iscs:mars:sop:add']"
-        >新增
+        <el-button
+          v-no-more-click
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['iscs:mars:sop:add']"
+          >新增
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button v-no-more-click
-                   type="warning"
-                   plain
-                   icon="el-icon-download"
-                   size="mini"
-                   @click="handleExport"
-                   v-hasPermi="['iscs:sop:export']"
-        >导出</el-button>
+        <el-button
+          v-no-more-click
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['iscs:sop:export']"
+          >导出</el-button
+        >
       </el-col>
       <el-col :span="1.5">
-        <el-button v-no-more-click
-                   type="info"
-                   plain
-                   icon="el-icon-upload2"
-                   size="mini"
-                   @click="handleImport"
-                   v-hasPermi="['iscs:sop:import']"
-        >导入</el-button>
+        <el-button
+          v-no-more-click
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['iscs:sop:import']"
+          >导入</el-button
+        >
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button v-no-more-click-->
-<!--                   type="info"-->
-<!--                   plain-->
-<!--                   icon="el-icon-sort"-->
-<!--                   size="mini"-->
-<!--                   @click="toggleExpandAll"-->
-<!--        >展开/折叠-->
-<!--        </el-button>-->
-<!--      </el-col>-->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button v-no-more-click-->
+      <!--                   type="info"-->
+      <!--                   plain-->
+      <!--                   icon="el-icon-sort"-->
+      <!--                   size="mini"-->
+      <!--                   @click="toggleExpandAll"-->
+      <!--        >展开/折叠-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table
-      v-if="refreshTable"
-      v-loading="loading"
-      :data="deptList"
-    >
-<!--      <el-table-column prop="sopIndex" label="SOP序号" ></el-table-column>-->
-      <el-table-column prop="sopName" label="SOP名称" ></el-table-column>
+    <el-table v-if="refreshTable" v-loading="loading" :data="deptList">
+      <!--      <el-table-column prop="sopIndex" label="SOP序号" ></el-table-column>-->
+      <el-table-column
+        prop="sopName"
+        label="SOP名称"
+        width="360"
+      ></el-table-column>
       <el-table-column prop="sopType" label="SOP类型" >
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sop_type" :value="scope.row.sopType"/>
+          <dict-tag :options="dict.type.sop_type" :value="scope.row.sopType" />
         </template>
       </el-table-column>
-      <el-table-column prop="workstationName" label="所属岗位" >
+      <el-table-column prop="workstationName" label="所属岗位">
         <template slot-scope="scope">
           <span>{{ scope.row.workstationName }}</span>
         </template>
       </el-table-column>
 
-      <el-table-column prop="machineryName" label="设备/工艺" >
+      <el-table-column prop="machineryName" label="设备/工艺">
         <template slot-scope="scope">
           {{ scope.row.machineryName }}
         </template>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="200">
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+        width="200"
+      >
         <template slot-scope="scope">
           <span>{{ scope.row.createTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
-          <el-button v-no-more-click
-                     size="mini"
-                     type="text"
-                     icon="el-icon-edit"
-                     @click="handleUpdate(scope.row)"
-                     v-hasPermi="['iscs:mars:sop:edit','iscs:mars:sop:query']"
-          >修改
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['iscs:mars:sop:edit', 'iscs:mars:sop:query']"
+            >修改
           </el-button>
 
           <!--          v-if="scope.row.parentId != 0"-->
-          <el-button v-no-more-click
-
-                     size="mini"
-                     type="text"
-                     icon="el-icon-delete"
-                     @click="handleDelete(scope.row)"
-                     v-hasPermi="['iscs:mars:sop:remove']"
-          >删除
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['iscs:mars:sop:remove']"
+            >删除
           </el-button>
-
         </template>
       </el-table-column>
     </el-table>
@@ -132,58 +167,73 @@
     <!-- 添加或修改部门对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="470px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-<!--        <el-form-item label="权重序号" prop="sopIndex">-->
-<!--          <el-input v-model="form.sopIndex" placeholder="请输入权重序号"/>-->
-<!--        </el-form-item>-->
+        <!--        <el-form-item label="权重序号" prop="sopIndex">-->
+        <!--          <el-input v-model="form.sopIndex" placeholder="请输入权重序号"/>-->
+        <!--        </el-form-item>-->
 
-<!--        <el-form-item label="SOP名称" prop="sopName">-->
-<!--          <el-input v-model="form.sopName" placeholder="请输入SOP名称"/>-->
-<!--        </el-form-item>-->
-<!--        <el-row>-->
-<!--          <el-col :span="18">-->
-<!--            <el-form-item label="SOP编号" prop="sopCode">-->
-<!--              <el-input-->
-<!--                v-model="form.sopCode"-->
-<!--                placeholder="请输入SOP编号"-->
-<!--              />-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-<!--          <el-col :span="6">-->
-<!--            <el-form-item label-width="30">-->
-<!--              <el-switch-->
-<!--                v-model="autoGenFlag"-->
-<!--                active-color="#13ce66"-->
-<!--                active-text="自动生成"-->
-<!--                @change="handleAutoGenChange(autoGenFlag)"-->
-<!--              >-->
-<!--              </el-switch>-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-<!--        </el-row>-->
+        <!--        <el-form-item label="SOP名称" prop="sopName">-->
+        <!--          <el-input v-model="form.sopName" placeholder="请输入SOP名称"/>-->
+        <!--        </el-form-item>-->
+        <!--        <el-row>-->
+        <!--          <el-col :span="18">-->
+        <!--            <el-form-item label="SOP编号" prop="sopCode">-->
+        <!--              <el-input-->
+        <!--                v-model="form.sopCode"-->
+        <!--                placeholder="请输入SOP编号"-->
+        <!--              />-->
+        <!--            </el-form-item>-->
+        <!--          </el-col>-->
+        <!--          <el-col :span="6">-->
+        <!--            <el-form-item label-width="30">-->
+        <!--              <el-switch-->
+        <!--                v-model="autoGenFlag"-->
+        <!--                active-color="#13ce66"-->
+        <!--                active-text="自动生成"-->
+        <!--                @change="handleAutoGenChange(autoGenFlag)"-->
+        <!--              >-->
+        <!--              </el-switch>-->
+        <!--            </el-form-item>-->
+        <!--          </el-col>-->
+        <!--        </el-row>-->
 
-        <el-form-item label="所属岗位" prop="workstationId" >
-          <treeselect v-model="form.workstationId" :options="marsOptions"  :normalizer="Marsnormalizer" placeholder="选择岗位" @change="handleWorkstationChange"/>
+        <el-form-item label="所属岗位" prop="workstationId">
+          <treeselect
+            v-model="form.workstationId"
+            :options="marsOptions"
+            :normalizer="Marsnormalizer"
+            placeholder="选择岗位"
+            @change="handleWorkstationChange"
+          />
         </el-form-item>
-<!--        <el-form-item label="所属电柜" prop="lotoId">-->
-<!--          <el-select-->
-<!--            style="width: 300px"-->
-<!--            v-model="form.lotoId"-->
-<!--            placeholder="请选择所属电柜"-->
-<!--          >-->
-<!--            <el-option-->
-<!--              v-for="dict in LotoOptions"-->
-<!--              :key="dict.value"-->
-<!--              :label="dict.label"-->
-<!--              :value="dict.value"-->
-<!--            />-->
-<!--          </el-select>-->
-<!--        </el-form-item>-->
-        <el-form-item label="设备/工艺" prop="machineryId" >
-          <treeselect v-model="form.machineryId" :options="machineryOptions"  :normalizer="machinerynormalizer" placeholder="选择设备/工艺"/>
+        <!--        <el-form-item label="所属电柜" prop="lotoId">-->
+        <!--          <el-select-->
+        <!--            style="width: 300px"-->
+        <!--            v-model="form.lotoId"-->
+        <!--            placeholder="请选择所属电柜"-->
+        <!--          >-->
+        <!--            <el-option-->
+        <!--              v-for="dict in LotoOptions"-->
+        <!--              :key="dict.value"-->
+        <!--              :label="dict.label"-->
+        <!--              :value="dict.value"-->
+        <!--            />-->
+        <!--          </el-select>-->
+        <!--        </el-form-item>-->
+        <el-form-item label="设备/工艺" prop="machineryId">
+          <treeselect
+            v-model="form.machineryId"
+            :options="machineryOptions"
+            :normalizer="machinerynormalizer"
+            placeholder="选择设备/工艺"
+          />
         </el-form-item>
 
         <el-form-item label="SOP类型" prop="sopType">
-          <el-select v-model="form.sopType"  placeholder="请选择SOP类型" clearable>
+          <el-select
+            v-model="form.sopType"
+            placeholder="请选择SOP类型"
+            clearable
+          >
             <el-option
               v-for="dict in dict.type.sop_type"
               :key="dict.value"
@@ -194,11 +244,13 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button v-no-more-click type="primary" @click="submitForm">确 定</el-button>
+        <el-button v-no-more-click type="primary" @click="submitForm"
+          >确 定</el-button
+        >
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-<!--    导入文件-->
+    <!--    导入文件-->
     <el-dialog
       :title="upload.title"
       :visible.sync="upload.open"
@@ -230,16 +282,16 @@
             :underline="false"
             style="font-size: 12px; vertical-align: baseline"
             @click="importTemplate"
-          >下载模板</el-link
+            >下载模板</el-link
           >
         </div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click type="primary" @click="submitFileForm"
-        >确 定</el-button
+          >确 定</el-button
         >
         <el-button v-no-more-click @click="upload.open = false"
-        >取 消</el-button
+          >取 消</el-button
         >
       </div>
     </el-dialog>
@@ -248,20 +300,25 @@
 
 <script>
 import {
-  getIsMarsSopPage, addinsertIsMarsSop, updateIsMarsSop, deleteIsMarsSopByMarsSopIds, selectIsMarsSopById,updateIsMarsSopIndexAPI
-} from '@/api/mes/sop/sopindex'
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import { genCode } from '@/api/system/autocode/rule'
-import { listMarsDept } from '@/api/system/marsdept'
-import {listLoto} from '@/api/mes/lotoStation/lotoStation'
-import { listTechnology } from '@/api/system/machinery'
-import Template from '@/views/print/printtemplate/list.vue'
-import { getToken } from '@/utils/auth'
+  getIsMarsSopPage,
+  addinsertIsMarsSop,
+  updateIsMarsSop,
+  deleteIsMarsSopByMarsSopIds,
+  selectIsMarsSopById,
+  updateIsMarsSopIndexAPI,
+} from "@/api/mes/sop/sopindex";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { genCode } from "@/api/system/autocode/rule";
+import { listMarsDept } from "@/api/system/marsdept";
+import { listLoto } from "@/api/mes/lotoStation/lotoStation";
+import { listTechnology } from "@/api/system/machinery";
+import Template from "@/views/print/printtemplate/list.vue";
+import { getToken } from "@/utils/auth";
 
 export default {
-  name: 'Dept',
-  dicts: ['sys_normal_disable','sop_type'],
+  name: "Dept",
+  dicts: ["sys_normal_disable", "sop_type"],
   components: { Template, Treeselect },
   data() {
     return {
@@ -271,7 +328,7 @@ export default {
       autoGenFlag: false,
       // 显示搜索条件
       showSearch: true,
-      isEditing:false,//添加一个标识符
+      isEditing: false, //添加一个标识符
       // 总条数
       total: 0,
       // 表格树数据
@@ -279,13 +336,13 @@ export default {
       // mars树选项
       marsOptions: [],
       //工艺树
-      sopOptions:[],
+      sopOptions: [],
       // 电柜
-      lotoOptions:[],
+      lotoOptions: [],
       // 设备/工艺
-      machineryOptions:[],
+      machineryOptions: [],
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
       // 是否展开,默认全部展开
@@ -294,33 +351,33 @@ export default {
       refreshTable: true,
       // 查询参数
       queryParams: {
-        current:1,
-        size:10,
+        current: 1,
+        size: 10,
         sopName: undefined,
-        sopCode: undefined
+        sopCode: undefined,
       },
-      LotoOptions:[],//电柜绑定
+      LotoOptions: [], //电柜绑定
       // 表单参数
       form: {
-        machineryId: '',
+        machineryId: "",
       },
       // 表单校验
       rules: {
         sopCode: [
-          { required: true, message: 'SOP编码不能为空', trigger: 'blur' }
+          { required: true, message: "SOP编码不能为空", trigger: "blur" },
         ],
         sopName: [
-          { required: true, message: 'SOP名称不能为空', trigger: 'blur' }
+          { required: true, message: "SOP名称不能为空", trigger: "blur" },
+        ],
+        workstationId: [
+          { required: true, message: "岗位不能为空", trigger: "blur" },
         ],
-        workstationId:[
-          { required: true, message: '岗位不能为空', trigger: 'blur' }
+        lotoId: [
+          { required: true, message: "锁定站不能为空", trigger: "blur" },
         ],
-        lotoId:[
-          { required: true, message: '锁定站不能为空', trigger: 'blur' }
+        machineryId: [
+          { required: true, message: "设备/工艺不能为空", trigger: "blur" },
         ],
-        machineryId:[
-          { required: true, message: '设备/工艺不能为空', trigger: 'blur' }
-        ]
       },
       // 用户导入参数
       upload: {
@@ -335,90 +392,104 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/iscs/mars/sop/importSop"
+        url: process.env.VUE_APP_BASE_API + "/iscs/mars/sop/importSop",
       },
-    }
+    };
   },
   created() {
-    this.getList()
-    this.getOtherList()
+    this.getList();
+    this.getOtherList();
   },
-  watch:{
-    "form.workstationId":function(newVal,oldVal){
-
-      if(newVal!==oldVal&&this.form.machineryId&&!this.isEditing){
-        this.form.machineryId=null
+  watch: {
+    "form.workstationId": function (newVal, oldVal) {
+      if (newVal !== oldVal && this.form.machineryId && !this.isEditing) {
+        this.form.machineryId = null;
       }
-      if(newVal){
-        const data={
-          pasge:1,
-          size:-1,
-          workstationId:this.form.workstationId
-        }
+      if (newVal) {
+        const data = {
+          pasge: 1,
+          size: -1,
+          workstationId: this.form.workstationId,
+        };
 
-        listTechnology(data).then(response => {
-          const data=response.data.records.filter((item) =>item.machineryType=='工艺')
-          this.machineryOptions = this.handleTree(data,"machineryId","parentId")
-        })
+        listTechnology(data).then((response) => {
+          const data = response.data.records.filter(
+            (item) => item.machineryType == "工艺"
+          );
+          this.machineryOptions = this.handleTree(
+            data,
+            "machineryId",
+            "parentId"
+          );
+        });
       }
-    }
+    },
   },
   methods: {
     /** 查询部门列表 */
     getList() {
-      this.loading = true
-      getIsMarsSopPage(this.queryParams).then(response => {
+      this.loading = true;
+      getIsMarsSopPage(this.queryParams).then((response) => {
         debugger;
-        this.deptList = response.data.records
+        this.deptList = response.data.records;
         this.total = response.data.total;
-        this.loading = false
-      })
-
+        this.loading = false;
+      });
     },
-    getOtherList(){
-      const data={
-        pasge:1,
-        size:-1
-      }
-      listMarsDept(data).then(response => {
-        this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
-      })
-      listLoto(data).then(response => {
-        this.LotoOptions = response.data.records.map(item => {
+    getOtherList() {
+      const data = {
+        pasge: 1,
+        size: -1,
+      };
+      listMarsDept(data).then((response) => {
+        this.marsOptions = this.handleTree(
+          response.data.records,
+          "workstationId",
+          "parentId"
+        );
+      });
+      listLoto(data).then((response) => {
+        this.LotoOptions = response.data.records.map((item) => {
           return {
             value: item.lotoId,
-            label: item.lotoName
-          }
-        })
-      })
-      listTechnology(data).then(response => {
-        console.log(response,'涉笔啊哈就开始卡机')
-        const data=response.data.records.filter((item) =>item.machineryType=='工艺')
-        console.log(data,'过滤之后')
-        this.machineryOptions = this.handleTree(data,"machineryId","parentId")
-      })
+            label: item.lotoName,
+          };
+        });
+      });
+      listTechnology(data).then((response) => {
+        console.log(response, "涉笔啊哈就开始卡机");
+        const data = response.data.records.filter(
+          (item) => item.machineryType == "工艺"
+        );
+        console.log(data, "过滤之后");
+        this.machineryOptions = this.handleTree(
+          data,
+          "machineryId",
+          "parentId"
+        );
+      });
     },
     /** 转换mars岗位数据结构 */
     Marsnormalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.workstationId,
         label: node.workstationName,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
     /** 转换mars岗位数据结构 */
     machinerynormalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.machineryId,
         label: node.machineryName,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
     handleWorkstationChange(value) {
       // 清空 machineryId
@@ -427,8 +498,8 @@ export default {
     },
     // 取消按钮
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     // 表单重置
     reset() {
@@ -436,15 +507,15 @@ export default {
         sopId: undefined,
         parentId: undefined,
         sopName: undefined,
-      }
+      };
       this.autoGenFlag = false;
-      this.resetForm('form')
+      this.resetForm("form");
     },
     //自动生成编码
     handleAutoGenChange(autoGenFlag) {
       if (autoGenFlag) {
         genCode("SOP_CODE").then((response) => {
-          console.log(response,'设备工艺编码');
+          console.log(response, "设备工艺编码");
           this.form.sopCode = response;
         });
       } else {
@@ -454,81 +525,85 @@ export default {
 
     /** 搜索按钮操作 */
     handleQuery() {
-      this.getList()
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.queryParams.sopName=''
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.queryParams.sopName = "";
+      this.handleQuery();
     },
 
     /** 展开/折叠操作 */
     toggleExpandAll() {
-      this.refreshTable = false
-      this.isExpandAll = !this.isExpandAll
+      this.refreshTable = false;
+      this.isExpandAll = !this.isExpandAll;
       this.$nextTick(() => {
-        this.refreshTable = true
-      })
+        this.refreshTable = true;
+      });
     },
     /** 新增按钮操作 */
     handleAdd(row) {
-      this.reset()
-      this.open = true
-      this.title = '添加SOP'
-
-
+      this.reset();
+      this.open = true;
+      this.title = "添加SOP";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset()
-      this.isEditing = true
-      selectIsMarsSopById(row.sopId).then(response => {
-        this.form = response.data
-        this.open = true
-        setTimeout(()=>{
-          this.isEditing = false
-        },1000)
-        this.title = '修改SOP'
-
-      })
+      this.reset();
+      this.isEditing = true;
+      selectIsMarsSopById(row.sopId).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        setTimeout(() => {
+          this.isEditing = false;
+        }, 1000);
+        this.title = "修改SOP";
+      });
     },
     /** 提交按钮 */
-    submitForm: function() {
-      this.$refs['form'].validate(valid => {
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.sopId != undefined) {
-            updateIsMarsSop(this.form).then(response => {
-              this.$modal.msgSuccess('修改成功')
-              this.open = false
+            updateIsMarsSop(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
 
-              this.getList()
-            })
+              this.getList();
+            });
           } else {
-            addinsertIsMarsSop(this.form).then(response => {
-              this.$modal.msgSuccess('新增成功')
-              this.open = false
-              this.getList()
-            })
+            addinsertIsMarsSop(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
         }
-      })
+      });
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      this.$modal.confirm('是否确认删除名称为"' + row.sopName + '"的数据项?').then(function() {
-        return deleteIsMarsSopByMarsSopIds(row.sopId)
-      }).then(() => {
-        this.getList()
-        this.$modal.msgSuccess('删除成功')
-      }).catch(() => {
-      })
+      this.$modal
+        .confirm('是否确认删除名称为"' + row.sopName + '"的数据项?')
+        .then(function () {
+          return deleteIsMarsSopByMarsSopIds(row.sopId);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('iscs/mars/sop/exportIsMarsSop', {
-        ...this.queryParams
-      }, `sop_${new Date().getTime()}.xlsx`)
+      this.download(
+        "iscs/mars/sop/exportIsMarsSop",
+        {
+          ...this.queryParams,
+        },
+        `sop_${new Date().getTime()}.xlsx`
+      );
     },
     /** 导入按钮操作 */
     handleImport() {
@@ -537,8 +612,11 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      this.download('iscs/mars/sop/importTemplate', {
-      }, `sop_item_${new Date().getTime()}.xlsx`)
+      this.download(
+        "iscs/mars/sop/importTemplate",
+        {},
+        `sop_item_${new Date().getTime()}.xlsx`
+      );
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
@@ -549,7 +627,13 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          "</div>",
+        "导入结果",
+        { dangerouslyUseHTMLString: true }
+      );
       this.getList();
     },
     // 提交上传文件
@@ -557,6 +641,5 @@ export default {
       this.$refs.upload.submit();
     },
   },
-
-}
+};
 </script>

+ 2 - 2
src/views/system/mars/index.vue

@@ -73,7 +73,7 @@
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
 <!--      <el-table-column prop="workstationCode" label="岗位编码" width="260"></el-table-column>-->
-      <el-table-column prop="workstationName" label="岗位名称" width="260"></el-table-column>
+      <el-table-column prop="workstationName" label="岗位名称" width="300"></el-table-column>
       <el-table-column prop="orderNum" label="排序" width="260"></el-table-column>
       <el-table-column prop="status" label="状态" width="260">
         <template slot-scope="scope">
@@ -85,7 +85,7 @@
           ></el-switch>
         </template>
       </el-table-column>
-      <el-table-column prop="workstationType" label="岗位人员" width="260">
+      <el-table-column prop="workstationType" label="岗位人员" width="100">
         <template slot-scope="scope">
           <el-button type="text" @click="HandleLookWorkStation(scope.row)">查看</el-button>
         </template>

+ 6 - 6
src/views/system/role/index.vue

@@ -98,12 +98,12 @@
     </el-row>
 
     <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="角色编号" prop="roleId" width="120" />
-      <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
-      <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
-      <el-table-column label="显示顺序" prop="roleSort" width="100" />
-      <el-table-column label="状态" align="center" width="100">
+      <el-table-column type="selection" width="110" align="center" />
+      <el-table-column label="角色编号" prop="roleId" width="160" />
+      <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="260" />
+      <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="260" />
+      <el-table-column label="显示顺序" prop="roleSort" width="160" />
+      <el-table-column label="状态" align="center" width="160">
         <template slot-scope="scope">
           <el-switch
             v-model="scope.row.status"

+ 220 - 157
src/views/system/unit/index.vue

@@ -1,6 +1,12 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+    >
       <el-form-item label="单位编号" prop="unitId">
         <el-input
           v-model="queryParams.unitId"
@@ -34,34 +40,50 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button v-no-more-click type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
+        <el-button
+          v-no-more-click
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索
         </el-button>
-        <el-button v-no-more-click icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          v-no-more-click
+          icon="el-icon-refresh"
+          size="mini"
+          @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button v-no-more-click
-                   type="primary"
-                   plain
-                   icon="el-icon-plus"
-                   size="mini"
-                   @click="handleAdd"
-                   v-hasPermi="['iscs:unit:add']"
-        >新增
+        <el-button
+          v-no-more-click
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['iscs:unit:add']"
+          >新增
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button v-no-more-click-->
-<!--                   type="info"-->
-<!--                   plain-->
-<!--                   icon="el-icon-sort"-->
-<!--                   size="mini"-->
-<!--                   @click="toggleExpandAll"-->
-<!--        >展开/折叠-->
-<!--        </el-button>-->
-<!--      </el-col>-->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button v-no-more-click-->
+      <!--                   type="info"-->
+      <!--                   plain-->
+      <!--                   icon="el-icon-sort"-->
+      <!--                   size="mini"-->
+      <!--                   @click="toggleExpandAll"-->
+      <!--        >展开/折叠-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
     <el-table
@@ -70,14 +92,30 @@
       :data="deptList"
       row-key="unitId"
       :default-expand-all="isExpandAll"
-      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
     >
-      <el-table-column prop="unitId" label="单位编号" width="260"></el-table-column>
-      <el-table-column prop="unitName" label="单位名称" width="260"></el-table-column>
-      <el-table-column prop="unitType" label="单位类型" width="260"></el-table-column>
-      <el-table-column prop="orderNum" label="排序" width="260"></el-table-column>
-      <el-table-column prop="remark" label="备注" ></el-table-column>
-      <el-table-column prop="status" label="状态" width="260">
+      <el-table-column
+        prop="unitId"
+        label="单位编号"
+        width="130"
+      ></el-table-column>
+      <el-table-column
+        prop="unitName"
+        label="单位名称"
+        width="260"
+      ></el-table-column>
+      <el-table-column
+        prop="unitType"
+        label="单位类型"
+        width="260"
+      ></el-table-column>
+      <el-table-column
+        prop="orderNum"
+        label="排序"
+        width="200"
+      ></el-table-column>
+      <el-table-column prop="remark" label="备注" width="260"></el-table-column>
+      <el-table-column prop="status" label="状态" width="150">
         <template slot-scope="scope">
           <el-switch
             v-model="scope.row.status"
@@ -87,38 +125,43 @@
           ></el-switch>
         </template>
       </el-table-column>
-<!--      <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
-<!--        <template slot-scope="scope">-->
-<!--          <span>{{ scope.row.createTime }}</span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <!--      <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <span>{{ scope.row.createTime }}</span>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
-          <el-button v-no-more-click
-                     size="mini"
-                     type="text"
-                     icon="el-icon-edit"
-                     @click="handleUpdate(scope.row)"
-                     v-hasPermi="['iscs:unit:edit']"
-          >修改
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['iscs:unit:edit']"
+            >修改
           </el-button>
-<!--          <el-button v-no-more-click-->
-<!--                     size="mini"-->
-<!--                     type="text"-->
-<!--                     icon="el-icon-plus"-->
-<!--                     @click="handleAdd(scope.row)"-->
-<!--                     v-hasPermi="['iscs:unit:add']"-->
-<!--          >新增-->
-<!--          </el-button>-->
-<!--          v-if="scope.row.parentId != 0"-->
-          <el-button v-no-more-click
-
-                     size="mini"
-                     type="text"
-                     icon="el-icon-delete"
-                     @click="handleDelete(scope.row)"
-                     v-hasPermi="['iscs:unit:remove']"
-          >删除
+          <!--          <el-button v-no-more-click-->
+          <!--                     size="mini"-->
+          <!--                     type="text"-->
+          <!--                     icon="el-icon-plus"-->
+          <!--                     @click="handleAdd(scope.row)"-->
+          <!--                     v-hasPermi="['iscs:unit:add']"-->
+          <!--          >新增-->
+          <!--          </el-button>-->
+          <!--          v-if="scope.row.parentId != 0"-->
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['iscs:unit:remove']"
+            >删除
           </el-button>
         </template>
       </el-table-column>
@@ -133,12 +176,11 @@
     <!-- 添加或修改单位对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-
-<!--        <el-form-item label="上级" prop="parentId" v-if="form.parentId !== 0">-->
-<!--          <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级"/>-->
-<!--        </el-form-item>-->
+        <!--        <el-form-item label="上级" prop="parentId" v-if="form.parentId !== 0">-->
+        <!--          <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级"/>-->
+        <!--        </el-form-item>-->
         <el-form-item label="单位名称" prop="unitName">
-          <el-input v-model="form.unitName" placeholder="请输入单位名称"/>
+          <el-input v-model="form.unitName" placeholder="请输入单位名称" />
         </el-form-item>
         <el-form-item label="单位类型" prop="unitType">
           <el-radio-group v-model="form.unitType">
@@ -152,7 +194,8 @@
               v-for="dict in dict.type.sys_normal_disable"
               :key="dict.value"
               :label="dict.value"
-            >{{dict.label}}</el-radio>
+              >{{ dict.label }}</el-radio
+            >
           </el-radio-group>
         </el-form-item>
         <el-form-item label="排序" prop="orderNum">
@@ -164,7 +207,9 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button v-no-more-click type="primary" @click="submitForm">确 定</el-button>
+        <el-button v-no-more-click type="primary" @click="submitForm"
+          >确 定</el-button
+        >
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -173,16 +218,20 @@
 
 <script>
 import {
-  listUnit,getUnitInfo,addUnit,updateUnit,delUnit,
-} from '@/api/system/unit'
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import { genCode } from '@/api/system/autocode/rule'
-import { updateMarsDeptStatus } from '@/api/system/marsdept'
+  listUnit,
+  getUnitInfo,
+  addUnit,
+  updateUnit,
+  delUnit,
+} from "@/api/system/unit";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { genCode } from "@/api/system/autocode/rule";
+import { updateMarsDeptStatus } from "@/api/system/marsdept";
 
 export default {
-  name: 'Dept',
-  dicts: ['sys_normal_disable'],
+  name: "Dept",
+  dicts: ["sys_normal_disable"],
   components: { Treeselect },
   data() {
     return {
@@ -192,13 +241,13 @@ export default {
       autoGenFlag: false,
       // 显示搜索条件
       showSearch: true,
-      total:0,//
+      total: 0, //
       // 表格树数据
       deptList: [],
       // 单位树选项
       deptOptions: [],
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
       // 是否展开,默认全部展开
@@ -207,12 +256,12 @@ export default {
       refreshTable: true,
       // 查询参数
       queryParams: {
-        current:1,
-        size:10,
+        current: 1,
+        size: 10,
         unitName: undefined,
-        userId:undefined,
-        unitId:undefined,
-        status:undefined,
+        userId: undefined,
+        unitId: undefined,
+        status: undefined,
       },
       // 表单参数
       form: {},
@@ -222,60 +271,68 @@ export default {
         //   { required: true, message: '上级不能为空', trigger: 'blur' }
         // ],
         unitName: [
-          { required: true, message: '单位名称不能为空', trigger: 'blur' }
+          { required: true, message: "单位名称不能为空", trigger: "blur" },
         ],
-      }
-    }
+      },
+    };
   },
 
   created() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 用户状态修改
     handleStatusChange(row) {
       let text = row.status === "0" ? "启用" : "停用";
-      this.$modal.confirm('确认要"' + text + '""' + row.unitName + '"岗位吗?').then(function() {
-        const data={
-          unitId:row.unitId,
-          unitName:row.unitName,
-          unitType:row.unitType,
-          orderNum:row.orderNum,
-          status:row.status,
-        }
-        return updateUnit(data);
-      }).then(() => {
-        this.$modal.msgSuccess(text + "成功");
-      }).catch(function() {
-        row.status = row.status === "0" ? "1" : "0";
-      });
+      this.$modal
+        .confirm('确认要"' + text + '""' + row.unitName + '"岗位吗?')
+        .then(function () {
+          const data = {
+            unitId: row.unitId,
+            unitName: row.unitName,
+            unitType: row.unitType,
+            orderNum: row.orderNum,
+            status: row.status,
+          };
+          return updateUnit(data);
+        })
+        .then(() => {
+          this.$modal.msgSuccess(text + "成功");
+        })
+        .catch(function () {
+          row.status = row.status === "0" ? "1" : "0";
+        });
     },
     /** 查询单位列表 */
     getList() {
-      this.loading = true
-      listUnit(this.queryParams).then(response => {
+      this.loading = true;
+      listUnit(this.queryParams).then((response) => {
         debugger;
-        this.deptList = this.handleTree(response.data.records,"unitId","parentId")
-        console.log(this.deptList,'单位列表')
-        this.loading = false
-        this.total=response.data.total
-      })
+        this.deptList = this.handleTree(
+          response.data.records,
+          "unitId",
+          "parentId"
+        );
+        console.log(this.deptList, "单位列表");
+        this.loading = false;
+        this.total = response.data.total;
+      });
     },
     /** 转换单位数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.unitId,
         label: node.unitName,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
     // 取消按钮
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     // 表单重置
     reset() {
@@ -283,85 +340,91 @@ export default {
         unitId: undefined,
         parentId: undefined,
         unitName: undefined,
-      }
+      };
       this.autoGenFlag = false;
-      this.resetForm('form')
+      this.resetForm("form");
     },
 
     /** 搜索按钮操作 */
     handleQuery() {
-      this.getList()
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
     /** 新增按钮操作 */
     handleAdd(row) {
-      this.reset()
+      this.reset();
       if (row != null && row.unitId) {
         this.form.parentId = row.unitId;
       } else {
         this.form.parentId = 0;
       }
-      this.open = true
-      this.title = '添加单位'
-      listUnit(this.queryParams).then(response => {
-        this.deptOptions = this.handleTree(response.data.records,"unitId","parentId")
-      })
+      this.open = true;
+      this.title = "添加单位";
+      listUnit(this.queryParams).then((response) => {
+        this.deptOptions = this.handleTree(
+          response.data.records,
+          "unitId",
+          "parentId"
+        );
+      });
     },
     /** 展开/折叠操作 */
     toggleExpandAll() {
-      this.refreshTable = false
-      this.isExpandAll = !this.isExpandAll
+      this.refreshTable = false;
+      this.isExpandAll = !this.isExpandAll;
       this.$nextTick(() => {
-        this.refreshTable = true
-      })
+        this.refreshTable = true;
+      });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset()
-      getUnitInfo(row.unitId).then(response => {
-        this.form = response.data
+      this.reset();
+      getUnitInfo(row.unitId).then((response) => {
+        this.form = response.data;
         if (this.form.parentId == 0) {
-          this.form.parentId = undefined
+          this.form.parentId = undefined;
         }
-        this.open = true
-        this.title = '修改单位'
-      })
-
+        this.open = true;
+        this.title = "修改单位";
+      });
     },
     /** 提交按钮 */
-    submitForm: function() {
-      this.$refs['form'].validate(valid => {
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.unitId != undefined) {
-            updateUnit(this.form).then(response => {
-              this.$modal.msgSuccess('修改成功')
-              this.open = false
-              this.getList()
-            })
+            updateUnit(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
           } else {
-            addUnit(this.form).then(response => {
-              this.$modal.msgSuccess('新增成功')
-              this.open = false
-              this.getList()
-            })
+            addUnit(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
         }
-      })
+      });
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      this.$modal.confirm('是否确认删除名称为"' + row.unitName + '"的数据项?').then(function() {
-        return delUnit(row.unitId)
-      }).then(() => {
-        this.getList()
-        this.$modal.msgSuccess('删除成功')
-      }).catch(() => {
-      })
-    }
-  }
-}
+      this.$modal
+        .confirm('是否确认删除名称为"' + row.unitName + '"的数据项?')
+        .then(function () {
+          return delUnit(row.unitId);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+  },
+};
 </script>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff