Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-05-07 15:08:51 +08:00
5 changed files with 167 additions and 332 deletions
+6
View File
@@ -705,6 +705,12 @@ module.exports = {
uploadTime: 'Upload time',
enclosure: 'enclosure',
// 认证
deleteConfiguration: 'delete Configuration',
addConfiguration: 'add Configuration',
electricMachinery: 'electricMachinery',
Battery: 'Battery',
Model: 'Model',
configurationName: 'configuration Name',
historicalVersion: 'historical Version',
configure: 'configure',
parameter: 'parameter',
+6
View File
@@ -712,6 +712,12 @@ module.exports = {
uploadTime:'上传时间',
enclosure:'附件',
// 认证
deleteConfiguration: '删除配置',
addConfiguration: '添加配置',
electricMachinery: '电机',
Battery: '电池',
Model: '车型',
configurationName: '配置名称',
historicalVersion: '历史版本',
configure: '配置',
parameter: '参数',
@@ -73,7 +73,7 @@
<parameter-template v-if='areaVisible' @areaVisible='handleCancel' :templateTitle='templatetitle'
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version'></parameter-template>
</a-modal>
<configure ref="configureRef"/>
<configure ref="configureRef" :url='url' :itemId='itemId'/>
</a-card>
</template>
@@ -146,6 +146,8 @@
queryById: 'params/manifest/queryById',
deleteBatch: 'params/manifest/delete',
deleteAll: 'params/manifest/deleteBatch',
conAdd: 'params/config/addBatch',
conList: 'params/config/list',
},
loading: false,
dataSource: [],
@@ -158,7 +160,8 @@
templatetitle: '',
templatetitleId: '',
rowId: '',
version: 0
version: 0,
itemId: ''
}
},
mounted() {
@@ -189,8 +192,9 @@
},
// 配置
configure() {
this.$refs.configureRef.addModel()
configure(item) {
this.itemId = item.id
this.$refs.configureRef.addModel(item.id)
},
handleCancel(val) {
this.areaVisible = val
@@ -227,9 +231,6 @@
} else {
}
})
},
handleExport(){
},
handleAdd(){
this.areaVisible = true
@@ -1078,7 +1078,7 @@
let num = 2
// for (let i = 0; i < 3; i++) {
// setTimeout(() => {
this.startProcessDesign(val, num)
this.startProcessDesign(val)
// }, 500)
// }
},
@@ -11,172 +11,91 @@
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<div v-for='(item, index) in paramsConfigEOList'>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('NiONumber')">{{$t('NiONumber')}}</span>
:title="$t('configurationName')">{{$t('configurationName')}}</span>
</div>
<a-form-model-item class="itemModel" prop="nioNumber">
<a-input class="box-input"
:disabled="disabled"
v-model="item.configName"
:placeholder="$t('PleaseEnter')+$t('configurationName')"/>
</a-form-model-item>
</div>
<!-- <a-form-model-item class="itemModel" prop="nioNumber">-->
<!-- <a-input class="box-input"-->
<!-- :disabled="disabled"-->
<!-- v-model="formInline.nioNumber"-->
<!-- :placeholder="$t('PleaseEnter')+$t('NiONumber')"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Required')">{{$t('Required')}}</span>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Version')">{{$t('Version')}}</span>
</div>
<a-form-model-item class="itemModel" prop="nioNumber">
<a-input class="box-input"
:disabled="disabled"
v-model="item.version"
:placeholder="$t('PleaseEnter')+$t('Version')"/>
</a-form-model-item>
</div>
<!-- <a-form-model-item class="itemModel" prop="isMust">-->
<!-- <a-select :placeholder="$t('PleaseSelect')+$t('Required')" v-model='formInline.isMust'>-->
<!-- <a-select-option :key="'1'" :value="'1'">{{$t('yes')}}-->
<!-- </a-select-option>-->
<!-- <a-select-option :key="'0'" :value="'0'">{{$t('not')}}-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('ParameterName')">{{$t('ParameterName')}}</span>
:title="$t('Model')">{{$t('Model')}}</span>
</div>
<a-form-model-item class="itemModel" prop="nioNumber">
<a-input class="box-input"
:disabled="disabled"
v-model="item.carType"
:placeholder="$t('PleaseEnter')+$t('Model')"/>
</a-form-model-item>
</div>
<!-- <a-form-model-item class="itemModel" prop="paramsName">-->
<!-- <a-input class="box-input"-->
<!-- :disabled="disabled"-->
<!-- v-model="formInline.paramsName"-->
<!-- :placeholder="$t('PleaseEnter')+$t('ParameterName')"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('technicalField')">{{$t('technicalField')}}</span>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Battery')">{{$t('Battery')}}</span>
</div>
<a-form-model-item class="itemModel" prop="nioNumber">
<a-input class="box-input"
:disabled="disabled"
v-model="item.battery"
:placeholder="$t('PleaseEnter')+$t('Battery')"/>
</a-form-model-item>
</div>
<!-- <a-form-model-item class="itemModel" prop="technologyTerritory">-->
<!-- <a-tree-select-->
<!-- v-model="formInline.technologyTerritory"-->
<!-- :maxTagCount="1"-->
<!-- class="box-input"-->
<!-- style="width: 100%"-->
<!-- :tree-data="CategoryTreeList"-->
<!-- tree-checkable-->
<!-- :placeholder="$t('PleaseSelect')+$t('technicalField')"-->
<!-- />-->
<!-- </a-form-model-item>-->
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('parameterBatch')">{{$t('parameterBatch')}}</span>
:title="$t('electricMachinery')">{{$t('electricMachinery')}}</span>
</div>
<a-form-model-item class="itemModel" prop="nioNumber">
<a-input class="box-input"
:disabled="disabled"
v-model="item.motor"
:placeholder="$t('PleaseEnter')+$t('electricMachinery')"/>
</a-form-model-item>
</div>
<!-- <a-form-model-item class="itemModel" prop="paramsBatch">-->
<!-- <j-dict-select-tag class="box-input" v-model="formInline.paramsBatch"-->
<!-- :disabled="disabled"-->
<!-- :placeholder="$t('PleaseSelect')+$t('parameterBatch')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'params_batch'"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<!-- <span class="title-text-text" :title="$t('Required')">{{$t('Required')}}</span>-->
</div>
<a-button style="margin-right: .8rem" @click="addConfiguration(index)">{{$t('addConfiguration')}}</a-button>
<a-button @click="deleteConfiguration(item.id,index)" type="primary" :loading="confirmLoading">{{$t('deleteConfiguration')}}</a-button>
</div>
<!-- <a-form-model-item class="itemModel" prop="dutyTerritory">-->
<!-- <j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"-->
<!-- :disabled="disabled"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('ParameterDescription')">{{$t('ParameterDescription')}}</span>
</div>
<!-- <a-form-model-item class="itemModel" prop="description">-->
<!-- <a-input class="box-input"-->
<!-- :disabled="disabled"-->
<!-- v-model="formInline.description"-->
<!-- :placeholder="$t('PleaseEnter')+$t('ParameterDescription')"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('ParameterName')">{{$t('certificationCategory')}}</span>
</div>
<!-- <a-form-model-item class="itemModel" prop="certCategory">-->
<!-- <j-multi-select-tag class="box-input" v-model="formInline.certCategory"-->
<!-- @change='Onchange'-->
<!-- v-on:changelabel='Onchangelabel'-->
<!-- :disabled="disabled"-->
<!-- :placeholder="$t('PleaseSelect')+$t('certificationCategory')"-->
<!-- :type="'checkbox'"-->
<!-- :triggerChange="false" :dictCode="'cert_category'"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('controlType')">{{$t('controlType')}}</span>
</div>
<!-- <a-form-model-item class="itemModel" prop="controlType">-->
<!-- <a-select :placeholder="$t('PleaseSelect')+$t('controlType')" v-model="formInline.controlType">-->
<!-- <a-select-option v-for="(item, key) in controlType" :key="key" :value="item.value">-->
<!-- <span style="display: inline-block;width: 100%" :title=" item.label ">-->
<!-- {{ item.label }}-->
<!-- </span>-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('controlVerification')">{{$t('controlVerification')}}</span>
</div>
<!-- <a-form-model-item class="itemModel" prop="technologyTerritory">-->
<!-- <a-select :placeholder="$t('PleaseSelect')+$t('controlVerification')" v-model="formInline.controlVerify">-->
<!-- <a-select-option v-for="(item, key) in controlVerification" :key="key" :value="item.value">-->
<!-- <span style="display: inline-block;width: 100%" :title=" item.label ">-->
<!-- {{ item.label }}-->
<!-- </span>-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
</a-row>
</a-col>
</a-row>
</div>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
@@ -184,151 +103,64 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
</div>
</template>
<script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file'
export default {
name: 'addModel',
components: {
uploadFile,
PersonnelSelection
uploadFile
},
props: {
itemId: {
type: String,
default: '',
require: true
},
url: {
type: Object,
default: '',
require: true
}
},
props: ['url'],
data() {
return {
controlType: [ // 控件类型
{value:'1', label: '文本' },
{value:'2', label: '下拉单选' },
{value:'3', label: '下拉多选' },
{value:'4', label: '附件' },
{value:'5', label: '文本+下拉单选' },
{value:'6', label: '文本+下拉多选' },
{value:'7', label: '文本+附件' },
{value:'8', label: '下拉单选+附件' },
{value:'9', label: '下拉多选+附件' },
{value:'10', label: '文本+下拉单选+附件' },
],
controlVerification: [ // 控件校验
{value:'1', label: '无' },
{value:'2', label: '中文' },
{value:'3', label: '正整数' },
{value:'4', label: '正浮点数' },
{value:'5', label: '整数或小数' },
{value:'6', label: '一位小数' },
{value:'7', label: '两位小数' },
{value:'8', label: '三位小数' },
{value:'9', label: '四位小数' },
],
CategoryTreeList: [], // 技术领域
certCategoryParamsInfoEOList: [], // 认证类别得tab栏
formInline: {},
confirmLoading: false,
visible: false,
rules: {
nioNumber:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('NiONumber'), trigger: 'change' },
// {
// pattern: /(?!^\d+$)(?!^[a-zA-Z]+$)[0-9a-zA-Z]{1,15}/,
// message: this.$t('onlyThree'),
// trigger: 'change'
// }
],
isMust: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('Required'), trigger: 'change' },
],
paramsName: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('Required'), trigger: 'change' },
{ min:1, max: 30, message: this.$t('cantExeed')+'30'+this.$t('characters'), trigger: 'blur' },
],
technologyTerritory: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('technicalField'), trigger: 'change' },
],
paramsBatch: [
{ required: true, message: this.$t('PleaseSelect')+this.$t('parameterBatch'), trigger: 'change' },
],
dutyTerritory: [
{ required: true, message: this.$t('PleaseSelect')+this.$t('areaOfResponsibility'), trigger: 'change' },
],
description: [
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' },
],
controlType: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('controlType'), trigger: 'change' },
],
controlValues: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('controlAlternatives'), trigger: 'change' },
{ min:1, max: 500, message: this.$t('cantExeed')+'500'+this.$t('characters'), trigger: 'blur' },
],
// nioNumber:[
// { required: true, message: this.$t('PleaseEnter')+this.$t('NiONumber'), trigger: 'change' },
// ]
},
disabled: false,
projectNameList: [],
title: '',
stateOne: '',
contentList : []
contentList : [],
paramsConfigEOList: [
{
id: '',
// displaySeq: 0,
configName: '', // 配置名称
version: '', // 版本
carType: '', // 车型
battery: '', // 电池
motor: '', // 电机
}
],
conIndex: 0,
deleteConfigIds: '',
deleteConfigIdsArray: []
}
},
mounted() {
this.getNameList()
this.getSysCategoryTree()
},
methods: {
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
this.$refs.uploadFile.visible = false
/** 赋值给当前对应的表单文件 */
this.formInline.fileTemplateConnectId = attIdList.join(',')
this.formInline = { ...this.formInline }
},
clickButtonToUpload(item) {
this.$refs.uploadFile.visible = true
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
// Onchangelabel(val) {
// let _tt = []
// console.log(val,'val,,,,')
// // this.formInline.certCategoryParamsInfoEOList = []
// val.forEach((item) => {
// _tt.push({
// textVal: item.text, // tab
// certCategory: '', // 所属认证类别
// paramsNumber: '', // 编号
// paramsName: '', // 参数名称
// description: ''// 参数说明
// })
// })
// this.contentList = _tt
// },
Onchange() {
},
callback() {
},
getSysCategoryTree() {
getAction('/sys/category/getSysCategoryTree', {}).then((res) => {
if (res.success) {
this.CategoryTreeList = res.result
} else {
this.CategoryTreeList = []
}
})
},
getNameList() {
getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) {
@@ -338,57 +170,64 @@ export default {
}
})
},
addModel() {
addModel(id) {
this.visible = true
this.title = '新增'
this.title = '维护配置信息'
this.formInline = {}
this.getconList(id)
},
editModel(value) {
this.visible = true
this.title = '编辑'
this.title = '编辑配置信息'
this.$nextTick(() => {
this.formInline = value
})
// if(value.certCategoryParamsInfoEOList.length > 0 ) {
// this.contentList = value.certCategoryParamsInfoEOList
// }
console.log(this.contentList,'this.contentList')
console.log(value.certCategoryParamsInfoEOList,'lllll')
},
getconList(id) {
getAction(`${this.url.conList}?paramsManifestId=${id}`, {}).then((res) => {
if (res.success) {
this.paramsConfigEOList = res.result.length === 0 ? this.paramsConfigEOList : res.result
this.visible = true
} else {
this.$message.warning(res.message)
}
})
},
addConfiguration(item) {
this.paramsConfigEOList.splice(item.displaySeq + 1,0,{
id: '',
configName: '', // 配置名称
version: '', // 版本
carType: '', // 车型
battery: '', // 电池
motor: '', // 电机
})
},
deleteConfiguration(displaySeq,index) {
this.deleteConfigIdsArray.push(displaySeq)
this.deleteConfigIds = this.deleteConfigIdsArray.join(',')
let _tt = this.paramsConfigEOList.splice(index,1)
},
handleCancel() {
this.visible = false
},
handleSubmit() {
// 校验nio编号
getAction(this.url.checkNIOnumber + `?nioNumber=${this.formInline.nioNumber}`, {} ).then((res) => {
if (res) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
let Action
this.formInline.paramsTemplateId = this.$route.query.id
if (this.formInline.id) {
url = this.url.edit
Action = postAction
} else {
url = this.url.add
Action = postAction
let querycontentList = {}
let paramsManifestId = { paramsManifestId : this.itemId }
querycontentList = {
paramsConfigEOList: this.paramsConfigEOList,
deleteConfigIds: this.deleteConfigIds
}
let query = JSON.parse(JSON.stringify(this.formInline))
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
let querycontentList = JSON.parse(JSON.stringify(this.contentList))
query.certCategoryParamsInfoEOList = querycontentList
this.confirmLoading = true
Action(url, query).then((res) => {
let querycontentListItem = { ...querycontentList, ...paramsManifestId }
postAction(this.url.conAdd, querycontentListItem).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.$emit('addModelList')
this.deleteConfigIds = ''
this.deleteConfigIdsArray = []
} else {
this.$message.warning(res.message)
this.confirmLoading = false
@@ -396,23 +235,6 @@ export default {
})
}
})
} else {
this.$message.warning(this.$t('NiOnumberalreadyexists'))
}
})
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
projectNameChange(value){
console.log(value)
},
}
}