Browse Source

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

master
yunuo970428 3 years ago
parent
commit
671caf24ac
  1. 2
      anrui-buscenter/anrui-buscenter-ui/src/styles/index.scss
  2. 504
      anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanli.vue
  3. 257
      anrui-buscenter/anrui-buscenter-ui/src/views/hetongguanli/hetongmobanguanli/hetongmobanguanliAdd.vue
  4. 53
      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-bottom: 1px solid $table-border-color;
padding: 5px 15px 5px 15px !important;
height: 48px;
min-height: 50px;
line-height: 1;
.el-form-item{
margin-bottom: 0;

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

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

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

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

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

@ -2,23 +2,18 @@
<div v-show="visible" class="app-container">
<div class="tab-header webtop">
<div>合同模板详情</div>
<!-- <div v-else></div> -->
<div>
<!-- <el-button type="primary" size="small" @click="handleCreate()">保存</el-button> -->
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<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>
<el-row class="bordertopline">
<el-col :span="24">
<el-form-item prop="name">
<span slot="label">合同类型</span>
<el-input v-model="temp.contractType" maxlength="125" placeholder="" class="addinputw" />
<!-- <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-input v-model="formobj.contractType" maxlength="125" placeholder="" class="addinputw" readonly/>
</el-form-item>
</el-col>
</el-row>
@ -34,7 +29,7 @@
<el-col :span="24">
<el-form-item prop="name">
<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-col>
</el-row>
@ -42,7 +37,7 @@
<el-col :span="24">
<el-form-item prop="name">
<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-col>
</el-row>
@ -50,7 +45,7 @@
<el-col :span="24">
<el-form-item>
<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-col>
</el-row>
@ -58,7 +53,7 @@
<el-col :span="24">
<el-form-item>
<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-col>
</el-row>
@ -66,7 +61,7 @@
<el-col :span="24">
<el-form-item prop="name">
<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-col>
</el-row>
@ -74,7 +69,7 @@
<el-col :span="24">
<el-form-item>
<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-col>
</el-row>
@ -87,42 +82,30 @@
<script>
import { getOneTemplate } from '@/api/jichuxinxi/contract'
export default {
name: 'HetongdanganguanliAdd',
name: 'HetongdanganguanliInfo',
data() {
return {
visible: false,
temp: {} //
formobj: {} //
}
},
computed: {
},
created() {
//
},
methods: {
openCreate(sid, showed) {
getOneTemplate(sid).then((response) => {
if (response.code === '200') {
this.$refs['dataForm'].clearValidate()
this.temp = response.data
this.visible = true
if (showed && typeof showed === 'function') {
showed()
}
}
})
showInfo(row) {
getOneTemplate(row.sid).then((res) => {
if (res.code === '200') {
this.formobj = res.data
}
})
},
//
handleReturn() {
this.visible = false
this.$emit('handleReturn')
this.$emit('doback')
}
}
}
</script>
<style scoped>
.widthxiao{width: 80%;}
.addinputw{width: 60% !important;}
.addinputw{width: 30% !important;}
</style>

Loading…
Cancel
Save