Compare commits
3 Commits
master
...
release/mi
| Author | SHA1 | Date |
|---|---|---|
|
|
da8ac99264 | 3 weeks ago |
|
|
186c5f2131 | 3 weeks ago |
|
|
c09788e395 | 4 weeks ago |
36 changed files with 2620 additions and 228 deletions
@ -0,0 +1,499 @@ |
|||
<template> |
|||
<j-modal class="approval-new-dialog" :title="title" :width="width" :visible="visible" @cancel="handleCancel" |
|||
:footer="null"> |
|||
<!-- <template slot="footer"> |
|||
<w-button type="primary" @click="handleCancel">关闭</w-button> |
|||
</template> --> |
|||
<a-spin :spinning="loading"> |
|||
<div v-if="type === 'submit'"> |
|||
<div> |
|||
<div class="topArea"> |
|||
<div class="topArea_box"> |
|||
<div class="topArea_theme"> |
|||
<div class="topArea_theme_label"> |
|||
主题 |
|||
</div> |
|||
<w-input style="width: 300px;" v-model="themeTitle" /> |
|||
</div> |
|||
<div class="buttonArea"> |
|||
<w-button v-for="item in buttonList" :key="item.name" type="primary" @click="openFlowModal(item)">{{ |
|||
item.name }}</w-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<w-tabs v-model="activeKey" type="card" style="width: 100%" size="mini"> |
|||
<w-tab-pane tab="流程表格" key="flowTable" :forceRender="true"> |
|||
<a-table ref="table" :columns="submitColumns" :pagination="false" :dataSource="dataSource" bordered |
|||
size="middle" row-key="id" class="j-table-force-nowrap"> |
|||
<span slot="operator" slot-scope="text, record"> |
|||
<span v-if="record.showType === 'text'">{{ record.handlerNames }} </span> |
|||
<!-- <w-input v-else-if="record.showType === 'input'" v-model="operator" /> --> |
|||
<AppprovalUserSelect v-model="record.operator" :disabled="record.disabled" |
|||
v-else-if="record.showType === 'input'" @change="(data) => getOperator(data, record)" /> |
|||
<span v-else></span> |
|||
</span> |
|||
</a-table> |
|||
</w-tab-pane> |
|||
</w-tabs> |
|||
</div> |
|||
</div> |
|||
<div v-if="type === 'audit'"> |
|||
<div> |
|||
<div class="topArea"> |
|||
<div class="topArea_box"> |
|||
<div class="topArea_theme"> |
|||
<!-- <div class="topArea_theme_label"> |
|||
主题 |
|||
</div> --> |
|||
<div> |
|||
{{ themeTitle }} |
|||
</div> |
|||
</div> |
|||
<div class="buttonArea"> |
|||
<!-- 遍历 --> |
|||
<w-button v-for="(item, index) in buttonList" :key="item.name" :type="index === 0 ? 'primary' : ''" |
|||
@click="openFlowModal(item)">{{ |
|||
item.name }}</w-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<w-tabs v-model="activeKey" type="card" style="width: 100%" size="mini"> |
|||
<w-tab-pane tab="审批记录" key="auditRecord" :forceRender="true"> |
|||
<a-table ref="table" :columns="auditColumns" :pagination="false" :dataSource="dataSource" bordered |
|||
size="middle" row-key="id" class="j-table-force-nowrap" /> |
|||
</w-tab-pane> |
|||
<w-tab-pane tab="日志" key="auditLog" :forceRender="true"> |
|||
<a-table ref="table" :columns="auditColumns" :pagination="false" :dataSource="logList" bordered |
|||
size="middle" row-key="id" class="j-table-force-nowrap" /> |
|||
</w-tab-pane> |
|||
</w-tabs> |
|||
</div> |
|||
</div> |
|||
</a-spin> |
|||
<passModal ref="passModal" @ok="hanledOK" /> |
|||
</j-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
import { postAction } from '@/api/manage'; |
|||
import passModal from './components/passModal.vue'; |
|||
import { mapGetters } from 'vuex'; |
|||
import AppprovalUserSelect from '@/components/AppprovalUserSelect/index'; |
|||
export default { |
|||
name: "ApprovalProgressTemplate", |
|||
components: { |
|||
passModal, |
|||
AppprovalUserSelect |
|||
}, |
|||
data() { |
|||
return { |
|||
loading: false, |
|||
type: 'submit', |
|||
activeKey: 'flowTable', |
|||
title: "提交", |
|||
width: 800, |
|||
visible: false, |
|||
themeTitle: '', |
|||
// 业务id |
|||
businessId: '', |
|||
// 流程id |
|||
flowId: "", |
|||
// 操作人 |
|||
operator: "", |
|||
operatorName: '', |
|||
submitColumns: [ |
|||
{ |
|||
title: '序号', |
|||
dataIndex: 'nodeId', |
|||
key: 'nodeId', |
|||
width: 60, |
|||
align: 'center', |
|||
}, |
|||
{ |
|||
title: '节点', |
|||
align: 'center', |
|||
dataIndex: 'nodeName', |
|||
ellipsis: true, |
|||
width: 200, |
|||
}, |
|||
{ |
|||
title: '处理人', |
|||
align: 'center', |
|||
width: 300, |
|||
dataIndex: 'operator', |
|||
ellipsis: true, |
|||
scopedSlots: { customRender: 'operator' }, |
|||
}, |
|||
{ |
|||
title: '类型', |
|||
align: 'center', |
|||
dataIndex: 'processType', |
|||
ellipsis: true, |
|||
}, |
|||
], |
|||
auditColumns: [ |
|||
{ |
|||
title: '节点', |
|||
align: 'center', |
|||
dataIndex: 'fdNodeId', |
|||
ellipsis: true, |
|||
width: 100, |
|||
}, |
|||
{ |
|||
title: '节点名称', |
|||
align: 'center', |
|||
dataIndex: 'fdNodeName', |
|||
ellipsis: true, |
|||
width: 100, |
|||
}, |
|||
{ |
|||
title: '操作人', |
|||
align: 'center', |
|||
width: 100, |
|||
dataIndex: 'fdHandlerName', |
|||
ellipsis: true, |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
dataIndex: 'fdOperationName', |
|||
ellipsis: true, |
|||
width: 100, |
|||
}, |
|||
{ |
|||
title: '附件/审批意见', |
|||
align: 'center', |
|||
dataIndex: 'fdAuditeInfo', |
|||
ellipsis: true, |
|||
width: 200, |
|||
}, |
|||
// { |
|||
// title: '时间', |
|||
// align: 'center', |
|||
// dataIndex: 'time', |
|||
// ellipsis: true, |
|||
// width: 100, |
|||
// }, |
|||
], |
|||
dataSource: [], |
|||
url: { |
|||
// 流程初始化 |
|||
initProcess: '/flow/common/initProcess', |
|||
// 按钮list |
|||
optionList: '/flow/common/optionList', |
|||
// 流程list |
|||
flowList: '/flow/common/info/table', |
|||
// 提交 |
|||
submit: '/flow/common/submit', |
|||
// 审核 |
|||
approve: '/flow/common/approve', |
|||
// 审批记录 |
|||
auditeNote: '/flow/common/auditeNote', |
|||
// 补充审批记录 |
|||
auditeNoteSupply: '/flow/common/info/process', |
|||
// 日志 |
|||
logList: '/flow/common/log/list', |
|||
// 驳回节点列表 |
|||
refuseNode: '/flow/common/refuseNode/process', |
|||
// 查询 |
|||
getFdTemplateCodeApi: '/merger/mergerGoods/v1/check-merger-goods-by-id', |
|||
}, |
|||
buttonList: [], |
|||
fdActivityType: '', |
|||
taskId: "", |
|||
nodeInstanceId: '', |
|||
refuseNodeList: [], |
|||
logList: [], |
|||
fdTemplateCode: 'mergerApply' |
|||
} |
|||
}, |
|||
methods: { |
|||
...mapGetters(['userInfo']), |
|||
async getFlowList() { |
|||
const res = await postAction(this.url.optionList, { |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
}); |
|||
const resp = await postAction(this.url.flowList, { |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
}); |
|||
if (res.success) { |
|||
if (res.result.length) { |
|||
this.buttonList = res.result[0].operationList.filter(item => !['沟通', '废弃'].includes(item.name)); |
|||
this.buttonList = this.buttonList.sort((a, b) => a.order - b.order); |
|||
} else { |
|||
this.buttonList = []; |
|||
} |
|||
} else { |
|||
this.$message.error(res.message); |
|||
this.loading = false; |
|||
} |
|||
if (resp.success) { |
|||
this.dataSource = resp.result.processNodes || []; |
|||
this.dataSource.forEach((item) => { |
|||
this.$set(item, 'showType', 'text'); |
|||
if (item.activityType === 'approveNode') { |
|||
item.showType = 'input'; |
|||
item.disabled = !(item.mustSelected || item.canSelected); |
|||
item.operator = item.handlers && item.handlers.length ? item.handlers[0].id : this.operator; |
|||
} |
|||
}); |
|||
} else { |
|||
this.$message.error(res.message); |
|||
this.loading = false; |
|||
} |
|||
setTimeout(() => { |
|||
this.loading = false |
|||
}, 100); |
|||
}, |
|||
async getLogList() { |
|||
const res = await postAction(this.url.optionList, { |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
}) |
|||
if (res.success) { |
|||
if (res.result.length) { |
|||
this.buttonList = res.result[0].operationList.filter(item => !['沟通', '废弃'].includes(item.name)); |
|||
this.buttonList = this.buttonList.sort((a, b) => a.order - b.order); |
|||
} else { |
|||
this.buttonList = []; |
|||
} |
|||
} else { |
|||
this.$message.error(res.message); |
|||
this.loading = false; |
|||
} |
|||
const resp = await postAction(this.url.auditeNote, { |
|||
bsId: this.businessId, |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
}) |
|||
const resppp = await postAction(this.url.logList, { |
|||
bsId: this.businessId, |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
}) |
|||
this.logList = JSON.parse(resppp.result); |
|||
if (resp.success) { |
|||
this.dataSource = resp.result; |
|||
const response = await postAction(this.url.auditeNoteSupply, { |
|||
// bsId: this.businessId, |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
}) |
|||
if (response.result.currNodes && response.result.currNodes.length > 0) { |
|||
this.themeTitle = response.result.subject; |
|||
this.nodeInstanceId = response.result.currNodes[0].nodeInstanceId; |
|||
this.dataSource.push({ |
|||
fdNodeId: response.result.currNodeIds, |
|||
fdNodeName: response.result.currNodes[0].nodeName, |
|||
fdHandlerName: response.result.currNodes[0].handlers[0].name, |
|||
fdOperationName: response.result.fdStatus, |
|||
fdAuditeInfo: response.result.nodeDesc, |
|||
}) |
|||
} |
|||
} else { |
|||
this.$message.error(res.message); |
|||
this.loading = false; |
|||
} |
|||
setTimeout(() => { |
|||
this.loading = false; |
|||
}, 100); |
|||
}, |
|||
async openFlowModal(obj) { |
|||
this.operationFlag = obj.operationType; |
|||
this.taskId = obj.operationTaskList[0].fdTaskId; |
|||
this.fdActivityType = obj.operationTaskList[0].fdActivityType; |
|||
let title = ''; |
|||
if (this.operationFlag === 'handler_pass') { |
|||
title = '通过'; |
|||
} else if (this.operationFlag === 'draft_submit') { |
|||
title = '提交'; |
|||
if (!this.operator) { |
|||
return this.$message.info('请先选择处理人') |
|||
} |
|||
} else if (this.operationFlag === 'handler_commission') { |
|||
title = '转办'; |
|||
} else if (this.operationFlag === 'handler_refuse') { |
|||
title = '驳回'; |
|||
const res = await postAction(this.url.refuseNode, { |
|||
fdId: this.flowId, |
|||
loginName: this.userInfo().username, |
|||
nodeInstanceId: this.nodeInstanceId |
|||
}) |
|||
this.refuseNodeList = res.result; |
|||
} else if (['draft_abandon', 'handler_abandon'].includes(this.operationFlag)) { |
|||
title = '废弃'; |
|||
} else if (this.operationFlag === 'handler_communicate') { |
|||
title = '沟通'; |
|||
} |
|||
this.$refs.passModal.show({ |
|||
title, |
|||
flag: this.operationFlag, |
|||
refuseNodeList: this.refuseNodeList |
|||
}) |
|||
}, |
|||
async show(obj) { |
|||
this.type = obj.type; |
|||
this.activeKey = this.type === 'submit' ? 'flowTable' : 'auditRecord'; |
|||
this.businessId = obj.id; |
|||
this.visible = true; |
|||
this.flowId = obj.flowId; |
|||
this.operator = obj.defaultverifyBy || ''; |
|||
this.fdTemplateCode = obj.mergerApplyFactory || 'mergerApplyFactory'; |
|||
this.loading = true; |
|||
this.themeTitle = obj.title || ''; |
|||
if (this.type === 'submit') { |
|||
if (this.flowId) { |
|||
this.getFlowList(); |
|||
} else { |
|||
const res = await postAction(this.url.initProcess, { |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
loginName: this.userInfo().username, |
|||
id: this.businessId |
|||
}) |
|||
if (res.success) { |
|||
this.flowId = res.result; |
|||
this.getFlowList(); |
|||
} else { |
|||
this.$message.error(res.message); |
|||
this.loading = false; |
|||
} |
|||
} |
|||
} else { |
|||
this.title = '审核'; |
|||
this.flowId = obj.flowId; |
|||
this.getLogList(); |
|||
} |
|||
}, |
|||
handleCancel() { |
|||
this.visible = false; |
|||
this.operator = ''; |
|||
}, |
|||
getOperator(data, row) { |
|||
if (data && data.length > 0) { |
|||
row.operatorName = data[0].userName; |
|||
} else { |
|||
row.operatorName = ''; |
|||
} |
|||
}, |
|||
async hanledOK(obj) { |
|||
// 提交 |
|||
if (this.operationFlag === 'draft_submit') { |
|||
let fdUrl = ''; |
|||
if (this.fdTemplateCode === 'mergerApplyFactory') { |
|||
const env = process.env.NODE_ENV === 'prod' ? '' : process.env.NODE_ENV; |
|||
fdUrl = `https://gcs${env ? String(env).toLocaleLowerCase() : ''}.midea.com/#/iflowPage/classifyFactoryApproval`; |
|||
// fdUrl = `https://gcssit.midea.com/#/iflowPage/classifyFactoryApproval`; |
|||
} |
|||
const nodeList = this.dataSource.filter(item => item.activityType === 'approveNode'); |
|||
|
|||
const res = await postAction(this.url.submit, { |
|||
bsId: this.businessId, |
|||
loginName: this.userInfo().username, |
|||
docSubject: this.themeTitle, |
|||
fdId: this.flowId, |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
auditNote: obj.remark, |
|||
processParam: { |
|||
changeNodeHandler: nodeList.map(i => { |
|||
return { |
|||
nodeId: i.nodeId, |
|||
handlers: [ |
|||
{ |
|||
type: "USER", |
|||
id: i.operator, |
|||
name: i.operatorName |
|||
} |
|||
] |
|||
} |
|||
}), |
|||
taskId: this.taskId, |
|||
activityType: this.fdActivityType, |
|||
operationType: this.operationFlag, |
|||
}, |
|||
formParam: { |
|||
formInstanceId: this.businessId, |
|||
fdUrl: fdUrl |
|||
} |
|||
}) |
|||
if (res.success) { |
|||
this.$refs.passModal.handleCancel(); |
|||
this.$refs.passModal.remark = ''; |
|||
this.visible = false; |
|||
this.$refs.passModal.loading = false; |
|||
this.$emit('ok'); |
|||
} else { |
|||
this.$refs.passModal.loading = false; |
|||
this.$message.error(res.message); |
|||
} |
|||
} |
|||
// 审核 |
|||
else { |
|||
const res = await postAction(this.url.approve, { |
|||
fdId: this.flowId, |
|||
auditNote: obj.remark, |
|||
fdTemplateCode: this.fdTemplateCode, |
|||
bsId: this.businessId, |
|||
loginName: this.userInfo().username, |
|||
processParam: { |
|||
jumpToNodeId: obj.node, |
|||
refusePassedToThisNode: obj.refusePassedToThisNode, |
|||
refusePassedToAllApprover: obj.refusePassedToAllApprover, |
|||
toOtherPersons: this.operationFlag === 'handler_commission' ? obj.operator : '', |
|||
toOtherPersonsName: this.operationFlag === 'handler_commission' ? obj.operatorName : '', |
|||
changeNodeHandler: [], |
|||
taskId: this.taskId, |
|||
activityType: this.fdActivityType, |
|||
operationType: this.operationFlag, |
|||
} |
|||
}) |
|||
if (res.success) { |
|||
this.$refs.passModal.handleCancel(); |
|||
this.$refs.passModal.remark = ''; |
|||
this.visible = false; |
|||
this.$refs.passModal.loading = false; |
|||
this.$emit('ok'); |
|||
} else { |
|||
this.$message.error(res.message); |
|||
this.$refs.passModal.loading = false; |
|||
|
|||
} |
|||
} |
|||
|
|||
this.operator = ''; |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.approval-new-dialog { |
|||
.topArea { |
|||
.topArea_box { |
|||
.topArea_theme { |
|||
display: flex; |
|||
align-items: center; |
|||
margin-bottom: 20px; |
|||
|
|||
.topArea_theme_label { |
|||
margin-right: 20px; |
|||
} |
|||
} |
|||
|
|||
.buttonArea { |
|||
margin-bottom: 20px; |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,183 @@ |
|||
<template> |
|||
<w-card> |
|||
<div> |
|||
<!-- 查询区域 --> |
|||
<div class="table-page-search-wrapper" v-has="'ProductionOrderConfig:query'"> |
|||
<w-form layout="inline" @keyup.enter.native="searchQuery"> |
|||
<w-row :gutter="10"> |
|||
<w-col :xl="5" :lg="5" :md="8" :sm="24"> |
|||
<j-dict-select-tag |
|||
v-model="queryParam.type" |
|||
dict-code="MergerProduceConfigType" |
|||
placeholder="请选择类型" |
|||
/> |
|||
</w-col> |
|||
<w-col :xl="5" :lg="5" :md="8" :sm="24"> |
|||
<w-input v-model="queryParam.content" placeholder="请输入产品名称或研发分类" /> |
|||
</w-col> |
|||
|
|||
<w-col :xl="5" :lg="5" :md="8" :sm="24"> |
|||
<span class="table-page-search-submitButtons"> |
|||
<w-button type="primary" @click="searchQuery" icon="search">搜索</w-button> |
|||
<w-button type="primary" @click="searchReset">重置</w-button> |
|||
<j-super-query :fieldList="refColumns" ref="superQueryModal" @handleSuperQuery="handleSuperQuery" /> |
|||
</span> |
|||
</w-col> |
|||
|
|||
<div v-has="'ProductionOrderConfig:export'" class="leftArea"> |
|||
<div class="filterBox"> |
|||
<span class="iconfont icon-download-2" @click="exportExcel()"></span> |
|||
</div> |
|||
</div> |
|||
</w-row> |
|||
</w-form> |
|||
</div> |
|||
<!-- 查询区域-END --> |
|||
|
|||
<!-- 操作按钮区域 --> |
|||
<div class="table-operator"> |
|||
<w-button @click="handleAdd" type="primary" v-has="'ProductionOrderConfig:add'">新增</w-button> |
|||
<w-button @click="importModel" type="primary" v-has="'ProductionOrderConfig:import'"> 导入 </w-button> |
|||
</div> |
|||
<!-- table区域-begin --> |
|||
<div> |
|||
<w-fit-container elementType="grid" :fitSize="180"> |
|||
<a-table |
|||
:id="refColumnsKey" |
|||
ref="table" |
|||
size="middle" |
|||
:scroll="getTableScroll(1200)" |
|||
bordered |
|||
rowKey="id" |
|||
:columns="refColumns" |
|||
:dataSource="dataSource" |
|||
:pagination="ipagination" |
|||
:loading="loading" |
|||
:customHeaderRow="customHeaderRow" |
|||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
|||
class="j-table-force-nowrap" |
|||
@change="handleTableChange" |
|||
:components="resizableComponents" |
|||
:customRow="selectRow" |
|||
> |
|||
<span slot="action" slot-scope="text, record"> |
|||
<a @click="handleEdit(record)" v-has="'ProductionOrderConfig:edit'">编辑</a> |
|||
|
|||
<span v-has="'ProductionOrderConfig:del'"> |
|||
<w-divider type="vertical" /> |
|||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
|||
<a>删除</a> |
|||
</a-popconfirm> |
|||
</span> |
|||
</span> |
|||
</a-table> |
|||
</w-fit-container> |
|||
</div> |
|||
</div> |
|||
<w-table-columns-win @columnsChange="columnsChange" @resetColumns="resetColumns" ref="choose" :columns="columns" /> |
|||
<ProductionOrderConfigListModal ref="modalForm" @ok="modalFormOk" @close="modalFormClose" /> |
|||
<excel-export-model ref="excelExport" /> |
|||
<excel-import-model ref="importModel" /> |
|||
</w-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mixinDevice } from '@/utils/mixin'; |
|||
import { JeecgListMixin, WGridResizeByCssMixin } from '@/mixins/JeecgListMixin'; |
|||
import ProductionOrderConfigListModal from './modules/ProductionOrderConfigListModal'; |
|||
import ExcelExportModel from '@/views/excel/modules/ExcelExportModel'; |
|||
import ExcelImportModel from '@/views/excel/modules/ExcelImportModel.vue'; |
|||
import { getAction } from '@/api/manage'; |
|||
|
|||
export default { |
|||
// 生产单归类规则配置 |
|||
name: 'ProductionOrderConfigList', |
|||
mixins: [JeecgListMixin, mixinDevice, WGridResizeByCssMixin], |
|||
components: { |
|||
ProductionOrderConfigListModal, |
|||
ExcelExportModel, |
|||
ExcelImportModel, |
|||
}, |
|||
data() { |
|||
return { |
|||
// 表头 |
|||
columns: [ |
|||
{ |
|||
title: '#', |
|||
dataIndex: '', |
|||
key: 'rowIndex', |
|||
width: 60, |
|||
ellipsis: true, |
|||
align: 'center', |
|||
customRender: function (t, r, index) { |
|||
return parseInt(index) + 1; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '类型', |
|||
align: 'center', |
|||
width: 200, |
|||
ellipsis: true, |
|||
dataIndex: 'type_dictText', |
|||
}, |
|||
{ |
|||
title: '产品名称或研发分类', |
|||
align: 'center', |
|||
width: 200, |
|||
ellipsis: true, |
|||
dataIndex: 'content', |
|||
}, |
|||
|
|||
{ |
|||
title: '备注', |
|||
align: 'center', |
|||
width: 300, |
|||
ellipsis: true, |
|||
dataIndex: 'remark', |
|||
}, |
|||
|
|||
{ |
|||
title: '操作', |
|||
dataIndex: 'action', |
|||
align: 'center', |
|||
width: 147, |
|||
ellipsis: true, |
|||
fixed: 'right', |
|||
scopedSlots: { customRender: 'action' }, |
|||
}, |
|||
], |
|||
url: { |
|||
list: '/merger/merger-produce-config/v1/get-merger-produce-config-by-page', |
|||
del: '/merger/merger-produce-config/v1/del', |
|||
importEleExcelUrl: '/merger/merger-produce-config/v1/import-excel', |
|||
exportXlsUrl: '/merger/merger-produce-config/v1/export-xls', |
|||
}, |
|||
}; |
|||
}, |
|||
methods: { |
|||
/* 表头的导出 */ |
|||
exportExcel() { |
|||
const para = this.getQueryParams(); |
|||
para.ids = this.selectedRowKeys; |
|||
this.$refs.excelExport.show(this.url.exportXlsUrl, para, this.refColumns, 'MERGER_PRODUCE_CONFIG'); |
|||
}, |
|||
/* 导入 */ |
|||
importModel() { |
|||
this.$refs.importModel.show(this.url.importEleExcelUrl, 'MERGER_PRODUCE_CONFIG', {}); |
|||
}, |
|||
handleDelete: function (id) { |
|||
const that = this; |
|||
getAction(that.url.del, { id: id }).then((res) => { |
|||
if (res.success) { |
|||
//重新计算分页问题 |
|||
that.reCalculatePage(1); |
|||
that.$message.success(res.message); |
|||
that.loadData(); |
|||
} else { |
|||
that.$message.warning(res.message); |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
@ -0,0 +1,124 @@ |
|||
<template> |
|||
<a-spin :spinning="confirmLoading"> |
|||
<j-form-container :disabled="formDisabled"> |
|||
<w-form ref="form" :model="formData" :rules="validatorRules" slot="detail"> |
|||
<w-row> |
|||
<w-col :span="24"> |
|||
<w-form-item label="类型" prop="type"> |
|||
<j-dict-select-tag |
|||
v-model="formData.type" |
|||
dict-code="MergerProduceConfigType" |
|||
placeholder="请选择类型" |
|||
v-required-color="true" |
|||
/> |
|||
</w-form-item> |
|||
</w-col> |
|||
<w-col :span="24"> |
|||
<w-form-item label="产品名称或研发分类" prop="content"> |
|||
<w-input |
|||
v-model="formData.content" |
|||
placeholder="请输入产品名称或研发分类" |
|||
:maxLength="500" |
|||
v-required-color="true" |
|||
/> |
|||
</w-form-item> |
|||
</w-col> |
|||
|
|||
<w-col :span="24"> |
|||
<w-form-item label="备注" prop="remark"> |
|||
<w-input v-model="formData.remark" placeholder="请输入备注" :maxLength="100" /> |
|||
</w-form-item> |
|||
</w-col> |
|||
</w-row> |
|||
</w-form> |
|||
</j-form-container> |
|||
</a-spin> |
|||
</template> |
|||
|
|||
<script> |
|||
import { httpAction, getAction } from '@/api/manage'; |
|||
|
|||
export default { |
|||
name: 'ProductionOrderConfigListForm', |
|||
components: {}, |
|||
props: { |
|||
//表单禁用 |
|||
disabled: { |
|||
type: Boolean, |
|||
default: false, |
|||
required: false, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
formData: {}, |
|||
confirmLoading: false, |
|||
validatorRules: { |
|||
type: [{ required: true, message: '类型!' }], |
|||
content: [{ required: true, message: '产品名称或研发分类!' }], |
|||
}, |
|||
url: { |
|||
add: '/merger/merger-produce-config/v1/add', |
|||
update: '/merger/merger-produce-config/v1/update', |
|||
queryById: '/merger/merger-produce-config/v1/get-by-id', |
|||
}, |
|||
}; |
|||
}, |
|||
computed: { |
|||
formDisabled() { |
|||
return this.disabled; |
|||
}, |
|||
}, |
|||
created() { |
|||
//备份formData原始值 |
|||
this.modelDefault = JSON.parse(JSON.stringify(this.formData)); |
|||
}, |
|||
methods: { |
|||
add() { |
|||
this.edit(this.modelDefault); |
|||
}, |
|||
edit(record) { |
|||
this.getRecord(record.id); |
|||
}, |
|||
|
|||
submitForm() { |
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
this.confirmLoading = true; |
|||
const httpurl = this.formData.id ? this.url.update : this.url.add; |
|||
httpAction(httpurl, this.formData, 'post') |
|||
.then((res) => { |
|||
if (res.success) { |
|||
this.$message.success(res.message); |
|||
this.$emit('ok'); |
|||
} else { |
|||
this.$message.error(res.message); |
|||
} |
|||
}) |
|||
.finally(() => { |
|||
this.confirmLoading = false; |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
async getRecord(id) { |
|||
if (!id) { |
|||
return; |
|||
} |
|||
this.confirmLoading = true; |
|||
const res = await getAction(this.url.queryById, { id }); |
|||
if (res.success && res.result) { |
|||
this.$set(this, 'formData', res.result); |
|||
} else { |
|||
this.$message.error(res.message); |
|||
} |
|||
this.confirmLoading = false; |
|||
}, |
|||
compNoChange(obj) { |
|||
this.formData.compName = obj ? obj.name : ''; |
|||
this.formData.tenantId = obj ? obj.id : ''; |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
@ -0,0 +1,61 @@ |
|||
<template> |
|||
<j-modal |
|||
:title="title" |
|||
:width="width" |
|||
:visible="visible" |
|||
switchFullscreen |
|||
@ok="handleOk" |
|||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" |
|||
@cancel="handleCancel" |
|||
cancelText="关闭" |
|||
> |
|||
<ProductionOrderConfigListForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" @close="close" /> |
|||
</j-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
import ProductionOrderConfigListForm from './ProductionOrderConfigListForm'; |
|||
export default { |
|||
name: 'ProductionOrderConfigListModal', |
|||
components: { |
|||
ProductionOrderConfigListForm, |
|||
}, |
|||
data() { |
|||
return { |
|||
title: '', |
|||
width: 800, |
|||
visible: false, |
|||
disableSubmit: false, |
|||
}; |
|||
}, |
|||
methods: { |
|||
add() { |
|||
this.visible = true; |
|||
this.$nextTick(() => { |
|||
this.$refs.realForm.add(); |
|||
}); |
|||
}, |
|||
edit(record) { |
|||
this.visible = true; |
|||
this.$nextTick(() => { |
|||
this.$refs.realForm.edit(record); |
|||
}); |
|||
}, |
|||
close() { |
|||
this.$emit('close'); |
|||
this.visible = false; |
|||
}, |
|||
handleOk() { |
|||
this.$refs.realForm.submitForm(); |
|||
}, |
|||
submitCallback() { |
|||
this.$emit('ok'); |
|||
this.visible = false; |
|||
}, |
|||
handleCancel() { |
|||
this.close(); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
@ -0,0 +1,39 @@ |
|||
import { postAction } from '@/api/manage'; |
|||
import lodash from 'lodash'; |
|||
|
|||
export const submitClassify = (that, params) => { |
|||
return new Promise((resolve, reject) => { |
|||
that.$confirm({ |
|||
content: '是否确认提交归类?', |
|||
onOk: function () { |
|||
postAction('/merger/mergerReqsHead/submitMergeAndSplitOrder', { ...params, splitFlag: 0 }).then((res) => { |
|||
if (res.success) { |
|||
if (!lodash.isEmpty(res.result)) { |
|||
that.$confirm({ |
|||
content: '是否拆分需求单,并提交已维护完整的料号?', |
|||
onOk: function () { |
|||
postAction('/merger/mergerReqsHead/submitMergeAndSplitOrder', { ...params, splitFlag: 1 }).then((resData) => { |
|||
resolve(resData); |
|||
}) |
|||
}, |
|||
onCancel: function () { |
|||
reject(); |
|||
} |
|||
}); |
|||
} else { |
|||
resolve(res); |
|||
} |
|||
} else { |
|||
that.$message.warning(res.message); |
|||
reject(); |
|||
} |
|||
}).catch(() => { |
|||
reject(); |
|||
}) |
|||
}, |
|||
onCancel: function () { |
|||
reject(); |
|||
} |
|||
}); |
|||
}); |
|||
}; |
|||
@ -0,0 +1,37 @@ |
|||
export default { |
|||
columns: [ |
|||
{ |
|||
title: '序号', |
|||
dataIndex: '', |
|||
key: 'rowIndex', |
|||
width: 60, |
|||
align: 'center', |
|||
customRender: function (t, r, index) { |
|||
return parseInt(index) + 1; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '附件', |
|||
align: 'center', |
|||
dataIndex: 'attachment', |
|||
ellipsis: true, |
|||
width: 150, |
|||
scopedSlots: { customRender: 'attachment' }, |
|||
}, |
|||
{ |
|||
title: '要素名称', |
|||
align: 'center', |
|||
dataIndex: 'elemName', |
|||
ellipsis: true, |
|||
width: 100, |
|||
}, |
|||
{ |
|||
title: '要素值', |
|||
align: 'center', |
|||
dataIndex: 'elemValue', |
|||
ellipsis: true, |
|||
width: 100, |
|||
scopedSlots: { customRender: 'elemValue' }, |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,217 @@ |
|||
<template> |
|||
<div class="material-dev-classify-attr-comp"> |
|||
<div class="small-title"> |
|||
<div class="small-title_parent">研发分类要素</div> |
|||
<div class="small_label"> |
|||
<div class="small_label_title">研发分类:</div> |
|||
<div class="small_label_content" :title="rdCategory">{{ rdCategory }}</div> |
|||
</div> |
|||
</div> |
|||
<div class="dev-class-box"> |
|||
<a-table ref="table" |
|||
id="DevClassify_table_columns_key" |
|||
:scroll="{ x: '100%', y: 176 }" |
|||
:columns="refColumns" |
|||
:data-source="dataSource" |
|||
:pagination="false" |
|||
:loading="loading" |
|||
size="middle" |
|||
:row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)" |
|||
bordered |
|||
row-key="id" |
|||
:components="resizableComponents" |
|||
class="j-table-force-nowrap"> |
|||
<span slot="attachment" slot-scope="text, record"> |
|||
<div v-for="item in record.fileList" :key="item.fileId"> |
|||
<template v-if="item.suffix === 'pdf'"> |
|||
<a-tooltip placement="top"> |
|||
<template slot="title"> |
|||
<span>pdf下载</span> |
|||
</template> |
|||
<a-icon @click="downloadFile(item)" :style="downIconStyle" type="download" /> |
|||
</a-tooltip> |
|||
<a @click="pdfPreview(item)" :title="item.fileName">{{ item.fileName }}</a> |
|||
</template> |
|||
|
|||
<viewer :images="[currentImgUrl]" v-else-if="['img', 'jpeg', 'png', 'jpg', 'gif', 'tif', 'tiff', 'bmp'].indexOf(item.suffix.toLowerCase()) !== -1 |
|||
"> |
|||
<a-tooltip placement="top"> |
|||
<template slot="title"> |
|||
<span>图片下载</span> |
|||
</template> |
|||
<a-icon @click="downloadFile(item)" :style="downIconStyle" type="download" /> |
|||
</a-tooltip> |
|||
<img :src="currentImgUrl" :data-preview-title="item.fileName" style="display: none" :title="item.fileName" |
|||
:ref="`previewImg_${item.fileId}`" /> |
|||
<a @click="triggerPreview(item)" :title="item.fileName">{{ item.fileName }}</a> |
|||
</viewer> |
|||
<template v-else> |
|||
<a-tooltip placement="top"> |
|||
<template slot="title"> |
|||
<span>文件下载</span> |
|||
</template> |
|||
<a-icon @click="downloadFile(item)" :style="downIconStyle" type="file-excel" /> |
|||
</a-tooltip> |
|||
<span>{{ item.fileName }}</span> |
|||
</template> |
|||
</div> |
|||
</span> |
|||
<span slot="elemValue" slot-scope="text, record, index"> |
|||
<md-select :disabled="true" v-model="record.elemValue" v-if="record.elemType === '2'" style="width: 100%"> |
|||
<md-option v-for="(item, key) in record.elemContent.split('|')" :key="key" :value="item" :label="item" |
|||
style="padding-right: 8px" /> |
|||
</md-select> |
|||
<w-input v-else disabled v-model="record.elemValue" maxlength="1000" /> |
|||
</span> |
|||
</a-table> |
|||
</div> |
|||
<merger-file-print ref="mergerFilePrint" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { downloadFile, getImgUrlWithHeader } from '@/api/manage'; |
|||
import { postAction } from '@/api/manage'; |
|||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'; |
|||
import { mixinDevice } from '@/utils/mixin'; |
|||
import MergerFilePrint from '@/views/merger/mergeredConfig/productClassify/modules/MergerFilePrint'; |
|||
import config from './config'; |
|||
|
|||
export default { |
|||
name: 'DevClassify', |
|||
mixins: [JeecgListMixin, mixinDevice], |
|||
components: { MergerFilePrint }, |
|||
data() { |
|||
return { |
|||
rdCategory: '', |
|||
currentImgUrl: '', |
|||
// 表头 |
|||
columns: config.columns, |
|||
url: { |
|||
list: '/merger/mergerMaterialMaster/v1/get-reqs-elem', |
|||
downloadAttrById: '/sys/common/excel/file/download', |
|||
downloadFileById: '/merger/mergerGoodsFile/downloadFileById', |
|||
}, |
|||
superFieldList: [], |
|||
initeLoadData: false, // 跳过JeecgListMixin中created里的数据查询 |
|||
downIconStyle: 'margin-right: 5px; font-size: 18px; color: #1991a9;cursor:pointer', |
|||
}; |
|||
}, |
|||
methods: { |
|||
pdfPreview(item) { |
|||
this.$refs.mergerFilePrint.show(item.fileId); |
|||
}, |
|||
downloadMergerFile(record) { |
|||
downloadFile(this.url.downloadFileById, record.fileName, { id: record.id }); |
|||
}, |
|||
async show(id) { |
|||
const res = await postAction( this.url.list, { |
|||
id, |
|||
}); |
|||
if (res && res.code === '0') { |
|||
this.rdCategory = res.data.rdCategory; |
|||
this.dataSource = res.data.elemList || []; |
|||
this.dataSource.forEach((element) => { |
|||
element.fileList = JSON.parse(element.fileInfos) || []; |
|||
element.fileList.forEach((file) => { |
|||
file.suffix = file.fileName.split('.')[file.fileName.split('.').length - 1] || ''; |
|||
}); |
|||
|
|||
element.imgList = element.fileList.filter((item) => |
|||
['img', 'jpeg', 'png', 'jpg', 'gif', 'tif', 'tiff', 'bmp'].includes(item.suffix.toLowerCase()) |
|||
); |
|||
element.noImgList = element.fileList.filter( |
|||
(item) => !['img', 'jpeg', 'png', 'jpg', 'gif', 'tif', 'tiff', 'bmp'].includes(item.suffix.toLowerCase()) |
|||
); |
|||
}); |
|||
} |
|||
|
|||
}, |
|||
/* 下载文件 */ |
|||
downloadFile(record) { |
|||
downloadFile(this.url.downloadAttrById, record.fileName, { fileId: record.fileId }); |
|||
}, |
|||
initDictConfig() { }, |
|||
async triggerPreview(file) { |
|||
// 先检测文件是否存在 |
|||
const isExists = await this.checkFileExists(file); |
|||
|
|||
if (!isExists) { |
|||
// 文件不存在,显示警告 |
|||
this.$message.warning('文件不存在或无法访问'); |
|||
return; |
|||
} |
|||
|
|||
// 文件存在,触发预览 |
|||
const imgRef = this.$refs[`previewImg_${file.fileId}`]?.[0]; |
|||
if (imgRef) { |
|||
imgRef.click(); |
|||
} |
|||
}, |
|||
|
|||
/* 检查文件是否存在 */ |
|||
async checkFileExists(file) { |
|||
this.currentImgUrl = await getImgUrlWithHeader(file.fileId); |
|||
return new Promise((resolve) => { |
|||
const img = new Image(); |
|||
img.src = this.currentImgUrl; |
|||
// 超时设置(3秒) |
|||
const timeoutTimer = setTimeout(() => { |
|||
resolve(false); |
|||
}, 3000); |
|||
|
|||
// 加载成功 |
|||
img.onload = () => { |
|||
clearTimeout(timeoutTimer); |
|||
resolve(true); |
|||
}; |
|||
|
|||
// 加载失败 |
|||
img.onerror = () => { |
|||
clearTimeout(timeoutTimer); |
|||
resolve(false); |
|||
}; |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.material-dev-classify-attr-comp { |
|||
.small-title { |
|||
font-size: 12px; |
|||
color: grey; |
|||
font-weight: 700; |
|||
height: 30px; |
|||
padding: 6px 16px; |
|||
display: flex; |
|||
width: 100%; |
|||
|
|||
.small-title_parent { |
|||
min-width: 80px; |
|||
} |
|||
|
|||
.small_label { |
|||
flex: 1; |
|||
margin-left: 10px; |
|||
display: flex; |
|||
color: #212b36; |
|||
width: 100%; |
|||
min-width: 0; |
|||
|
|||
.small_label_title { |
|||
width: 60px; |
|||
} |
|||
|
|||
.small_label_content { |
|||
flex: 1; |
|||
white-space: nowrap; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
min-width: 0; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,59 @@ |
|||
/** |
|||
* 流程记录弹窗表格配置 |
|||
*/ |
|||
|
|||
// 表格列配置
|
|||
export const flowListColumns = [ |
|||
{ |
|||
title: '#', |
|||
dataIndex: '', |
|||
key: 'rowIndex', |
|||
width: 60, |
|||
align: 'center', |
|||
customRender: function (t, r, index) { |
|||
return parseInt(index) + 1 |
|||
} |
|||
}, |
|||
{ |
|||
title: '流程活动', |
|||
align: 'center', |
|||
dataIndex: 'actionName', |
|||
ellipsis: true, |
|||
width: 100 |
|||
}, |
|||
{ |
|||
title: '执行人', |
|||
align: 'center', |
|||
dataIndex: 'createName', |
|||
ellipsis: true, |
|||
width: 100 |
|||
}, |
|||
{ |
|||
title: '待执行人', |
|||
align: 'center', |
|||
dataIndex: 'actorId', |
|||
ellipsis: true, |
|||
width: 100, |
|||
}, |
|||
{ |
|||
title: '执行时间', |
|||
align: 'center', |
|||
dataIndex: 'createTime', |
|||
ellipsis: true, |
|||
width: 100 |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
align: 'center', |
|||
dataIndex: 'taskName', |
|||
ellipsis: true, |
|||
width: 100 |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
align: 'center', |
|||
dataIndex: 'remark', |
|||
ellipsis: true, |
|||
width: 100 |
|||
} |
|||
] |
|||
@ -0,0 +1,108 @@ |
|||
<template> |
|||
<j-modal |
|||
:title="title" |
|||
:width="1000" |
|||
:visible="visible" |
|||
:mask-closable="false" |
|||
@cancel="handleCancel" |
|||
footer> |
|||
<a-card> |
|||
<div> |
|||
<a-table |
|||
ref="table" |
|||
:id="refColumnsKey" |
|||
:scroll="getTableScroll(1000)" |
|||
:columns="refColumns" |
|||
:data-source="dataSource" |
|||
:pagination="ipagination" |
|||
:custom-header-row="customHeaderRow" |
|||
size="middle" |
|||
:loading="loading" |
|||
bordered |
|||
@change="handleTableChange" |
|||
:components="resizableComponents" |
|||
row-key="codeTS" |
|||
:custom-row="selectRow" |
|||
:row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)" |
|||
class="j-table-force-nowrap" |
|||
/> |
|||
</div> |
|||
<w-table-columns-win |
|||
ref="choose" |
|||
@columnsChange="columnsChange" |
|||
@resetColumns="resetColumns" |
|||
:columns="columns" |
|||
/> |
|||
</a-card> |
|||
</j-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'; |
|||
import { postAction } from '@/api/manage'; |
|||
import { flowListColumns } from './flowListConfig'; |
|||
|
|||
export default { |
|||
name: 'FlowListModal', |
|||
mixins: [JeecgListMixin], |
|||
data() { |
|||
return { |
|||
title: '流程记录', |
|||
width: 1200, |
|||
visible: false, |
|||
loading: false, |
|||
initeLoadData: false, |
|||
data: [], |
|||
// 表头 |
|||
columns: flowListColumns, |
|||
url: { |
|||
list: '/merger/mergerReqsList/v1/query-flow-by-id', |
|||
}, |
|||
isorter: { |
|||
column: 'createTime', |
|||
order: 'desc' |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
show(params) { |
|||
this.visible = true; |
|||
this.queryParam.partNo = params.partNo; |
|||
this.queryParam.ctryCode = params.ctryCode; |
|||
this.loadData(); |
|||
}, |
|||
handleCancel() { |
|||
this.visible = false; |
|||
}, |
|||
loadData(arg) { |
|||
//加载数据 若传入参数1则加载第一页的内容 |
|||
if (arg === 1) { |
|||
this.ipagination.current = 1; |
|||
} |
|||
const params = this.getQueryParams(); //查询条件 |
|||
this.loading = true; |
|||
postAction(this.url.list, params) |
|||
.then((res) => { |
|||
if (res.success) { |
|||
this.dataSource = !res.result ? [] : res.result.records || res.result; |
|||
|
|||
if (res.result && res.result.total) { |
|||
this.ipagination.total = parseInt(res.result.total); |
|||
} else { |
|||
this.ipagination.total = 0; |
|||
} |
|||
} else { |
|||
this.$message.warning(res.message); |
|||
} |
|||
}) |
|||
.finally(() => { |
|||
this.afterLoadData(); |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,91 @@ |
|||
<template> |
|||
<j-modal |
|||
:title="title" |
|||
:width="width" |
|||
:visible="visible" |
|||
:ok-button-props="{ class: { 'jee-hidden': true } }" |
|||
@cancel="close" |
|||
switch-fullscreen |
|||
cancel-text="关闭" |
|||
> |
|||
<w-form ref="form" :model="model"> |
|||
<w-row> |
|||
<w-col :span="22"> |
|||
<w-form-item label="要素采集备注" prop="elementInitRemark"> |
|||
<a-textarea v-model="model.elementInitRemark" /> |
|||
</w-form-item> |
|||
</w-col> |
|||
</w-row> |
|||
</w-form> |
|||
<template slot="footer"> |
|||
<w-button @click="close"> 关闭 </w-button> |
|||
<w-button :loading="loading" @click="handleOk" type="primary"> 提交 </w-button> |
|||
</template> |
|||
</j-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
import { postAction } from '@/api/manage'; |
|||
|
|||
export default { |
|||
name: 'materialRemarkDialog', |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
title: '要素采集', |
|||
width: 800, |
|||
visible: false, |
|||
model: { |
|||
elementInitRemark: '', |
|||
}, |
|||
loading: false, |
|||
url: { |
|||
elementCollection: '/merger/mergerMaterialMaster/v1/element-collection-detail', |
|||
}, |
|||
modelData: {} |
|||
}; |
|||
}, |
|||
methods: { |
|||
show(modelData) { |
|||
this.visible = true; |
|||
this.modelData = modelData; |
|||
}, |
|||
handleOk() { |
|||
const that = this; |
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
const { id, tickMaterial, tickElement } = this.modelData; |
|||
that.loading = true; |
|||
postAction( |
|||
that.url.elementCollection, |
|||
{ |
|||
id, |
|||
tickMaterial, |
|||
tickElement, |
|||
elementInitRemark: this.model.elementInitRemark, |
|||
} |
|||
) |
|||
.then((res) => { |
|||
if (res && res.code === '0') { |
|||
that.$message.success('要素采集成功!'); |
|||
that.$emit('ok'); |
|||
that.close(); |
|||
} else { |
|||
that.$message.error(res.message || res.msg); |
|||
} |
|||
}) |
|||
.finally(() => { |
|||
that.loading = false; |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
close() { |
|||
this.visible = false; |
|||
this.loading = false; |
|||
this.modelData = ''; |
|||
this.$refs.form.resetFields(); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
@ -0,0 +1,42 @@ |
|||
export default { |
|||
searchFields: [ |
|||
{ |
|||
name: '附加编码', |
|||
value: 'additionalCode', |
|||
type: 'input', |
|||
isFixed: true, |
|||
span: 3 |
|||
}, |
|||
{ |
|||
name: '语言类别', |
|||
value: 'cultureCode', |
|||
type: 'select', |
|||
optionsKey: 'GLOBAL_TARIFF_LANGUAGE_TYPE', |
|||
isFixed: true, |
|||
span: 3 |
|||
} |
|||
], |
|||
columns:[ |
|||
{ |
|||
label: '附加编码', |
|||
prop: 'additionalCode', |
|||
'width': 130, |
|||
}, |
|||
{ |
|||
label: '附加编码类型', |
|||
prop: 'additionalCodeType', |
|||
'width': 130, |
|||
}, |
|||
{ |
|||
label: '附加编码说明', |
|||
prop: 'codeDescription', |
|||
'min-width': 160, |
|||
}, |
|||
{ |
|||
label: '语言类别', |
|||
prop: 'cultureCode', |
|||
'width': 130, |
|||
}, |
|||
] |
|||
|
|||
} |
|||
@ -0,0 +1,158 @@ |
|||
<template> |
|||
<md-dialog |
|||
:close-on-click-modal="false" |
|||
:title="title" |
|||
:fullscreen="false" |
|||
:visible.sync="dialogVisible" |
|||
append-to-body |
|||
width="800px" |
|||
> <div class="table-page-search-wrapper"> |
|||
<w-form @keyup.enter.native="searchQueryHandle" layout="inline"> |
|||
<w-row :gutter="10"> |
|||
<w-col :span="5" v-for="i in config.searchFields" :key="i.value"> |
|||
<w-input v-if="i.type === 'input'" v-model="queryParam[i.value]" :placeholder="i.placeholder || i.name" /> |
|||
<md-select v-if="i.type === 'select'" v-model="queryParam[i.value]" :placeholder="i.placeholder || i.name" filterable clearable> |
|||
<md-option |
|||
v-for="item in optionsData[i.optionsKey] || {}" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</md-option> |
|||
</md-select> |
|||
</w-col> |
|||
<w-col :span="8" style="justify-content:flex-end"> |
|||
<span style="float: right; overflow: hidden" class="table-page-search-submitButtons"> |
|||
<w-button @click="searchQueryHandle" type="primary" icon="search">查询</w-button> |
|||
<w-button @click="searchResetHandle" type="primary" style="margin-left: 8px">重置</w-button> |
|||
</span> |
|||
</w-col> |
|||
</w-row> |
|||
</w-form> |
|||
</div> |
|||
<md-table :data="tableData" border size="mini" style="width: 100%" @row-dblclick="rowDblclick"> |
|||
<md-table-column v-for="col in config.columns" :key="col.prop" :prop="col.prop" :label="col.label" v-bind="{ ...$attrs }"></md-table-column> |
|||
</md-table> |
|||
</md-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import { postAction, getAction } from '@/api/manage'; |
|||
import config from './additionCode'; |
|||
import lodash from 'lodash'; |
|||
export default { |
|||
data() { |
|||
return { |
|||
config, |
|||
queryParam:{}, |
|||
modelData:{}, |
|||
tableData:[], |
|||
tableDataBackup:[], |
|||
dialogVisible: false, |
|||
optionsData:{}, |
|||
title: '' |
|||
}; |
|||
}, |
|||
methods: { |
|||
searchQueryHandle(){ |
|||
const { additionalCode, cultureCode } = this.queryParam; |
|||
if (additionalCode && isNaN(additionalCode)) { |
|||
this.$MdMessage({ |
|||
message: '附加编码只能输入数字', |
|||
type: 'warning' |
|||
}); |
|||
return; |
|||
} |
|||
if (additionalCode && String(additionalCode).length > 6) { |
|||
this.$MdMessage({ |
|||
message: '附加编码不能超过6位', |
|||
type: 'warning' |
|||
}); |
|||
return; |
|||
} |
|||
if( additionalCode || cultureCode) { |
|||
const filterData = this.tableDataBackup.filter(item => { |
|||
// 处理 additionalCode |
|||
let additionalCodeMatch = true; |
|||
if (!lodash.isEmpty(additionalCode)) { |
|||
// 只有当筛选条件有值时才进行匹配 |
|||
additionalCodeMatch = item.additionalCode === additionalCode; |
|||
} |
|||
|
|||
// 处理 cultureCode |
|||
let cultureCodeMatch = true; |
|||
if (!lodash.isEmpty(cultureCode)) { |
|||
// 只有当筛选条件有值时才进行匹配 |
|||
cultureCodeMatch = item.cultureCode === cultureCode; |
|||
} |
|||
|
|||
return additionalCodeMatch && cultureCodeMatch; |
|||
}); |
|||
this.tableData = filterData; |
|||
} else { |
|||
this.tableData = this.tableDataBackup; |
|||
} |
|||
}, |
|||
searchResetHandle(){ |
|||
this.queryParam = {}; |
|||
this.tableData = this.tableDataBackup; |
|||
}, |
|||
show({data}){ |
|||
if(!data.hsCode){ |
|||
this.$message.warning('商品编码不能为空,请维护后重试'); |
|||
return; |
|||
} |
|||
this.queryParam = { |
|||
additionalCode: data.additionalCode || '', |
|||
cultureCode: 'eng' |
|||
} |
|||
this.dialogVisible = true; |
|||
this.title = data.hsCode + '-附加编码'; |
|||
this.modelData = data; |
|||
this.$nextTick(()=>{ |
|||
this.getDate(); |
|||
}) |
|||
}, |
|||
close(){ |
|||
this.dialogVisible = false; |
|||
this.tableData = []; |
|||
}, |
|||
rowDblclick(row){ |
|||
this.$emit('confirm', row) |
|||
this.close(); |
|||
}, |
|||
getDate() { |
|||
postAction(process.env.VUE_APP_API_BASE_DOMAIN + '/api-iems-cn/base/tariff/additional/code/v1/get-by-page', { |
|||
hscode: this.modelData.hsCode || '', |
|||
countryCode: this.modelData.country || '', |
|||
pageSize: 999 |
|||
}).then(res => { |
|||
if (res && +res.code === 0) { |
|||
this.tableDataBackup = lodash.cloneDeep(res.data.list); |
|||
this.searchQueryHandle(); |
|||
} |
|||
}); |
|||
}, |
|||
initDict() { |
|||
const keyList = ['GLOBAL_TARIFF_LANGUAGE_TYPE']; |
|||
getAction(process.env.VUE_APP_API_BASE_DOMAIN + '/api-it-dc/dictionaryDetail/translateWithTenant', |
|||
{ dictCodes: keyList.join(',') } |
|||
).then(res => { |
|||
if (res && +res.code === 0 && res.data && res.data.GLOBAL_TARIFF_LANGUAGE_TYPE) { |
|||
const data = res.data.GLOBAL_TARIFF_LANGUAGE_TYPE; |
|||
const list = []; |
|||
Object.keys(data).forEach(key => { |
|||
list.push({ |
|||
label: data[key], |
|||
value: key |
|||
}) |
|||
}); |
|||
this.optionsData.GLOBAL_TARIFF_LANGUAGE_TYPE = list; |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.initDict() |
|||
}, |
|||
}; |
|||
</script> |
|||
@ -0,0 +1,66 @@ |
|||
<template> |
|||
<j-modal class="batch-audit-pass-dialog" :title="title" :width="500" :visible="visible" @cancel="handleCancel"> |
|||
<div> |
|||
<div class="passLabel"> |
|||
处理意见 |
|||
</div> |
|||
<w-input v-model="remark" type="textarea" :rows="3" /> |
|||
</div> |
|||
<template slot="footer"> |
|||
<w-button @click="handleCancel">取消</w-button> |
|||
<w-button type="primary" @click="handleOk">确定</w-button> |
|||
</template> |
|||
</j-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: "batchAuditPassDialog", |
|||
data() { |
|||
return { |
|||
type: '', |
|||
visible: false, |
|||
title: '', |
|||
remark: '同意' |
|||
} |
|||
}, |
|||
methods: { |
|||
show(obj) { |
|||
this.type = obj.type; |
|||
this.title = obj.title || ''; |
|||
this.remark = '同意'; |
|||
this.visible = true; |
|||
}, |
|||
handleCancel() { |
|||
this.remark = ''; |
|||
this.type = ''; |
|||
this.visible = false; |
|||
}, |
|||
handleOk() { |
|||
this.visible = false; |
|||
this.$emit('ok', { |
|||
remark: this.remark, |
|||
type: this.type |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.batch-audit-pass-dialog { |
|||
.ant-modal-content { |
|||
.ant-modal-header { |
|||
border: none; |
|||
} |
|||
.ant-modal-body { |
|||
min-height: 80px; |
|||
padding: 10px 20px; |
|||
} |
|||
.ant-modal-footer { |
|||
border: none; |
|||
padding: 10px 20px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,78 @@ |
|||
<template> |
|||
<j-modal class="batch-audit-user-dialog" :title="title" :width="500" :visible="visible" @cancel="handleCancel"> |
|||
<div> |
|||
<div>处理人</div> |
|||
|
|||
<AppprovalUserSelect |
|||
v-model="operator" |
|||
@change="getOperator" |
|||
/> |
|||
</div> |
|||
<template slot="footer"> |
|||
<w-button @click="handleCancel">取消</w-button> |
|||
<w-button type="primary" @click="handleOk">确定</w-button> |
|||
</template> |
|||
</j-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
import AppprovalUserSelect from '@/components/AppprovalUserSelect/index' |
|||
export default { |
|||
name: "batchAuditUserDialog", |
|||
components: { |
|||
AppprovalUserSelect |
|||
}, |
|||
data() { |
|||
return { |
|||
visible: false, |
|||
title: '选择审批人', |
|||
operator: '', |
|||
operatorName:'', |
|||
} |
|||
}, |
|||
methods: { |
|||
show() { |
|||
this.visible = true; |
|||
}, |
|||
getOperator(data){ |
|||
if (data && data.length > 0) { |
|||
this.operatorName = data[0].userName; |
|||
} else { |
|||
this.operatorName = ''; |
|||
} |
|||
}, |
|||
handleCancel() { |
|||
this.visible = false; |
|||
}, |
|||
handleOk() { |
|||
if (!this.operator) { |
|||
this.$message.error('处理人必选'); |
|||
return false; |
|||
} |
|||
this.visible = false; |
|||
this.$emit('ok', { |
|||
operator: this.operator, |
|||
operatorName: this.operatorName |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.batch-audit-user-dialog { |
|||
.ant-modal-content { |
|||
.ant-modal-header { |
|||
border: none; |
|||
} |
|||
.ant-modal-body { |
|||
min-height: 80px; |
|||
padding: 10px 20px; |
|||
} |
|||
.ant-modal-footer { |
|||
border: none; |
|||
padding: 10px 20px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue