add 车型项目库:增删改查
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
import { postAction } from './manage.js'
|
||||||
|
|
||||||
|
// 车型项目库-新增
|
||||||
|
const addVehicleItemLibrary = (params) => postAction('/projectLibrary/lawsProjectLibrary/add', params)
|
||||||
|
// 车型项目库-编辑
|
||||||
|
const editVehicleItemLibrary = (params) => postAction('/projectLibrary/lawsProjectLibrary/edit', params)
|
||||||
|
|
||||||
|
export {
|
||||||
|
addVehicleItemLibrary,
|
||||||
|
editVehicleItemLibrary
|
||||||
|
}
|
||||||
@@ -93,7 +93,6 @@
|
|||||||
.operate-btn {
|
.operate-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 16px;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
|
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
|
||||||
color: #1D2129;
|
color: #1D2129;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ const personalCenter = require('./personalCenter/en.js')
|
|||||||
const standardRegulationLibrary = require('./standardRegulationLibrary/en-us')
|
const standardRegulationLibrary = require('./standardRegulationLibrary/en-us')
|
||||||
const enterpriseStandardLibrary = require('./enterpriseStandardLibrary/en.js')
|
const enterpriseStandardLibrary = require('./enterpriseStandardLibrary/en.js')
|
||||||
const businessSupport = require('./businessSupport/en')
|
const businessSupport = require('./businessSupport/en')
|
||||||
|
const projectLibrary = require('./projectLibrary/en.js')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 共用
|
// 共用
|
||||||
@@ -526,5 +527,7 @@ module.exports = {
|
|||||||
// 企标库
|
// 企标库
|
||||||
enterpriseStandardLibrary,
|
enterpriseStandardLibrary,
|
||||||
// 业务支持
|
// 业务支持
|
||||||
businessSupport
|
businessSupport,
|
||||||
|
// 项目库
|
||||||
|
projectLibrary
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
module.exports = {
|
||||||
|
projectName: 'Project name', // 项目名称
|
||||||
|
workOrderNumber: 'Work order number', // 工作令编号
|
||||||
|
projectHealthStatus: 'Project health status', // 项目健康状态
|
||||||
|
|
||||||
|
// 车型项目库
|
||||||
|
vehicleItemLibrary: {
|
||||||
|
vehicleItemLibrary: 'Vehicle item library', // 车型项目库
|
||||||
|
PMSInfoSynchronization: 'PMS information synchronization', // PMS信息同步
|
||||||
|
projectSource: 'Project source', // 项目来源
|
||||||
|
projectName: 'Project name', // 项目名称
|
||||||
|
projectLeader: 'Project leader', // 项目负责人,
|
||||||
|
PMSDetails: 'PMS Details' // PMS详情
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
projectName: '项目名称',
|
||||||
|
workOrderNumber: '工作令编号',
|
||||||
|
projectHealthStatus: '项目健康度',
|
||||||
|
|
||||||
|
// 车型项目库
|
||||||
|
vehicleItemLibrary: {
|
||||||
|
vehicleItemLibrary: '车型项目库',
|
||||||
|
PMSInfoSynchronization: 'PMS信息同步',
|
||||||
|
projectSource: '项目来源',
|
||||||
|
projectLeader: '项目负责人',
|
||||||
|
PMSDetails: 'PMS详情'
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ const personalCenter = require('./personalCenter/zh.js')
|
|||||||
const standardRegulationLibrary = require('./standardRegulationLibrary/zh-cn')
|
const standardRegulationLibrary = require('./standardRegulationLibrary/zh-cn')
|
||||||
const enterpriseStandardLibrary = require('./enterpriseStandardLibrary/zh.js')
|
const enterpriseStandardLibrary = require('./enterpriseStandardLibrary/zh.js')
|
||||||
const businessSupport = require('./businessSupport/zh')
|
const businessSupport = require('./businessSupport/zh')
|
||||||
|
const projectLibrary = require('./projectLibrary/zh.js')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 共用
|
// 共用
|
||||||
@@ -526,5 +527,7 @@ module.exports = {
|
|||||||
// 企标库
|
// 企标库
|
||||||
enterpriseStandardLibrary,
|
enterpriseStandardLibrary,
|
||||||
// 业务支持
|
// 业务支持
|
||||||
businessSupport
|
businessSupport,
|
||||||
|
// 项目库
|
||||||
|
projectLibrary
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,12 @@
|
|||||||
<div class="clause-label-change part-ml part-common">
|
<div class="clause-label-change part-ml part-common">
|
||||||
<!--条文-->
|
<!--条文-->
|
||||||
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': !showClauseLable}" @click="handleClauseChange(false)">
|
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': !showClauseLable}" @click="handleClauseChange(false)">
|
||||||
<a-icon type="profile" />
|
<i class="iconfont icon-ios-list-box" />
|
||||||
<span>条文</span>
|
<span>条文</span>
|
||||||
</div>
|
</div>
|
||||||
<!--条文标签-->
|
<!--条文标签-->
|
||||||
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': showClauseLable}" @click="handleClauseChange(true)">
|
<div class="clause-label-change-item" :class="{'clause-label-change-item-selected': showClauseLable}" @click="handleClauseChange(true)">
|
||||||
<a-icon type="profile" />
|
<i class="iconfont icon-biaoqian-mianxing" />
|
||||||
<span>条文标签</span>
|
<span>条文标签</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -239,6 +239,10 @@ export default {
|
|||||||
color: #1D2129;
|
color: #1D2129;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,3 +41,9 @@ export const StandardSystemTreeNodeType = {
|
|||||||
ROOT_NODE: { text: '根节点', value: '1' },
|
ROOT_NODE: { text: '根节点', value: '1' },
|
||||||
CHILD_NODE: { text: '子节点', value: '2' }
|
CHILD_NODE: { text: '子节点', value: '2' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 车型项目库-项目来源
|
||||||
|
export const ProjectSource = {
|
||||||
|
ADD: { text: '本地新增', value: '1' },
|
||||||
|
PMS: { text: 'PMS', value: '2' }
|
||||||
|
}
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ export const JeroListMixin = {
|
|||||||
mounted () {
|
mounted () {
|
||||||
// 过滤表格操作列没有权限的按钮
|
// 过滤表格操作列没有权限的按钮
|
||||||
if (this.needFilterTableBtn) {
|
if (this.needFilterTableBtn) {
|
||||||
this.operationList = this.operationList.filter(item => isHasPermission(item.has))
|
this.operationList = this.operationList.filter(item => !item.has || isHasPermission(item.has))
|
||||||
|
console.log(this.operationList)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -309,13 +310,13 @@ export const JeroListMixin = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
|
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
|
||||||
} else {
|
} else {
|
||||||
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.style.display = 'none'
|
link.style.display = 'none'
|
||||||
link.href = url
|
link.href = url
|
||||||
link.setAttribute('download', fileName + '.xls')
|
link.setAttribute('download', fileName + '.xlsx')
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link) // 下载完成移除元素
|
document.body.removeChild(link) // 下载完成移除元素
|
||||||
|
|||||||
@@ -0,0 +1,200 @@
|
|||||||
|
<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 :md="6" :sm="12">
|
||||||
|
<a-form-item :label="$t('projectLibrary.projectName')">
|
||||||
|
<j-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.projectName')" v-model="queryParam.projectName"></j-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!--工作令编号-->
|
||||||
|
<a-col :md="6" :sm="12">
|
||||||
|
<a-form-item :label="$t('projectLibrary.workOrderNumber')">
|
||||||
|
<j-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.workOrderNumber')" v-model="queryParam.workNumber"></j-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!--项目健康状态-->
|
||||||
|
<a-col :md="6" :sm="12">
|
||||||
|
<a-form-item :label="$t('projectLibrary.projectHealthStatus')">
|
||||||
|
<j-dict-select-tag
|
||||||
|
class="box-input"
|
||||||
|
v-model="queryParam.projectHealth"
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('personalCenter.collection.status')"
|
||||||
|
:type="'select'"
|
||||||
|
:triggerChange="false"
|
||||||
|
:dictCode="'project_health'" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :md="6" :sm="8">
|
||||||
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
|
||||||
|
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $t('query') }}</a-button>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-operator">
|
||||||
|
<!-- 新增-->
|
||||||
|
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
|
||||||
|
<!-- 导出-->
|
||||||
|
<a-button icon="upload" type="primary" ghost @click="handleExportXls($t('projectLibrary.vehicleItemLibrary.vehicleItemLibrary'))">
|
||||||
|
{{ $t('export') }}
|
||||||
|
</a-button>
|
||||||
|
<!-- 批量删除-->
|
||||||
|
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
|
||||||
|
<!-- PMS信息同步-->
|
||||||
|
<a-button type="primary" icon="setting" ghost @click="handlePMSInfoSynchronization">
|
||||||
|
{{ $t('projectLibrary.vehicleItemLibrary.PMSInfoSynchronization') }}
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<j-table
|
||||||
|
:columns="columns"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:can-drag="true"
|
||||||
|
rowKey="id"
|
||||||
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:scroll="{x: '100%'}"
|
||||||
|
@change="handleTableChange">
|
||||||
|
|
||||||
|
<template v-slot:operation="{text, record}">
|
||||||
|
<!-- 收藏-->
|
||||||
|
<a @click="operationClick(operationList[0],record)">{{ operationList[0].text }}</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-dropdown placement="bottomCenter">
|
||||||
|
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
|
||||||
|
<a-menu slot="overlay">
|
||||||
|
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
|
||||||
|
<a @click="operationClick(operation,record)">
|
||||||
|
<div class="operate-btn">
|
||||||
|
<!-- 编辑图标-->
|
||||||
|
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||||
|
<!-- 删除图标-->
|
||||||
|
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||||
|
{{ operation.text }}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</a-dropdown>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</j-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--新增、编辑-->
|
||||||
|
<vehicle-item-library-modal ref="modalForm" @ok="modalFormOk" />
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import '@assets/less/common.less'
|
||||||
|
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
||||||
|
import JTable from '../../../components/jero/JTable.vue'
|
||||||
|
import VehicleItemLibraryModal from './modules/VehicleItemLibraryModal.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'VehicleItemLibrary',
|
||||||
|
components: { JTable, VehicleItemLibraryModal },
|
||||||
|
mixins: [JeroListMixin],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
columns: [
|
||||||
|
// 项目来源
|
||||||
|
{
|
||||||
|
dataIndex: 'projectSource_dictText',
|
||||||
|
title: this.$t('projectLibrary.vehicleItemLibrary.projectSource'),
|
||||||
|
width: 250
|
||||||
|
},
|
||||||
|
// 项目名称
|
||||||
|
{
|
||||||
|
dataIndex: 'projectName',
|
||||||
|
title: this.$t('projectLibrary.projectName'),
|
||||||
|
sorter: true,
|
||||||
|
width: 250
|
||||||
|
},
|
||||||
|
// 工作令编号
|
||||||
|
{
|
||||||
|
dataIndex: 'workNumber',
|
||||||
|
title: this.$t('projectLibrary.workOrderNumber'),
|
||||||
|
sorter: true,
|
||||||
|
width: 250
|
||||||
|
},
|
||||||
|
// 项目负责人
|
||||||
|
{
|
||||||
|
dataIndex: 'projectLeader',
|
||||||
|
title: this.$t('projectLibrary.vehicleItemLibrary.projectLeader'),
|
||||||
|
width: 250
|
||||||
|
},
|
||||||
|
// 项目健康状态
|
||||||
|
{
|
||||||
|
dataIndex: 'projectHealth_dictText',
|
||||||
|
title: this.$t('projectLibrary.projectHealthStatus'),
|
||||||
|
width: 250
|
||||||
|
},
|
||||||
|
// 操作
|
||||||
|
{
|
||||||
|
title: this.$t('operation'),
|
||||||
|
fixed: 'right',
|
||||||
|
width: 200,
|
||||||
|
scopedSlots: { customRender: 'operation' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
operationList: [
|
||||||
|
// 查看
|
||||||
|
{
|
||||||
|
text: this.$t('view'),
|
||||||
|
clickEvent: 'handleCollection',
|
||||||
|
has: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('projectLibrary.vehicleItemLibrary.PMSDetails'),
|
||||||
|
clickEvent: 'handleShare',
|
||||||
|
has: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('edit'),
|
||||||
|
clickEvent: 'handleEdit',
|
||||||
|
has: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('delete'),
|
||||||
|
clickEvent: 'handleDelete',
|
||||||
|
has: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
needFilterTableBtn: true, // 是否需要过滤表格操作列没有权限的按钮
|
||||||
|
url: {
|
||||||
|
list: '/projectLibrary/lawsProjectLibrary/page',
|
||||||
|
delete: '/projectLibrary/lawsProjectLibrary/delete',
|
||||||
|
deleteBatch: '/projectLibrary/lawsProjectLibrary/deleteBatch',
|
||||||
|
exportXlsUrl: '/projectLibrary/lawsProjectLibrary/exportXls'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handlePMSInfoSynchronization () {
|
||||||
|
|
||||||
|
},
|
||||||
|
operationClick (operation, record) {
|
||||||
|
if (operation.clickEvent === 'handleDelete') {
|
||||||
|
this.handleDelete(record.id)
|
||||||
|
} else {
|
||||||
|
this[operation.clickEvent](record)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
switchFullscreen
|
||||||
|
:maskClosable="false"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
:ok-text="$t('preservation')"
|
||||||
|
:cancel-text="$t('cancel')"
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row :gutter="30">
|
||||||
|
<!--项目来源-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('projectLibrary.vehicleItemLibrary.projectSource')">
|
||||||
|
<j-dict-select-tag v-decorator="['projectSource', validatorRules.projectSource]" dictCode="project_source" disabled
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('projectLibrary.vehicleItemLibrary.projectSource')" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!--项目名称-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('projectLibrary.projectName')">
|
||||||
|
<a-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.projectName')"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
:maxLength="50"
|
||||||
|
v-decorator="['projectName', validatorRules.projectName]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="30">
|
||||||
|
<!--工作令编号-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('projectLibrary.workOrderNumber')">
|
||||||
|
<a-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.workOrderNumber')"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
:maxLength="50"
|
||||||
|
v-decorator="['workNumber', validatorRules.workNumber]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!--项目负责人-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('projectLibrary.vehicleItemLibrary.projectLeader')">
|
||||||
|
<user-selection v-decorator="['projectLeader', validatorRules.projectLeader]"
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('projectLibrary.vehicleItemLibrary.projectLeader')" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="30">
|
||||||
|
<!--项目健康度-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('projectLibrary.projectHealthStatus')">
|
||||||
|
<j-dict-select-tag v-decorator="['projectHealth', validatorRules.projectHealth]" dictCode="project_health"
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('projectLibrary.projectHealthStatus')" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import UserSelection from '../../../../components/selection/UserSelection.vue'
|
||||||
|
import { addVehicleItemLibrary, editVehicleItemLibrary } from '../../../../api/projectLibraryApi.js'
|
||||||
|
import { ProjectSource } from '../../../../enums/commonEnums.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'VehicleItemLibraryModal',
|
||||||
|
components: { UserSelection },
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
title: this.$t('newlyAdded'),
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
model: {},
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 8 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
// 项目来源
|
||||||
|
projectSource: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.nodeName') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
// 项目名称
|
||||||
|
projectName: {
|
||||||
|
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('projectLibrary.projectName') }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
// 工作令编号
|
||||||
|
workNumber: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('projectLibrary.workOrderNumber') }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
// 项目负责人
|
||||||
|
projectLeader: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('projectLibrary.vehicleItemLibrary.projectLeader') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
// 项目健康度
|
||||||
|
projectHealth: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('projectLibrary.projectHealthStatus') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add () {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.visible = true
|
||||||
|
this.model.projectSource = ProjectSource.ADD.value
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(this.model)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit (record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(this.model)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleOk () {
|
||||||
|
this.form.validateFields((errors, values) => {
|
||||||
|
if (!errors) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
let submitFunc
|
||||||
|
if (this.model.id) {
|
||||||
|
submitFunc = editVehicleItemLibrary
|
||||||
|
} else {
|
||||||
|
submitFunc = addVehicleItemLibrary
|
||||||
|
}
|
||||||
|
submitFunc(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.close()
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel () {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.visible = false
|
||||||
|
this.form.resetFields()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user