[update] 绑定零部件联调
This commit is contained in:
+8
-5
@@ -138,10 +138,12 @@ const getWorkGroupTreeList = (params) => getAction('/sys/lawsWorkingGroup/list',
|
||||
// 企业级别映射管理,获取列表
|
||||
const getEnterpriseLevelMapList = (params) => getAction('/sys/lawsGrade/list', params)
|
||||
|
||||
// 绑定零部件-获取拆分标准
|
||||
const getSplitStandardList = (params) => getAction('/laws/bindPart/selectStandard', params)
|
||||
// 绑定零部件-获取零部件
|
||||
const getPartInfo = (params) => getAction('', params)
|
||||
// 根据标准id获取条款列表
|
||||
const getClauseListByStandard = (params) => getAction('', params)
|
||||
// const getPartInfo = (params) => getAction('', params)
|
||||
// 根据标准拆分id获取条款列表
|
||||
const getClauseListByStandardInfoId = (params) => postAction('/laws/bindPart/selectClause', params)
|
||||
|
||||
// ASMS接口管理-新增
|
||||
const addAsmsInterface = (params) => postAction('/docking/asms/api/lawsAsmsOpenApi/add', params)
|
||||
@@ -230,8 +232,9 @@ export {
|
||||
|
||||
getEnterpriseLevelMapList,
|
||||
|
||||
getPartInfo,
|
||||
getClauseListByStandard,
|
||||
getSplitStandardList,
|
||||
// getPartInfo,
|
||||
getClauseListByStandardInfoId,
|
||||
|
||||
getSSOUserInfo,
|
||||
getTodoSSOUserInfo,
|
||||
|
||||
@@ -589,7 +589,7 @@ module.exports = {
|
||||
articleNumber: '条文号',
|
||||
articleTitle: '条文标题',
|
||||
articleContent: '条文内容',
|
||||
pleaseSelectStandard: '请先选择标准'
|
||||
pleaseSelectStandard: '请先选择已拆分标准'
|
||||
},
|
||||
// 企标计划选择器
|
||||
enterprisePlanSelect: {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<clause-selection-modal ref="clauseSelectionModal"
|
||||
v-bind="$attrs"
|
||||
:value="value"
|
||||
:standard-id="standardId"
|
||||
:info-id="infoId"
|
||||
@change="modalInput"
|
||||
@nameChange="modalNameChange"
|
||||
@listChange="modalListChange"></clause-selection-modal>
|
||||
@@ -59,8 +59,8 @@ export default {
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
// 标准id
|
||||
standardId: {
|
||||
// 标准拆分id
|
||||
infoId: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
methods: {
|
||||
// 点击选择条款按钮
|
||||
clauseClick () {
|
||||
if (!this.standardId) {
|
||||
if (!this.infoId) {
|
||||
this.$message.warning(this.$t('clauseSelect.pleaseSelectStandard'))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { getClauseListByStandard } from '../../api/api'
|
||||
import { getClauseListByStandardInfoId } from '../../api/api'
|
||||
|
||||
export default {
|
||||
name: 'ClauseSelectionModal',
|
||||
@@ -83,8 +83,8 @@ export default {
|
||||
required: false,
|
||||
default: 'checkbox'
|
||||
},
|
||||
// 标准id
|
||||
standardId: {
|
||||
// 标准拆分id
|
||||
infoId: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
@@ -147,8 +147,8 @@ export default {
|
||||
open () {
|
||||
this.visible = true
|
||||
this.queryParam = {}
|
||||
if (this.standardId) {
|
||||
this.filters.standardId = this.standardId
|
||||
if (this.infoId) {
|
||||
this.filters.infoId = this.infoId
|
||||
}
|
||||
this.replacePage()
|
||||
},
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
}
|
||||
// this.selectedRowKeys = []
|
||||
this.loading = true
|
||||
getClauseListByStandard(query).then((res) => {
|
||||
getClauseListByStandardInfoId(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataList = res.result.records
|
||||
this.ipagination.total = res.result.total
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<div class="selection-wrapper">
|
||||
<div class="box-title-text">
|
||||
<a-input class="box-input"
|
||||
:value="nameStr || value"
|
||||
:title="value"
|
||||
@input="indexClick($event)"
|
||||
:disabled="disabled || selectOnly"
|
||||
:max-length="500"
|
||||
:placeholder="placeholder">
|
||||
|
||||
<a-icon v-if="(nameStr || value) && !disabled" slot="suffix" class="close-icon" type="close-circle" theme="filled" @click="clearInput" />
|
||||
</a-input>
|
||||
<a-button v-if="!disabled" type="primary" class="button-box" @click="standardClick">
|
||||
{{ $t('standardSelect.standardSelection') }}
|
||||
</a-button>
|
||||
</div>
|
||||
<split-standard-selection-modal ref="standardSelectionModal"
|
||||
v-bind="$attrs"
|
||||
:value="value"
|
||||
@change="modalInput"
|
||||
@nameChange="modalNameChange"
|
||||
@listChange="modalListChange"></split-standard-selection-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SplitStandardSelectionModal from './SplitStandardSelectionModal'
|
||||
export default {
|
||||
name: 'SplitStandardSelection',
|
||||
components: { SplitStandardSelectionModal },
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 是否只能选择
|
||||
selectOnly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 自定义点击标准选择按钮的事件
|
||||
customClickFunc: {
|
||||
type: Function
|
||||
},
|
||||
// 回显内容的字符串
|
||||
nameStr: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 点击选择标准按钮
|
||||
standardClick () {
|
||||
if (this.customClickFunc && typeof this.customClickFunc === 'function') {
|
||||
this.customClickFunc(() => {
|
||||
this.$refs.standardSelectionModal.open()
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs.standardSelectionModal.open()
|
||||
},
|
||||
// 清空输入框
|
||||
clearInput () {
|
||||
console.log('输入框清空了')
|
||||
this.$emit('change', '')
|
||||
this.$emit('nameChange', '')
|
||||
this.$emit('listChange', [])
|
||||
},
|
||||
// 输入框输入监听
|
||||
indexClick (event) {
|
||||
this.$emit('change', event.target.value)
|
||||
},
|
||||
modalInput (value) {
|
||||
this.$emit('change', value)
|
||||
},
|
||||
modalNameChange (value) {
|
||||
this.$emit('nameChange', value)
|
||||
},
|
||||
modalListChange (value) {
|
||||
this.$emit('listChange', value)
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
.selection-wrapper {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.box-title-text {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.box-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.button-box {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
font-size: 12px;
|
||||
color: rgba(0, 0, 0, 0.25);
|
||||
transition: color 0.3s;
|
||||
}
|
||||
|
||||
.close-icon:hover {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="$t('standardSelect.standardSelection')"
|
||||
:maskClosable="false"
|
||||
:width="1000"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
class="custom-drawer-style">
|
||||
<div class="custom-drawer-style-scroll">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :sm="8">
|
||||
<a-form-item :label="$t('standardSelect.source')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag style="width: 100%" v-model="queryParam.source"
|
||||
:disabled="disabledSourceSearch"
|
||||
:placeholder="$t('pleaseSelect')+$t('standardSelect.source')"
|
||||
:triggerChange="false"
|
||||
:options="sourceOptions"
|
||||
@change="handleTypeChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :sm="8">
|
||||
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
|
||||
v-model="queryParam.standardName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<div style="float: right;overflow: hidden;margin-right: 41px;margin-bottom: 20px"
|
||||
class="table-page-search-submitButtons">
|
||||
<a-button style="margin-left: 8px" type="primary" icon="search" @click="searchQuery">{{ $t('query') }}</a-button>
|
||||
<a-button style="margin-left: 8px" type="primary" ghost icon="reload" @click="searchReset">{{ $t('reset') }}</a-button>
|
||||
</div>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
rowKey="standardNumber"
|
||||
:scroll="{x: 900}"
|
||||
:data-source="dataList"
|
||||
:pagination="ipagination"
|
||||
:row-selection="{ type: type, selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<template slot="text" slot-scope="text">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 企标编号/企标名称 -->
|
||||
<template v-slot:toDetail="text, record">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||
<a v-if="text" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
|
||||
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 标准状态 -->
|
||||
<template slot="standardState" slot-scope="text, record">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ record.source === '3' ? (record.esStandardState_dictText || global.emptyLine) : (record.standardState_dictText || global.emptyLine) }}</template>
|
||||
<div class="table-text">{{ record.source === '3' ? (record.esStandardState_dictText || global.emptyLine) : (record.standardState_dictText || global.emptyLine) }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<div class="custom-drawer-style-bottom-btn">
|
||||
<a-button @click="handleCancel">{{ $t('cancel') }}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{ $t('submit') }}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JDictSelectTag from '../dict/JDictSelectTag'
|
||||
import { StandardSource } from '../../enums/commonEnums'
|
||||
import { ajaxGetDictItems, getSplitStandardList } from '../../api/api'
|
||||
|
||||
export default {
|
||||
name: 'SplitStandardSelectionModal',
|
||||
components: { JDictSelectTag },
|
||||
props: {
|
||||
source: {
|
||||
type: [String, Number],
|
||||
default: '1'
|
||||
},
|
||||
// 查询条件可以选择的类型
|
||||
canSelectedSource: {
|
||||
type: [String, Array],
|
||||
required: false,
|
||||
default: () => {
|
||||
return [StandardSource.DOMESTIC.value, StandardSource.OVERSEAS.value, StandardSource.ENTERPRISE.value]
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 搜索条件中的来源是否不可更改
|
||||
disabledSourceSearch: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'checkbox'
|
||||
},
|
||||
// 列表数据不包含的标准
|
||||
excludeStandardNumbers: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
// 过滤条件
|
||||
filters: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
labelCol: {
|
||||
sm: 8
|
||||
},
|
||||
wrapperCol: {
|
||||
sm: 14
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
selectedRowList: [],
|
||||
loading: false,
|
||||
queryParam: {},
|
||||
/* 分页参数 */
|
||||
ipagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('standardNumber'),
|
||||
dataIndex: 'standardNumber',
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'toDetail' }
|
||||
},
|
||||
{
|
||||
title: this.$t('standardName'),
|
||||
dataIndex: 'standardName',
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'toDetail' }
|
||||
},
|
||||
// 发布日期
|
||||
{
|
||||
title: this.$t('standardSelect.releaseDate'),
|
||||
dataIndex: 'releaseDate',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('standardSelect.textState'),
|
||||
dataIndex: 'standardState_dictText',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'standardState' }
|
||||
}
|
||||
],
|
||||
dataList: [],
|
||||
sourceOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open () {
|
||||
this.visible = true
|
||||
this.queryParam = {}
|
||||
this.initDict()
|
||||
this.$nextTick(() => {
|
||||
this.source ? this.queryParam.source = this.source : this.queryParam = {}
|
||||
this.replacePage()
|
||||
})
|
||||
},
|
||||
initDict () {
|
||||
ajaxGetDictItems('standard_source').then(res => {
|
||||
if (res.success) {
|
||||
const canSelectedArr = typeof this.canSelectedSource === 'string' ? this.canSelectedSource.split(',') : this.canSelectedSource
|
||||
this.sourceOptions = res.result.filter(tt => canSelectedArr.includes(tt.value))
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取表格数据
|
||||
replacePage (arg) {
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
const query = {
|
||||
...this.queryParam,
|
||||
...this.filters,
|
||||
pageNo: this.ipagination.current,
|
||||
pageSize: this.ipagination.pageSize
|
||||
}
|
||||
// 清空在可选范围内进行查询
|
||||
if (!query.source && this.canSelectedSource.length < 3) {
|
||||
query.source = this.canSelectedSource.join(',')
|
||||
}
|
||||
// this.selectedRowKeys = []
|
||||
this.loading = true
|
||||
getSplitStandardList(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataList = res.result.records
|
||||
this.ipagination.total = res.result.total
|
||||
this.selectedRowKeys = this.value ? this.value.split(',') : (this.selectedRowKeys || [])
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
searchQuery () {
|
||||
this.replacePage(1)
|
||||
},
|
||||
searchReset () {
|
||||
// 如果禁用来源,就不重置来源
|
||||
if (this.disabledSourceSearch) {
|
||||
this.queryParam = { source: this.source }
|
||||
} else {
|
||||
this.queryParam = {}
|
||||
}
|
||||
this.replacePage(1)
|
||||
},
|
||||
// 表格选择改变
|
||||
onSelectChange (selectedRowKeys, selectedRows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
// this.selectedRowList = row
|
||||
if (this.type === 'checkbox') {
|
||||
if (selectedRowKeys.length > this.selectedRowList.length) {
|
||||
// 说明是增加了数据
|
||||
for (const rowIndex in selectedRows) {
|
||||
if (!this.selectedRowList.find(item => item.standardNumber === selectedRows[rowIndex].standardNumber)) {
|
||||
// 不存在,追加
|
||||
this.selectedRowList.push(selectedRows[rowIndex])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 说明是删除了数据
|
||||
if (selectedRowKeys && selectedRowKeys.length > 0) {
|
||||
// 没有选中数据,说明这一页没有选中数据了
|
||||
for (let i = 0; i < this.selectedRowList.length; i++) {
|
||||
if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber)) {
|
||||
// 表格选中中没有找到这一条数据,说明已经被删了
|
||||
this.selectedRowList.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.selectedRowList = []
|
||||
}
|
||||
}
|
||||
console.log(this.selectedRowList)
|
||||
} else {
|
||||
this.selectedRowList = selectedRows
|
||||
}
|
||||
},
|
||||
handleTableChange (pagination) {
|
||||
// 分页、排序、筛选变化时触发
|
||||
this.ipagination = pagination
|
||||
this.replacePage()
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
handleSubmit () {
|
||||
const serialNumber = []
|
||||
const serialNameArr = []
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
this.selectedRowList.forEach(res => {
|
||||
serialNumber.push(res.standardNumber)
|
||||
serialNameArr.push(res.standardName)
|
||||
})
|
||||
this.$emit('change', this.selectedRowKeys.join(','))
|
||||
this.$emit('nameChange', serialNameArr.join(','))
|
||||
this.$emit('listChange', this.selectedRowList)
|
||||
this.close()
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
}
|
||||
},
|
||||
close () {
|
||||
this.visible = false
|
||||
this.selectedRowKeys = []
|
||||
this.ipagination = {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
handleTypeChange () {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 点击跳转标准详情
|
||||
handleGoDetail (record) {
|
||||
let path = ''
|
||||
// 需要先判断是哪种标准
|
||||
if (record.source === '1') {
|
||||
path = '/standardRegulationLibrary/DomesticStandardDetail'
|
||||
} else if (record.source === '2') {
|
||||
path = '/standardRegulationLibrary/OverseasStandardDetail'
|
||||
} else if (record.source === '3') {
|
||||
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
|
||||
}
|
||||
this.$openPageNewSheet({
|
||||
path: path,
|
||||
query: {
|
||||
id: record.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
@@ -10,7 +10,7 @@
|
||||
<a-form-item :label="$t('system.bindingParts.partNumber')">
|
||||
<j-input
|
||||
:placeholder="$t('pleaseEnter') + $t('system.bindingParts.partNumber')"
|
||||
v-model="queryParam.partNumber"></j-input>
|
||||
v-model="queryParam.partNo"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--零部件名称-->
|
||||
@@ -26,7 +26,7 @@
|
||||
<a-form-item :label="$t('standardNumber')">
|
||||
<j-input
|
||||
:placeholder="$t('pleaseEnter') + $t('standardNumber')"
|
||||
v-model="queryParam.standardNumber"></j-input>
|
||||
v-model="queryParam.standardNo"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
@@ -35,7 +35,7 @@
|
||||
<a-form-item :label="$t('standardName')">
|
||||
<j-input
|
||||
:placeholder="$t('pleaseEnter') + $t('standardName')"
|
||||
v-model="queryParam.standardNumber"></j-input>
|
||||
v-model="queryParam.standardName"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--绑定人员-->
|
||||
@@ -43,7 +43,7 @@
|
||||
<a-form-item :label="$t('system.bindingParts.bindingPersonnel')">
|
||||
<j-input
|
||||
:placeholder="$t('pleaseEnter') + $t('system.bindingParts.bindingPersonnel')"
|
||||
v-model="queryParam.bindingPersonnel"></j-input>
|
||||
v-model="queryParam.bindUser"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@@ -135,7 +135,7 @@ export default {
|
||||
title: this.$t('system.bindingParts.partNumber'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'partNumber',
|
||||
dataIndex: 'partNo',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 零部件名称
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
title: this.$t('standardNumber'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'standardNumber',
|
||||
dataIndex: 'standardNo',
|
||||
scopedSlots: { customRender: 'standardSlot' }
|
||||
},
|
||||
{ // 标准名称
|
||||
@@ -163,21 +163,21 @@ export default {
|
||||
title: this.$t('system.bindingParts.clauseNumber'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'clauseNumber',
|
||||
dataIndex: 'clauseNos',
|
||||
scopedSlots: { customRender: 'clauseSlot' }
|
||||
},
|
||||
{ // 绑定人员
|
||||
title: this.$t('system.bindingParts.bindingPersonnel'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'bindingPersonnel',
|
||||
dataIndex: 'bindUser_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 绑定时间
|
||||
title: this.$t('system.bindingParts.bindingTime'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'bindingTime',
|
||||
dataIndex: 'bindTime',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 操作
|
||||
@@ -189,14 +189,11 @@ export default {
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '',
|
||||
deleteBatch: '',
|
||||
delete: '',
|
||||
list: '/laws/bindPart/page',
|
||||
deleteBatch: '/laws/bindPart/deleteBatch',
|
||||
delete: '/laws/bindPart/delete',
|
||||
useBindingRelationship: '' // 使用绑定关系
|
||||
},
|
||||
dataSource: [
|
||||
{ id: 1, clauseNumber: 1 }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -13,26 +13,35 @@
|
||||
<a-form :form="form">
|
||||
<!--零部件号-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.bindingParts.partNumber')">
|
||||
<a-select v-decorator.trim="[ 'partNumber', validatorRules.partNumber ]" disabled>
|
||||
<a-select-option v-for="item in partNumberOption" :key="item.id" :value="item.number">
|
||||
{{ item.number }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('system.bindingParts.partNumber')"
|
||||
:maxLength="50"
|
||||
disabled
|
||||
v-decorator.trim="[ 'partNo', validatorRules.partNo ]" />
|
||||
<!--<a-select v-decorator.trim="[ 'partNo', validatorRules.partNo ]" disabled>-->
|
||||
<!-- <a-select-option v-for="item in partNoOption" :key="item.id" :value="item.number">-->
|
||||
<!-- {{ item.number }}-->
|
||||
<!-- </a-select-option>-->
|
||||
<!--</a-select>-->
|
||||
</a-form-item>
|
||||
<!--零部件名称-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.bindingParts.partName')">
|
||||
<a-select v-decorator.trim="[ 'partName', validatorRules.partName ]" disabled>
|
||||
<a-select-option v-for="item in partNumberOption" :key="item.id" :value="item.number">
|
||||
{{ item.number }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('system.bindingParts.partName')"
|
||||
:maxLength="50"
|
||||
disabled
|
||||
v-decorator.trim="[ 'partName', validatorRules.partName ]" />
|
||||
<!--<a-select v-decorator.trim="[ 'partName', validatorRules.partName ]" disabled>-->
|
||||
<!-- <a-select-option v-for="item in partNoOption" :key="item.id" :value="item.number">-->
|
||||
<!-- {{ item.number }}-->
|
||||
<!-- </a-select-option>-->
|
||||
<!--</a-select>-->
|
||||
</a-form-item>
|
||||
<!--标准编号-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardNumber')">
|
||||
<standard-selection :placeholder="$t('pleaseSelect') + $t('standardNumber')"
|
||||
v-decorator="['standardId', validatorRules.standardId]"
|
||||
type="radio"
|
||||
@listChange="handleStandardChange" />
|
||||
<split-standard-selection :placeholder="$t('pleaseSelect') + $t('standardNumber')"
|
||||
v-decorator="['sarFileSplitInfoId', validatorRules.sarFileSplitInfoId]"
|
||||
type="radio"
|
||||
:nameStr="model.standardNo"
|
||||
@listChange="handleStandardChange" />
|
||||
</a-form-item>
|
||||
<!--标准名称-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardName')">
|
||||
@@ -44,16 +53,19 @@
|
||||
<!--条款号-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.bindingParts.clauseNumber')">
|
||||
<clause-selection :placeholder="$t('pleaseSelect') + $t('system.bindingParts.clauseNumber')"
|
||||
v-decorator="['clauseId', validatorRules.clauseId]"
|
||||
:standard-id="standardId"
|
||||
v-decorator="['clauseIds', validatorRules.clauseIds]"
|
||||
:nameStr="model.clauseNos"
|
||||
:info-id="sarFileSplitInfoId"
|
||||
@listChange="handleClauseChange"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!--绑定人员-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.bindingParts.bindingPersonnel')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('system.bindingParts.bindingPersonnel')"
|
||||
:maxLength="50"
|
||||
disabled
|
||||
v-decorator.trim="[ 'bindingPersonnel', validatorRules.bindingPersonnel ]" />
|
||||
<user-selection :placeholder="$t('pleaseEnter') + $t('system.bindingParts.bindingPersonnel')"
|
||||
:maxLength="50"
|
||||
disabled
|
||||
:name-str="model.bindUser_dictText"
|
||||
v-decorator.trim="[ 'bindUser', validatorRules.bindUser ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
@@ -62,20 +74,24 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StandardSelection from '@/components/selection/StandardSelection'
|
||||
import pick from 'lodash.pick'
|
||||
import ClauseSelection from '../../../../components/selection/ClauseSelection'
|
||||
import { getPartInfo } from '../../../../api/api'
|
||||
// import { getPartInfo } from '../../../../api/api'
|
||||
import { postAction } from '../../../../api/manage'
|
||||
import UserSelection from '../../../../components/selection/UserSelection'
|
||||
import SplitStandardSelection from '../../../../components/selection/SplitStandardSelection'
|
||||
import { USER_INFO } from '../../../../store/mutation-types'
|
||||
import Vue from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'BingingPartsModal',
|
||||
components: { ClauseSelection, StandardSelection },
|
||||
components: { SplitStandardSelection, UserSelection, ClauseSelection },
|
||||
data () {
|
||||
return {
|
||||
title: '',
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
model: {},
|
||||
form: this.$form.createForm(this),
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
@@ -87,7 +103,7 @@ export default {
|
||||
},
|
||||
validatorRules: {
|
||||
// 零部件号
|
||||
partNumber: {
|
||||
partNo: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.bindingParts.partNumber') }
|
||||
],
|
||||
@@ -101,14 +117,14 @@ export default {
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
// 标准编号
|
||||
standardNumber: {
|
||||
sarFileSplitInfoId: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseSelect') + this.$t('standardNumber') }
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
// 绑定人员
|
||||
bindingPersonnel: {
|
||||
bindUser: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseSelect') + this.$t('system.bindingParts.bindingPersonnel') }
|
||||
],
|
||||
@@ -116,57 +132,72 @@ export default {
|
||||
}
|
||||
},
|
||||
url: {
|
||||
add: '',
|
||||
edit: ''
|
||||
add: '/laws/bindPart/add',
|
||||
edit: '/laws/bindPart/edit'
|
||||
},
|
||||
partNumberOption: [], // 零部件下拉框
|
||||
standardId: ''
|
||||
// partNoOption: [], // 零部件下拉框
|
||||
sarFileSplitInfoId: '' // 已选中的标准的拆分id
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async add () {
|
||||
this.visible = true
|
||||
await this.getPartInfo((res) => {
|
||||
this.form.resetFields()
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(res.result, 'partNumber', 'partName', 'bindingPersonnel'))
|
||||
})
|
||||
this.form.resetFields()
|
||||
const userInfo = Vue.ls.get(USER_INFO)
|
||||
this.model.bindUser_dictText = userInfo.realname + '(' + userInfo.username + ')'
|
||||
this.model.bindUser = userInfo.id
|
||||
this.model.partNo = this.$route.query.partNo
|
||||
this.model.partName = this.$route.query.partName
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'partNo', 'partName', 'bindUser'))
|
||||
})
|
||||
// await this.getPartInfo((res) => {
|
||||
// this.form.resetFields()
|
||||
// this.model.bindUser_dictText = res.result.bindUser_dictText
|
||||
// this.$nextTick(() => {
|
||||
// this.form.setFieldsValue(pick(res.result, 'partNo', 'partName', 'bindUser'))
|
||||
// })
|
||||
// })
|
||||
},
|
||||
edit (record) {
|
||||
this.visible = true
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'partNumber', 'partName', 'standardNumber', 'standardName', 'clauseNumber', 'bindingPersonnel'))
|
||||
this.form.setFieldsValue(pick(this.model, 'partNo', 'partName', 'sarFileSplitInfoId', 'standardName', 'clauseIds', 'bindUser'))
|
||||
})
|
||||
},
|
||||
// 标准编号改变
|
||||
handleStandardChange (value) {
|
||||
this.standardId = value[0].id
|
||||
this.sarFileSplitInfoId = value[0].infoId
|
||||
this.model.standardNo = value[0].standardNo
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(value[0], 'standardName'))
|
||||
})
|
||||
},
|
||||
// 获取零部件
|
||||
getPartInfo (callback) {
|
||||
this.confirmLoading = true
|
||||
getPartInfo().then(res => {
|
||||
if (res.success) {
|
||||
this.partNumberOption = res.result
|
||||
if (callback) {
|
||||
callback(res)
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
// 条款号变化
|
||||
handleClauseChange (value) {
|
||||
this.model.clauseNos = value.map(item => item.clauseNo).join(',')
|
||||
},
|
||||
// 获取零部件
|
||||
// getPartInfo (callback) {
|
||||
// this.confirmLoading = true
|
||||
// getPartInfo().then(res => {
|
||||
// if (res.success) {
|
||||
// this.partNoOption = res.result
|
||||
// if (callback) {
|
||||
// callback(res)
|
||||
// }
|
||||
// } else {
|
||||
// this.$message.warning(res.message)
|
||||
// }
|
||||
// }).finally(() => {
|
||||
// this.confirmLoading = false
|
||||
// })
|
||||
// },
|
||||
close () {
|
||||
this.visible = false
|
||||
this.partNumberOption = []
|
||||
// this.partNoOption = []
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
|
||||
Reference in New Issue
Block a user