This commit is contained in:
shijing 2022-04-21 15:23:10 +08:00
parent 48d7ebb85c
commit 0a6a9ed729
2 changed files with 43 additions and 44 deletions

View File

@ -113,6 +113,20 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="表单模板" prop="template">
<el-upload
ref="upload"
:action="upUrl"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept=".docx"
>
<el-button size="small" type="primary">上传模板</el-button>
</el-upload>
</el-form-item>
<el-form-item label="是否启用" prop="name">
<el-switch v-model="recordform.enabled"></el-switch>
</el-form-item>
@ -519,9 +533,8 @@
import {upFile} from "@/api/file";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
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';
const defaultstep = {
name: "",
number: "",
@ -709,6 +722,19 @@
});
},
methods: {
/* handlePreview(file) {
if ("url" in file) {
window.open(file.url);
} else {
window.open(file.response.data.path);
}
},*/
handleUpSuccess(res) {
this.recordform.export_template = res.data.path;
},
handleRemove() {
this.recordform.export_template = '';
},
formFunc(value) {
this.dialogVisibleForm = value;
},
@ -927,6 +953,14 @@
this.recordform = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
if (this.recordform.export_template) {
this.fileList = [
{
name: this.recordform.export_template,
url: this.recordform.export_template,
},
];
}
this.$nextTick(() => {
this.$refs["Forms"].clearValidate();
});
@ -979,6 +1013,7 @@
obj.name=this.recordform.name;
obj.type=this.recordform.type;
obj.enabled=this.recordform.enabled;
obj.export_template=this.recordform.export_template?this.recordform.export_template:'';
if (isEdit) {
obj.form=this.recordform.form?this.recordform.form:null;
updaterecordform(this.recordform.id, obj).then(

View File

@ -713,47 +713,11 @@
</el-dialog>
<!--已完成检查表查看-->
<el-dialog
:title="formName"
:visible.sync="recordFinishedVisible"
:close-on-click-modal="false"
id="showForm"
>
<div id="pdfDom" class="report" ref="report" style="padding: 30px;">
<div style="height: 40px;line-height:40px;text-align: center;font-size: 20px;font-weight: bold">{{formName}}
</div>
<div style="overflow: hidden;border-top: 1px solid #000000;border-left: 1px solid #000000;
border-right: 1px solid #000000;box-sizing: border-box">
<div
style="height: 40px;line-height: 40px;padding-left: 20px;width: 50%;float: left;border-right: 1px solid #000000;border-bottom: 1px solid #000000;">
<span
style="width: 150px;display: inline-block;font-size: 14px;color: #606266;font-weight: 600;border-right: 1px solid #000000;">操作人</span>
<span>{{create_by_}}</span>
</div>
<div
style="height: 40px;line-height: 40px;padding-left: 20px;width: 50%;float: left;border-right: 1px solid #000000;border-bottom: 1px solid #000000;">
<span
style="width: 150px;display: inline-block;font-size: 14px;color: #606266;font-weight: 600;border-right: 1px solid #000000;">操作时间</span>
<span>{{update_time}}</span>
</div>
<div v-for="item in fieldList" :key="item.id" style="width: 50%;display: inline-block;float: left;">
<div
v-if="item.field_type!=='draw'&&item.field_value!==null&&item.field_value!==''"
style="height: 40px;line-height: 40px;padding-left: 20px;border-right: 1px solid #000000;border-bottom: 1px solid #000000;"
>
<span
style="width: 150px;display: inline-block;font-size: 14px;color: #606266;font-weight: 600;border-right: 1px solid #000000;">{{item.field_name}}</span>
<span>{{item.field_value}}</span>
</div>
</div>
<div v-for="item in fieldList" :key="item.id" style="width: 100%;display: inline-block;float: left;">
<div v-if="item.field_type==='draw'"
style="height: 400px;border-bottom: 1px solid #000000;border-right: 1px solid #000000;">
<span style="font-size: 14px;color: #606266;font-weight: 600;">{{item.field_name}}</span>
<img style="width: 45%;vertical-align: text-top;" :src="'http://49.232.14.174:2222'+item.field_value"/>
</div>
</div>
</div>
</div>
<!--<el-row id="pdfDom">
<el-row>
<el-col :span="12">
<div class="items">
<span class="itemLabel">操作人</span>
@ -773,13 +737,13 @@
</div>
</el-col>
<el-col v-for="item in fieldList" :key="item.id" :span="24">
<div class="items" v-if="item.field_type==='draw'" style="height: 400px">
<div class="items" v-if="item.field_type==='draw'" style="height: fit-content">
<span class="itemLabel">{{item.field_name}}</span>
<img style="width: 45%;vertical-align: text-top;" :src="'http://49.232.14.174:2222'+item.field_value"/>
</div>
</el-col>
</el-row>-->
<el-button @click="exportDom">导出</el-button>
<el-button @click="exportDom">导出</el-button>
</el-row>
</el-dialog>
<!--刷脸验证-->
<el-dialog :visible.sync="limitedPhoto" @close="closeCamera" id="loginFaceWrap">