Browse Source

修改合同模板的分页列表、新增、详情页面的方法

master
yunuo970428 3 years ago
parent
commit
671caf24ac
  1. 2
      anrui-buscenter/anrui-buscenter-ui/src/styles/index.scss
  2. 230
      anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanli.vue
  3. 239
      anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanliAdd.vue
  4. 49
      anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanliInfo.vue

2
anrui-buscenter/anrui-buscenter-ui/src/styles/index.scss

@ -178,7 +178,7 @@ div:focus {
border-right: 1px solid $table-border-color; border-right: 1px solid $table-border-color;
border-bottom: 1px solid $table-border-color; border-bottom: 1px solid $table-border-color;
padding: 5px 15px 5px 15px !important; padding: 5px 15px 5px 15px !important;
height: 48px; min-height: 50px;
line-height: 1; line-height: 1;
.el-form-item{ .el-form-item{
margin-bottom: 0; margin-bottom: 0;

230
anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanli.vue

@ -1,15 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-show="visible"> <div v-show="viewState == 1">
<div class="tab-header webtop"> <div class="tab-header webtop">
<div>合同模板管理</div> <div>合同模板管理</div>
<div> <div>
<el-button type="primary" size="small" @click="handleCreate()">新增</el-button> <el-button type="primary" size="small" @click="handleCreate()">新增</el-button>
<el-button type="primary" size="small" @click="handleUpdate()">编辑</el-button> <el-button type="primary" size="small" @click="handleUpdate()">编辑</el-button>
<el-button type="danger" size="small" @click="handleDelete()">删除</el-button> <el-button type="danger" size="small" @click="handleDelete()">删除</el-button>
<el-button type="success" size="small" @click="handleDaoRu()">导入</el-button> <!-- <el-button type="success" size="small" @click="handleDaoRu()">导入</el-button>-->
<el-button type="success" size="small" @click="handleDaoChu()">导出</el-button> <!-- <el-button type="success" size="small" @click="handleDaoChu()">导出</el-button>-->
<!-- <el-button type="info" size="small" @click="handleReturn()">返回</el-button> -->
</div> </div>
</div> </div>
<div class="webcon"> <div class="webcon">
@ -19,22 +18,17 @@
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header"> <el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="合同类型" class="searchlist"> <el-form-item label="合同类型" class="searchlist">
<el-select v-model="listQuery.params.contractTypeKey" placeholder="请选择" class="filter-item"> <el-select v-model="listQuery.params.contractTypeKey" placeholder="请选择" class="filter-item">
<el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" <el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
:value="item.dictKey"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="人员类型" class="searchlist"> <el-form-item label="人员类型" class="searchlist">
<el-select v-model="listQuery.params.objectTypeKey" placeholder="请选择" class="filter-item"> <el-select v-model="listQuery.params.objectTypeKey" placeholder="请选择" class="filter-item">
<el-option v-for="items in personnelTypeList" :key="items.dictKey" :label="items.dictValue" <el-option v-for="items in personnelTypeList" :key="items.dictKey" :label="items.dictValue" :value="items.dictKey"/>
:value="items.dictKey"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="项目类型" class="searchlist"> <el-form-item label="项目类型" class="searchlist">
<el-select v-model="listQuery.params.projectTypeKey" placeholder="请选择" class="filter-item"> <el-select v-model="listQuery.params.projectTypeKey" placeholder="请选择" class="filter-item">
<el-option v-for="ite in projectTypeList" :key="ite.dictKey" :label="ite.dictValue" <el-option v-for="ite in projectTypeList" :key="ite.dictKey" :label="ite.dictValue" :value="ite.dictKey"/>
:value="ite.dictKey"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="文件名称" class="searchlist"> <el-form-item label="文件名称" class="searchlist">
@ -47,18 +41,15 @@
<el-button type="primary" @click="handleFilter">查询</el-button> <el-button type="primary" @click="handleFilter">查询</el-button>
<el-button type="primary" @click="handleReset">重置</el-button> <el-button type="primary" @click="handleReset">重置</el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
</div> </div>
<div class="listtop"> <div class="listtop">
<div class="tit">合同模板列表</div> <div class="tit">合同模板列表</div>
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
class="pagination" @pagination="getList"/>
</div> </div>
<div class=""> <div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%" <el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange">
@selection-change="handleSelectionChange">
<el-table-column width="50px" type="selection" align="center"/> <el-table-column width="50px" type="selection" align="center"/>
<el-table-column width="80px" label="编号" type="index" :index="indexMethod" align="center"/> <el-table-column width="80px" label="编号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="合同类型" align="center"> <el-table-column label="合同类型" align="center">
@ -68,7 +59,7 @@
</el-table-column> </el-table-column>
<el-table-column label="文件名称" align="center"> <el-table-column label="文件名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.fileName }}</span> <span>{{ scope.row.fileName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文件类型" align="center"> <el-table-column label="文件类型" align="center">
@ -106,36 +97,21 @@
<div class="pages"> <div class="pages">
<div class="tit"/> <div class="tit"/>
<!-- 翻页 --> <!-- 翻页 -->
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" <pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
class="pagination" @pagination="getList"/>
</div> </div>
</div> </div>
</div> </div>
<hetongmobanguanli-add v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="restState"/>
<el-dialog title="查看" :visible.sync="contractPdfView" width="45%" height="320"> <hetongmobanguanli-info v-show="viewState == 4" ref="divInfo" @doback="restState"/>
<embed v-show="pdfShow" id="plugin" width="100%" height="600" name="plugin" :src="contractPdf"
type="application/pdf" internalinstanceid="119">
<el-image v-for="url in pictureUrls" v-show="imageShow" :key="url" :src="url" lazy
style="width:200px;height:200px" :preview-src-list="pictureUrls"/>
</el-dialog>
<!-- <el-dialog style="margin-top: -15vh!important;" width="60%" :append-to-body="true" :visible.sync="contractPdfView" title="">-->
<!-- <embed id="plugin" width="100%" height="600" name="plugin" :src="contractPdf" type="application/pdf" internalinstanceid="119">-->
<!-- </el-dialog>-->
<hetongmobanguanli-add ref="addAndUpdate" @handleReturn="visible = true" @created="dataCreated"
@updated="dataUpdated"/>
<hetongmobanguanli-info ref="openInfo" @handleReturn="visible = true"/>
</div> </div>
</template> </template>
<script> <script>
import {mapGetters} from 'vuex'
import { import {
getTemplatePageList, getTemplatePageList,
deleteTemplateByids, deleteTemplateByids,
basefinbankTemplateExportExcel, basefinbankTemplateExportExcel
} from '@/api/jichuxinxi/contract' } from '@/api/jichuxinxi/contract'
// import { setuser, getuser } from '@/utils/baocun'
import { dictType } from '@/api/salesManagement/orderManagement' import { dictType } from '@/api/salesManagement/orderManagement'
import Pagination from '@/components/pagination' import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye' import pageye from '@/components/pagination/pageye'
@ -148,27 +124,20 @@
Pagination, Pagination,
pageye, pageye,
hetongmobanguanliAdd, hetongmobanguanliAdd,
hetongmobanguanliInfo, hetongmobanguanliInfo
}, },
data() { data() {
return { return {
pictureUrls: [],
pdfShow: false,
imageShow: false,
contractPdfView: false,
contractPdf: '',
projectTypeList: [], projectTypeList: [],
typeList: [], typeList: [],
personnelTypeList: [], personnelTypeList: [],
isSearchShow: false, isSearchShow: false,
viewState: 1,
searchxianshitit: '隐藏查询条件', searchxianshitit: '隐藏查询条件',
// ----------- // -----------
tableKey: 0, tableKey: 0,
sids: [], sids: [],
// list: [], list: [],
list: [{name: '123'}],
total: 1,
FormLoading: false,
listLoading: false, listLoading: false,
listQuery: { listQuery: {
current: 1, current: 1,
@ -178,49 +147,36 @@
objectType: '', objectType: '',
projectType: '', projectType: '',
fileName: '', fileName: '',
ver: '', ver: ''
}, },
}, total: 0
selectDate: undefined, }
temp: {}, //
templook: {}, //
dialogStatus: '', //
visible: true,
} }
}, },
computed: {},
created() { created() {
// //
this.getList() this.getList()
this.getType() this.DictType()
this.getPeopleType()
this.getProjectTypes()
}, },
methods: { methods: {
handleCheck(row) { DictType() {
// this.pdfShow = false dictType({ type: 'contractType' }).then((response) => {
this.imageShow = true if (response.code === '200' && response.data) {
this.pictureUrls = [] this.typeList = response.data
const da = row.templateUrl.split(',')
da.forEach((e) => {
if (e.endsWith('pdf')) {
this.contractPdf = e
} else if (e !== '') {
this.pictureUrls.push(e)
console.log('88888', this.pictureUrls)
} }
}) })
if (row.templateUrl && row.templateUrl !== '') { //
this.contractPdfView = true dictType({ type: 'personnelType' }).then((response) => {
this.contractPdf = row.templateUrl if (response.code === '200' && response.data) {
} else { this.personnelTypeList = response.data
this.$notify({ }
title: '提示',
message: '没有文件!!',
type: 'warning',
duration: 2000,
}) })
//
dictType({ type: 'projectType' }).then((response) => {
if (response.code === '200' && response.data) {
this.projectTypeList = response.data
} }
})
}, },
// //
clicksearchShow() { clicksearchShow() {
@ -237,51 +193,17 @@
var pageindex = index + 1 + pagestart var pageindex = index + 1 + pagestart
return pageindex return pageindex
}, },
// //
getList() { getList() {
this.listLoading = true this.listLoading = true
getTemplatePageList({ getTemplatePageList(this.listQuery).then((response) => {
current: this.listQuery.current,
size: this.listQuery.size,
params: this.listQuery.params,
}).then((response) => {
this.listLoading = false this.listLoading = false
if ( if (response.code === '200' && response.data && response.data.total > 0) {
response.code === '200' &&
response.data &&
response.data.total > 0
) {
this.list = response.data.records this.list = response.data.records
this.total = response.data.total this.listQuery.total = response.data.total
} else { } else {
this.list = [] this.list = []
this.total = 0 this.listQuery.total = 0
}
})
},
//
getType() {
dictType({type: 'contractType'}).then((response) => {
if (response.code === '200' && response.data) {
this.typeList = response.data
}
})
},
//
getPeopleType() {
dictType({type: 'personnelType'}).then((response) => {
if (response.code === '200' && response.data) {
this.personnelTypeList = response.data
}
})
},
//
getProjectTypes() {
dictType({type: 'projectType '}).then((response) => {
if (response.code === '200' && response.data) {
this.projectTypeList = response.data
} }
}) })
}, },
@ -293,51 +215,50 @@
// //
handleReset() { handleReset() {
this.listQuery.params.contractTypeKey = '' this.listQuery = {
this.listQuery.params.objectTypeKey = '' current: 1,
this.listQuery.params.projectTypeKey = '' size: 20,
this.listQuery.params.fileName = '' params: {
this.listQuery.params.ver = '' contractType: '',
this.getList() objectType: '',
projectType: '',
fileName: '',
ver: ''
}, },
// ------------------------------------------------------ total: 0
// }
resetTemp() { this.getList()
this.temp = {}
}, },
handleSelectionChange(row) { handleSelectionChange(row) {
const aa = [] const aa = []
row.forEach((element) => { row.forEach((element) => {
aa.push(element.sid) aa.push(element.sid)
// setuser(this.sids)
}) })
this.sids = aa this.sids = aa
}, },
// //
handleCreate() { handleCreate() {
this.$refs.addAndUpdate.openCreate(() => { this.viewState = 2
this.visible = false this.$refs['divAdd'].showAdd()
})
}, },
// //
handleUpdate() { handleUpdate() {
if (this.sids.length === 1) { if (this.sids.length === 1) {
this.$refs.addAndUpdate.openUpdate(this.sids[0], () => { this.viewState = 3
this.visible = false this.$refs['divAdd'].showEdit(this.sids)
})
} else if (this.sids.length > 1) { } else if (this.sids.length > 1) {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '不能选中多个修改!!', message: '不能选中多个修改!',
type: 'info', type: 'info',
duration: 2000, duration: 2000
}) })
} else { } else {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '没有选择!!', message: '没有选择!',
type: 'error', type: 'error',
duration: 2000, duration: 2000
}) })
return return
} }
@ -345,9 +266,8 @@
// //
lookDetails(row) { lookDetails(row) {
this.$refs.openInfo.openCreate(row.sid, () => { this.viewState = 4
this.visible = false this.$refs['divInfo'].showInfo(row)
})
}, },
// ID // ID
handleDelete() { handleDelete() {
@ -356,7 +276,7 @@
title: '提示', title: '提示',
message: '没有选择!!', message: '没有选择!!',
type: 'warning', type: 'warning',
duration: 2000, duration: 2000
}) })
return return
} }
@ -366,29 +286,21 @@
title: '提示', title: '提示',
message: '删除成功', message: '删除成功',
type: 'success', type: 'success',
duration: 2000, duration: 2000
}) })
this.getList() this.getList()
} else { } else {
this.$notify({ this.$notify({
title: '删除失败', title: '删除失败',
message: response.msg, message: response.msg,
type: 'error', type: 'error'
}) })
} }
}) })
}, },
// restState() {
dataUpdated() { this.viewState = 1
this.$forceUpdate() this.handleReset()
this.getList()
this.visible = true
},
//
dataCreated() {
this.$forceUpdate()
this.getList()
this.visible = true
}, },
// //
handleDaoChu() { handleDaoChu() {
@ -398,22 +310,20 @@
console.log(this.listQuery.params) console.log(this.listQuery.params)
basefinbankTemplateExportExcel(this.listQuery.params).then((res) => { basefinbankTemplateExportExcel(this.listQuery.params).then((res) => {
const blob = new Blob([res], { const blob = new Blob([res], {
type: 'application/vnd.ms-excel', type: 'application/vnd.ms-excel'
}) })
const objectUrl = URL.createObjectURL(blob) const objectUrl = URL.createObjectURL(blob)
window.location.href = objectUrl window.location.href = objectUrl
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '导出成功', message: '导出成功',
type: 'success', type: 'success',
duration: 2000, duration: 2000
}) })
}) })
}, }
}, }
} }
</script> </script>
<style scoped> <style scoped>
/* .listcon{height: calc(100vh - 550px);overflow-y: auto;overflow-x: hidden;} */
</style> </style>

