ソースを参照

Merge branch 'V0.0.4' of http://10.87.21.221:8000/jzyd_yyds/soc_web into V0.0.4

jiawuxian 1 年間 前
コミット
721e8661de

+ 8 - 2
src/views/safetyBook/dialog.des.vue

@@ -59,7 +59,7 @@
               labelClassName="gx_info_label"
               label="签署责任书类型"
             >
-              {{ formData.type }}
+              {{ getLabel(dict.type.safety_book_type, formData.type) }}
             </el-descriptions-item>
             <!-- <el-form-item prop="type" label="签署责任书类型:">
               <el-select
@@ -103,9 +103,13 @@
           <el-table-column prop="files" label="签署文件">
             <template slot-scope="r">
               <el-image
+                v-for="(image, index) in [r.row.files]"
+                :key="index"
                 style="width: 50px; height: 50px"
-                :src="r.row.files"
+                :src="image"
                 :preview-src-list="[r.row.files]"
+                v-if="index === 0"
+                fit="contain"
               ></el-image>
             </template>
           </el-table-column>
@@ -129,6 +133,7 @@
 
 <script>
 import { mapState, mapMutations } from "vuex";
+import { getLabel } from "@/views/commonOption.js";
 import {
   listSafetyBook,
   getSafetyBook,
@@ -174,6 +179,7 @@ export default {
     ...mapState([]),
   },
   methods: {
+    getLabel,
     ...mapMutations([]),
     dayjs,
     //添加签署后回调

+ 43 - 37
src/views/safetyBook/dialog.edit.vue

@@ -27,15 +27,15 @@
             />
           </el-form-item>
           <el-form-item label="所属年度:" prop="year">
-                <el-date-picker
-                  v-model="formData.year"
-                  :clearable="timeClearable"
-                  type="year"
-                  placeholder="请选择责任书所属年度"
-                  value-format="yyyy"
-                >
-                </el-date-picker>
-              </el-form-item>
+            <el-date-picker
+              v-model="formData.year"
+              :clearable="timeClearable"
+              type="year"
+              placeholder="请选择责任书所属年度"
+              value-format="yyyy"
+            >
+            </el-date-picker>
+          </el-form-item>
           <el-form-item prop="type" label="签署责任书类型:">
             <el-select
               v-model="formData.type"
@@ -53,7 +53,11 @@
         </el-form>
         <el-button @click="openSelect">上传签署文件</el-button>
 
-        <el-table :data="tableData" style="width: 100%;margin-top: 10px;" height="500px">
+        <el-table
+          :data="tableData"
+          style="width: 100%; margin-top: 10px"
+          height="500px"
+        >
           <el-table-column prop="names" label="签署人">
             <template slot-scope="scope">
               <template v-for="item in scope.row.names">
@@ -62,24 +66,26 @@
               </template>
             </template>
           </el-table-column>
-          <el-table-column prop="time" label="签署时间"> 
+          <el-table-column prop="time" label="签署时间">
             <template slot-scope="r">
-                {{
-                  r.row.time
-                    ? dayjs(r.row.time).format("YYYY年-MM月-DD日")
-                    : ""
-                }}
-              </template> 
+              {{
+                r.row.time ? dayjs(r.row.time).format("YYYY年-MM月-DD日") : ""
+              }}
+            </template>
           </el-table-column>
           <el-table-column prop="files" label="签署文件">
             <template slot-scope="r">
-            <el-image
-              style="width: 50px; height: 50px"
-              :src="r.row.files"
-              :preview-src-list="[r.row.files]"
-            ></el-image>
-          </template>
-             </el-table-column>
+              <el-image
+                v-for="(image, index) in r.row.files.split(',')"
+                :key="index"
+                style="width: 50px; height: 50px"
+                :src="image"
+                :preview-src-list="r.row.files.split(',')"
+                v-if="index === 0"
+                fit="contain"
+              ></el-image>
+            </template>
+          </el-table-column>
 
           <el-table-column prop="names" label="操作">
             <template v-slot="{ row }">
@@ -90,13 +96,12 @@
         </el-table>
       </div>
 
-      <div slot="footer" class="dialog-footer" style="margin-top: 10px;">
+      <div slot="footer" class="dialog-footer" style="margin-top: 10px">
         <el-button @click="isShow = false">取消</el-button>
         <el-button type="primary" @click="onSubmit">确定</el-button>
       </div>
-   </DialogCom>
+    </DialogCom>
     <DialogSelect ref="DialogSelect" @success="getSign"></DialogSelect>
-  
   </div>
 </template>
 
@@ -133,19 +138,20 @@ export default {
   watch: {},
   computed: {
     ...mapState([]),
+
   },
   methods: {
     ...mapMutations([]),
     dayjs,
     //添加签署后回调
-    getSign(data) {
+    getSign(data,row) {
+      this.tableData = this.tableData.filter((item) => item !== row);
       this.tableData.push(data);
       // console.log(data, "ddd");
     },
     editII(row) {
-      
       this.$refs.DialogSelect.show(row);
-      this.tableData = this.tableData.filter((item) => item !== row);
+      // this.tableData = this.tableData.filter((item) => item !== row);
     },
     //新增签署
     openSelect() {
@@ -175,23 +181,23 @@ export default {
       return {
         id: null,
         type: null,
-        year:null,
+        year: null,
       };
     },
     async refresh(id) {
-      if(id!=null&&id!=undefined){
+      if (id != null && id != undefined) {
         await getSafetyBook(id).then((res) => {
           // console.log(res.data,"res")
-          this.formData=res.data;
-          this.tableData=res.data.bookUsers;
+          this.formData = res.data;
+          this.tableData = res.data.bookUsers;
         });
       }
     },
     async show(id) {
       // console.log(id, "id");
       this.getDeptTree();
-      this.formData=this.reset();
-      this.tableData=[];
+      this.formData = this.reset();
+      this.tableData = [];
       this.id = id;
       await this.refresh(id);
       this.isShow = true;
@@ -206,7 +212,7 @@ export default {
       // console.log(this.formData,"this.formData")
       this.$refs.form.validate(async (isValidate) => {
         if (!isValidate) return;
-        this.formData.bookUsers=this.tableData;
+        this.formData.bookUsers = this.tableData;
         await editOrAdd(this.formData);
         this.$emit("success");
         this.isShow = false;

+ 5 - 1
src/views/safetyBook/dialog.sign.vue

@@ -64,6 +64,7 @@ import UserSelector from "@/components/userSelector/index.vue";
 export default {
   data() {
     return {
+      tem:null,
       id: null,
       isShow: false,
       formData: this.reset(),
@@ -100,6 +101,8 @@ export default {
     },
     //用户选择
     selectUser(event) {
+      
+      console.log("ww")
     //   event.preventDefault();
       this.$refs.UserSelector.show();
     },
@@ -114,6 +117,7 @@ export default {
       };
     },
     async show(row) {
+      this.tem=row;
       console.log(row);
       if(row!=undefined&&row!=null){
         this.id = row.id;
@@ -134,7 +138,7 @@ export default {
     onSubmit() {
       this.$refs.form.validate(async (isValidate) => {
         if (!isValidate) return;
-        this.$emit("success", this.formData);
+        this.$emit("success", this.formData,this.tem);
         this.isShow = false;
       });
     },