优化合同插入字段

This commit is contained in:
shane 2021-11-15 11:39:54 +08:00
parent cdc08d1933
commit 6fb41cd2fc
3 changed files with 57 additions and 2 deletions

View File

@ -8,6 +8,11 @@
</div>
</div>
<div class="ibox-content">
<div class="form-group row">
<button v-for="(item,index) in contractTypeManageInfo.contractTypeAttrs" class="btn btn-primary float-right" style="margin-right: 10px;" type="button" v-on:click="insertAttrs(item)">
{{item}}
</button>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">模板内容</label>
<div class="col-sm-10 ">
@ -16,7 +21,6 @@
</div>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button" v-on:click="saveTemplateInfo()"><i
class="fa fa-check"></i>&nbsp;提交

View File

@ -71,6 +71,9 @@
});
},
insertAttrs: function (_attr) {
$('.summernote').summernote('editor.insertText',_attr)
},
clearaddTemplateViewInfo: function () {
vc.component.addTemplateViewInfo = {
contractTypeId: '',

View File

@ -8,6 +8,9 @@
data: {
contractTypeManageInfo: {
contractTypes: [],
contractTypeAttrs: [],
contractTypeSpec: '',
templatecontent: '',
total: 0,
records: 1,
moreCondition: false,
@ -38,7 +41,6 @@
},
methods: {
_listContractTypes: function (_page, _rows) {
vc.component.contractTypeManageInfo.conditions.page = _page;
vc.component.contractTypeManageInfo.conditions.row = _rows;
var param = {
@ -78,8 +80,54 @@
_openContractTypeSpecModel: function (_contractType) {
vc.jumpToPage('/admin.html#/pages/admin/contractTypeSpecManage?contractTypeId=' + _contractType.contractTypeId);
},
_loadContractAttrs: function (_contractTypeId) {
var param = {
params: {
page: 1,
row: 1,
contractTypeId: _contractTypeId
}
};
//发送模板get请求
vc.http.apiGet('/contract/printContractTemplate',
param,
function (json, res) {
let _info = JSON.parse(json);
let _data = _info.data;
$that.contractTypeManageInfo.contractTypeAttrs = [];
// 合同信息
$that.contractdata = _data.contract[0];
//合同属性
$that.contractTypeManageInfo.contractTypeSpec = _data.contractTypeSpec;
$that.contractTypeManageInfo.contractTypeSpec.forEach(function (e) {
let rname = e.specName;
let reg = '#' + rname + '#';
$that.contractTypeManageInfo.contractTypeAttrs.push(reg);
});
//基本属性
$that.baseRepalce = _data.baseRepalce;
if ($that.baseRepalce) {
$that.baseRepalce.forEach(function (e) {
let rname = e.name;
let rkey = e.key;
var contractarr = Object.keys($that.contractdata);
for (var a in contractarr) {
if (rkey == contractarr[a]) {
let reg = '#' + rname + '#';
$that.contractTypeManageInfo.contractTypeAttrs.push(reg);
}
}
});
}
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openContractTemplate: function (_contractType) {
$that.contractTypeManageInfo.componentShow = '';
vc.component._loadContractAttrs(_contractType.contractTypeId);
vc.emit('addTemplateView', 'openTemplate', _contractType);
},
_moreCondition: function () {