[update] 修改企标计划立项/变更流程
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<!-- 部门名称 -->
|
||||
<a-col :span="6">
|
||||
<a-form-item :label="$t('system.contact.departName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+$t('system.contact.departName')" v-model="queryParam.departName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'system:contactManage:search'">{{ $t('query') }}</a-button>
|
||||
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
|
||||
</div>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作区域 -->
|
||||
<div class="table-operator">
|
||||
<!-- 新增 -->
|
||||
<a-button icon="plus" type="primary" v-has="'system:contactManage:add'"
|
||||
@click="handleAdd">
|
||||
{{ $t('newlyAdded') }}
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<j-table
|
||||
:can-drag="true"
|
||||
:scroll="{x: '100%'}"
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
<!-- 操作栏 -->
|
||||
<div slot="action" slot-scope="{record}" class="action-span-cell">
|
||||
<a @click="handleEdit(record)" class="table-ope-btn" v-has="'system:contactManage:edit'">{{ $t('edt') }}</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleDelete(record.id)" class="table-ope-btn" v-has="'system:contactManage:delete'">{{ $t('delete') }}</a>
|
||||
</div>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
<contact-manage-modal ref="modalForm" @ok="modalFormOk"></contact-manage-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
import JTable from '@/components/jero/JTable'
|
||||
import ContactManageModal from './modules/ContactManageModal'
|
||||
export default {
|
||||
name: 'ContactManageList',
|
||||
mixins: [JeroListMixin],
|
||||
components: { ContactManageModal, JTable },
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 4
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 14
|
||||
},
|
||||
columns: [
|
||||
{ // 部门名称
|
||||
title: this.$t('system.contact.departName'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'departName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 标准化工程师
|
||||
title: this.$t('system.contact.standardizationEngineer'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'standardizationEngineer',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 联络人
|
||||
title: this.$t('system.contact.contactPerson'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'contactPerson',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 部门联络人主管级领导
|
||||
title: this.$t('system.contact.contactPersonSupervisorLevelLeader'),
|
||||
align: 'center',
|
||||
width: 240,
|
||||
dataIndex: 'contactPersonSupervisorLevelLeader',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 200
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:maskClosable="true"
|
||||
:width="800"
|
||||
:closable="true"
|
||||
switchFullscreen
|
||||
@cancel="handleCancel"
|
||||
@ok="handleOk"
|
||||
:visible="visible">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<!-- 部门名称 -->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.departName')">
|
||||
<j-select-depart
|
||||
v-decorator.trim="[ 'departName', validatorRules.departName]"
|
||||
:multi="false"
|
||||
:backDepart="true"
|
||||
:treeOpera="true">
|
||||
</j-select-depart>
|
||||
</a-form-item>
|
||||
<!-- 标准化工程师 -->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.standardizationEngineer')">
|
||||
<user-selection :placeholder="$t('pleaseSelect')+$t('system.contact.standardizationEngineer')"
|
||||
v-decorator.trim="[ 'standardizationEngineer', validatorRules.standardizationEngineer]"
|
||||
filedName="standardizationEngineer"
|
||||
@nameChange="userSelectNameChange"
|
||||
:nameStr="model.standardizationEngineer_dictText"
|
||||
type="radio" />
|
||||
</a-form-item>
|
||||
<!-- 联络人 -->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.contactPerson')">
|
||||
<user-selection :placeholder="$t('pleaseSelect')+$t('system.contact.contactPerson')"
|
||||
v-decorator.trim="[ 'contactPerson', validatorRules.contactPerson]"
|
||||
filedName="contactPerson"
|
||||
@nameChange="userSelectNameChange"
|
||||
:nameStr="model.contactPerson_dictText"
|
||||
type="radio" />
|
||||
</a-form-item>
|
||||
<!-- 部门联络人主管级领导 -->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.contactPersonSupervisorLevelLeader')">
|
||||
<user-selection :placeholder="$t('pleaseSelect')+$t('system.contact.contactPersonSupervisorLevelLeader')"
|
||||
v-decorator.trim="[ 'contactPersonSupervisorLevelLeader', validatorRules.contactPersonSupervisorLevelLeader]"
|
||||
filedName="contactPersonSupervisorLevelLeader"
|
||||
@nameChange="userSelectNameChange"
|
||||
:nameStr="model.contactPersonSupervisorLevelLeader_dictText"
|
||||
type="radio" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { postAction } from '@/api/manage'
|
||||
import UserSelection from '@/components/selection/UserSelection'
|
||||
|
||||
export default {
|
||||
name: 'ContactManageModal',
|
||||
components: { UserSelection },
|
||||
data () {
|
||||
return {
|
||||
title: '',
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
validatorRules: {
|
||||
// 部门名称
|
||||
departName: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.departName') }
|
||||
],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
// 标准化工程师
|
||||
standardizationEngineer: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.standardizationEngineer') }
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
// 联络人
|
||||
contactPerson: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.contactPerson') }
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
// 部门联络人主管级领导
|
||||
contactPersonSupervisorLevelLeader: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.contactPersonSupervisorLevelLeader') }
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
}
|
||||
},
|
||||
url: {
|
||||
add: '',
|
||||
edit: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({})
|
||||
},
|
||||
edit (record) {
|
||||
this.visible = true
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'departName', 'standardizationEngineer', 'contactPerson', 'contactPersonSupervisorLevelLeader'))
|
||||
})
|
||||
},
|
||||
// 选择用户得到用户名
|
||||
userSelectNameChange (value, fieldName) {
|
||||
this.model[fieldName + '_dictText'] = value
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
handleOk () {
|
||||
if (this.confirmLoading) return
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.confirmLoading = true
|
||||
const param = Object.assign({}, values)
|
||||
let url = ''
|
||||
if (this.model.id) {
|
||||
url = this.url.edit
|
||||
param.id = this.model.id
|
||||
} else {
|
||||
url = this.url.add
|
||||
}
|
||||
postAction(url, param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.$emit('ok')
|
||||
this.close()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
close () {
|
||||
this.visible = false
|
||||
this.model = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user