239
anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanliAdd.vue

@ -1,21 +1,20 @@
<template> <template>
<div v-show="visible" class="app-container"> <div class="app-container">
<div class="tab-header webtop"> <div class="tab-header webtop">
<div>合同模板</div> <div>合同模板</div>
<!-- <div v-else></div> -->
<div> <div>
<el-button type="primary" size="small" @click="handleCreate()">保存</el-button> <el-button type="primary" size="small" @click="handleCreate()">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div> </div>
</div> </div>
<div class="listconadd"> <div class="listconadd">
<el-form ref="dataForm" :model="temp" label-position="right" label-width="190px" class="formadd widthxiao" :rules="rules"> <el-form ref="dataForm" :model="formobj" label-position="right" label-width="190px" class="formadd widthxiao" :rules="rules">
<div class="titwu">合同模板</div> <div class="titwu">合同模板</div>
<el-row class="bordertopline"> <el-row class="bordertopline">
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="contractType"> <el-form-item prop="contractType">
<span slot="label">合同类型</span> <span slot="label">合同类型</span>
<el-select v-model="temp.contractType" placeholder="请选择" class="addinputw" @change="typeChange"> <el-select v-model="formobj.contractType" placeholder="请选择" class="addinputw" @change="typeChange">
<el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> <el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -25,8 +24,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="templateUrl"> <el-form-item prop="templateUrl">
<span slot="label">选择模板文件</span> <span slot="label">选择模板文件</span>
<Upload v-model="list1" :upload-data="{type:'0004'}" /> <Upload ref="fileUpload" style="width: 40%" @fileAdd="fileAdd" @fileDelete="fileDelete"/>
<div><span v-show="nameStyle">{{ temp.fileName }}</span><i v-show="deleteTubiaoStyle" class="el-icon-delete" style="color:red;size:10px" @click="deleteJpg(temp.templateUrl)" /></div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -34,7 +32,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="fileName"> <el-form-item prop="fileName">
<span slot="label">文件名称</span> <span slot="label">文件名称</span>
<el-input v-model="temp.fileName" maxlength="125" placeholder="" class="addinputw" clearable /> <el-input v-model="formobj.fileName" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -42,7 +40,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="ver"> <el-form-item prop="ver">
<span slot="label">版本号</span> <span slot="label">版本号</span>
<el-input v-model="temp.ver" maxlength="125" placeholder="" class="addinputw" clearable /> <el-input v-model="formobj.ver" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -50,7 +48,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<span slot="label">人员类型</span> <span slot="label">人员类型</span>
<el-select v-model="temp.objectType" placeholder="请选择" class="addinputw" @change="objectTypeChange"> <el-select v-model="formobj.objectType" placeholder="请选择" class="addinputw" @change="objectTypeChange">
<el-option v-for="items in personnelTypeList" :key="items.dictKey" :label="items.dictValue" :value="items.dictValue"/> <el-option v-for="items in personnelTypeList" :key="items.dictKey" :label="items.dictValue" :value="items.dictValue"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -60,7 +58,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<span slot="label">项目类型</span> <span slot="label">项目类型</span>
<el-select v-model="temp.projectType" placeholder="请选择" class="addinputw" @change="projectTypeChange"> <el-select v-model="formobj.projectType" placeholder="请选择" class="addinputw" @change="projectTypeChange">
<el-option v-for="ite in projectTypeList" :key="ite.dictKey" :label="ite.dictValue" :value="ite.dictValue"/> <el-option v-for="ite in projectTypeList" :key="ite.dictKey" :label="ite.dictValue" :value="ite.dictValue"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -70,7 +68,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="funNode"> <el-form-item prop="funNode">
<span slot="label">功能节点</span> <span slot="label">功能节点</span>
<el-input v-model="temp.funNode" maxlength="125" placeholder="" class="addinputw" clearable /> <el-input v-model="formobj.funNode" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -78,231 +76,158 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<span slot="label">备注</span> <span slot="label">备注</span>
<el-input v-model="temp.remarks" maxlength="125" placeholder="" class="addinputw" clearable type="textarea" :rows="3" /> <el-input v-model="formobj.remarks" maxlength="125" placeholder="" clearable type="textarea" :rows="3"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import { import {
saveTemplate, saveTemplate,
getOneTemplate,
updateTemplate, updateTemplate,
deleteFilesOss, getOneTemplate,
} from '@/api/jichuxinxi/contract' } from '@/api/jichuxinxi/contract'
import { dictType } from '@/api/salesManagement/orderManagement' import { dictType } from '@/api/salesManagement/orderManagement'
import Upload from '@/components/uploadFile/upload.vue' // import Upload from '@/components/uploadFile/HeTongMoBanUpload.vue' //
export default { export default {
name: 'HetongdanganguanliAdd', name: 'HetongdanganguanliAdd',
components: { Upload }, components: { Upload },
data() { data() {
return { return {
// ---------
deleteTubiaoStyle: false,
visible: false,
nameStyle: false,
list1: [], list1: [],
projectTypeList: [], projectTypeList: [],
typeList: [], typeList: [],
personnelTypeList: [], personnelTypeList: [],
stateId: 0, stateId: 0,
FormLoading: false, formobj: {
listLoading: false, sid: '',
temp: {}, // contractType: '',
hetongType: [], contractTypeKey: '',
dialogStatus: '', // templateUrl: '',
fileName: '',
fileType: '',
ver: '',
objectType: '',
objectTypeKey: '',
projectType: '',
projectTypeKey: '',
funNode: '',
remarks: ''
}, //
rules: { rules: {
contractType: [ contractType: [{ required: true, message: '请选着合同类型', trigger: 'change' }],
{ required: true, message: '请选着合同类型', trigger: 'change' },
],
// templateUrl: [{ required: true, message: '', trigger: 'blur' }],
// fileName: [{ required: true, message: '', trigger: 'blur' }],
ver: [{ required: true, message: '请填写版本号', trigger: 'blur' }], ver: [{ required: true, message: '请填写版本号', trigger: 'blur' }],
funNode: [ funNode: [{ required: true, message: '请填写功能节点', trigger: 'blur' }]
{ required: true, message: '请填写功能节点', trigger: 'blur' }, }
],
},
// ------------------------------------
} }
},
computed: {},
created() {
//
this.getType()
this.getPeopleType()
this.getProjectTypes()
}, },
methods: { methods: {
openUpdate(sid, showed) { DictType() {
this.deleteTubiaoStyle = false dictType({ type: 'contractType' }).then((response) => {
this.nameStyle = true if (response.code === '200' && response.data) {
this.stateId = sid this.typeList = response.data
if (this.stateId !== '0') {
getOneTemplate(this.stateId).then((response) => {
if (response.code === '200') {
this.$refs['dataForm'].clearValidate()
this.temp = response.data
if (response.data.templateUrl.indexOf(',') >= 0) {
const da = response.data.templateUrl.split(',')
for (var i = 0; i < da.length; i++) {
// const imgName = da[i].split('/')
this.list2.push({
name: response.data.fileName,
url: da[i]
})
}
const imgList = this.list2
this.$refs['uploadImg'].showImg(imgList)
console.log('123456', this.list2)
} }
// const imgName = response.data.appdixUrl.split('/')
this.list2.push({
name:response.data.fileName,
url:response.data.templateUrl
}) })
const imgList = this.list2 dictType({ type: 'personnelType' }).then((response) => {
this.$refs['uploadImg'].showImg(imgList) if (response.code === '200' && response.data) {
if (response.data.templateUrl) { this.personnelTypeList = response.data
this.deleteTubiaoStyle = true
}
this.visible = true
if (showed && typeof showed === 'function') {
showed()
}
} }
}) })
dictType({ type: 'projectType ' }).then((response) => {
if (response.code === '200' && response.data) {
this.projectTypeList = response.data
} }
})
}, },
openCreate(showed) { showAdd() {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.resetTemp() this.DictType()
this.deleteTubiaoStyle = false
this.nameStyle = false
this.stateId = '0'
this.visible = true
if (showed && typeof showed === 'function') {
showed()
}
}, },
// ------------------------------------------------------ showEdit(row) {
deleteJpg(val) { console.log(row)
deleteFilesOss(val).then((re) => { this.DictType()
if (re.code === '200') { getOneTemplate(row).then((res) => {
this.$notify({ if (res.code === '200') {
title: '提示', this.formobj = res.data
message: '删除成功', this.$refs['fileUpload'].show(this.formobj.fileName)
type: 'success',
duration: 2000,
})
this.temp.fileName = ''
this.temp.templateUrl = ''
this.deleteTubiaoStyle = false
} }
}) })
}, },
//
handleReturn() {
this.visible = false
this.$emit('handleReturn')
},
//
resetTemp() {
this.temp = {}
},
projectTypeChange(val) { projectTypeChange(val) {
const choosetItem = this.projectTypeList.filter( const choosetItem = this.projectTypeList.filter(
(item) => item.dictValue == val (item) => item.dictValue === val
) )
this.temp.projectTypeKey = choosetItem[0].dictKey this.formobj.projectTypeKey = choosetItem[0].dictKey
}, },
typeChange(val) { typeChange(val) {
const choosetItem = this.typeList.filter((item) => item.dictValue == val) const choosetItem = this.typeList.filter((item) => item.dictValue === val)
this.temp.contractTypeKey = choosetItem[0].dictKey this.formobj.contractTypeKey = choosetItem[0].dictKey
}, },
// //
objectTypeChange(val) { objectTypeChange(val) {
const choosetItem = this.personnelTypeList.filter( const choosetItem = this.personnelTypeList.filter(
(item) => item.dictValue == val (item) => item.dictValue === val
) )
this.temp.objectTypeKey = choosetItem[0].dictKey this.formobj.objectTypeKey = choosetItem[0].dictKey
}, },
// fileAdd(item) {
getType() { this.list1 = item
dictType({ type: 'contractType' }).then((response) => { console.log(this.list1)
if (response.code === '200' && response.data) { for (var i = 0; i < this.list1.length; i++) {
this.typeList = response.data var namese = this.list1[i].name
var nameArr = namese.split('.')
this.formobj.templateUrl = this.list1[i].url
this.formobj.fileType = nameArr[nameArr.length - 1]
this.formobj.fileName = this.list1[i].name
} }
})
}, },
// fileDelete(item) {
getPeopleType() { this.formobj.templateUrl = ''
dictType({ type: 'personnelType' }).then((response) => { this.formobj.fileName = ''
if (response.code === '200' && response.data) { this.formobj.fileType = ''
this.personnelTypeList = response.data
}
})
},
//
getProjectTypes() {
dictType({ type: 'projectType ' }).then((response) => {
if (response.code === '200' && response.data) {
this.projectTypeList = response.data
}
})
}, },
// //
handleCreate() { handleCreate() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
for (var i = 0; i < this.list1.length; i++) { if (this.formobj.sid === '') {
var namese = this.list1[i].name saveTemplate(this.formobj).then((response) => {
var nameArr = namese.split('.')
this.temp.templateUrl = this.list1[i].url
this.temp.fileType = nameArr[nameArr.length - 1]
this.temp.fileName = this.list1[i].name
}
if (this.stateId === '0') {
saveTemplate(this.temp).then((response) => {
if (response.code === '200') { if (response.code === '200') {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '添加成功', message: '添加成功',
type: 'success', type: 'success',
duration: 2000, duration: 2000
}) })
this.visible = false this.handleReturn()
this.$emit('created')
} else { } else {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '添加失败', message: '添加失败',
type: 'error', type: 'error',
duration: 2000, duration: 2000
}) })
} }
}) })
} else { } else {
updateTemplate(this.temp).then((response) => { updateTemplate(this.formobj).then((response) => {
if (response.code === '200') { if (response.code === '200') {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '修改成功', message: '修改成功',
type: 'success', type: 'success',
duration: 2000, duration: 2000
}) })
this.visible = false this.handleReturn()
this.$emit('updated')
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
message: '修改失败', message: '修改失败',
type: 'error', type: 'error'
}) })
} }
}) })
@ -310,7 +235,11 @@ export default {
} }
}) })
}, },
}, //
handleReturn() {
this.$emit('doback')
}
}
} }
</script> </script>
<style scoped> <style scoped>
@ -318,6 +247,6 @@ export default {
width: 80%; width: 80%;
} }
.addinputw { .addinputw {
width: 60% !important; width: 20% !important;
} }
</style> </style>

