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