49
anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanliInfo.vue

@ -2,23 +2,18 @@
<div v-show="visible" class="app-container"> <div v-show="visible" class="app-container">
<div class="tab-header webtop"> <div class="tab-header webtop">
<div>合同模板详情</div> <div>合同模板详情</div>
<!-- <div v-else></div> -->
<div> <div>
<!-- <el-button type="primary" size="small" @click="handleCreate()">保存</el-button> -->
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div> </div>
</div> </div>
<div class="listconadd"> <div class="listconadd">
<el-form ref="dataForm" :model="temp" label-position="right" label-width="190px" class="formadd widthxiao"> <el-form ref="dataForm" :model="formobj" label-position="right" label-width="190px" class="formadd widthxiao">
<div class="titwu">合同模板</div> <div class="titwu">合同模板</div>
<el-row class="bordertopline"> <el-row class="bordertopline">
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name"> <el-form-item prop="name">
<span slot="label">合同类型</span> <span slot="label">合同类型</span>
<el-input v-model="temp.contractType" maxlength="125" placeholder="" class="addinputw" /> <el-input v-model="formobj.contractType" maxlength="125" placeholder="" class="addinputw" readonly/>
<!-- <el-select v-model="temp.contractType" placeholder="请选择" class="addinputw">
<el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue" />
</el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -34,7 +29,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name"> <el-form-item prop="name">
<span slot="label">文件名称</span> <span slot="label">文件名称</span>
<el-input v-model="temp.fileName" maxlength="125" placeholder="" class="addinputw" /> <el-input v-model="formobj.fileName" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -42,7 +37,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name"> <el-form-item prop="name">
<span slot="label">版本号</span> <span slot="label">版本号</span>
<el-input v-model="temp.ver" maxlength="125" placeholder="" class="addinputw" /> <el-input v-model="formobj.ver" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -50,7 +45,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<span slot="label">人员类型</span> <span slot="label">人员类型</span>
<el-input v-model="temp.objectType" maxlength="125" placeholder="" class="addinputw" /> <el-input v-model="formobj.objectType" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -58,7 +53,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<span slot="label">项目类型</span> <span slot="label">项目类型</span>
<el-input v-model="temp.projectType" maxlength="125" placeholder="" class="addinputw" /> <el-input v-model="formobj.projectType" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -66,7 +61,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name"> <el-form-item prop="name">
<span slot="label">功能节点</span> <span slot="label">功能节点</span>
<el-input v-model="temp.funNode" maxlength="125" placeholder="" class="addinputw" /> <el-input v-model="formobj.funNode" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -74,7 +69,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<span slot="label">备注</span> <span slot="label">备注</span>
<el-input v-model="temp.remarks" maxlength="125" placeholder="" class="addinputw" type="textarea" :rows="3" /> <el-input v-model="formobj.remarks" maxlength="125" placeholder="" type="textarea" :rows="3" readonly/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -87,42 +82,30 @@
<script> <script>
import { getOneTemplate } from '@/api/jichuxinxi/contract' import { getOneTemplate } from '@/api/jichuxinxi/contract'
export default { export default {
name: 'HetongdanganguanliAdd', name: 'HetongdanganguanliInfo',
data() { data() {
return { return {
visible: false, visible: false,
temp: {} // formobj: {} //
} }
}, },
computed: {
},
created() {
//
},
methods: { methods: {
openCreate(sid, showed) { showInfo(row) {
getOneTemplate(sid).then((response) => { getOneTemplate(row.sid).then((res) => {
if (response.code === '200') { if (res.code === '200') {
this.$refs['dataForm'].clearValidate() this.formobj = res.data
this.temp = response.data
this.visible = true
if (showed && typeof showed === 'function') {
showed()
}
} }
}) })
}, },
// //
handleReturn() { handleReturn() {
this.visible = false this.visible = false
this.$emit('handleReturn') this.$emit('doback')
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.widthxiao{width: 80%;} .widthxiao{width: 80%;}
.addinputw{width: 60% !important;} .addinputw{width: 30% !important;}
</style> </style>

Loading…
Cancel
Save