Browse Source

0106代码备份

release/midea_0106
luwenlong 3 weeks ago
parent
commit
186c5f2131
  1. 499
      src/components/ApprovalProgressTemplate/indexNew.vue
  2. 32
      src/views/merger/mergerapply/MaterialMaster.vue
  3. 10
      src/views/merger/mergerapply/modules/MaterialMasterModalForm.vue
  4. 69
      src/views/merger/mergeredConfig/productClassify/index.vue
  5. 260
      src/views/merger/mergeredConfig/productClassify/modules/MergerGoodsForm.vue
  6. 56
      src/views/merger/mergeredConfig/productClassify/modules/ModifyRecordList.vue
  7. 2
      src/views/merger/mergeredConfig/productClassify/modules/ModifyRecordModal.vue

499
src/components/ApprovalProgressTemplate/indexNew.vue

@ -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>

32
src/views/merger/mergerapply/MaterialMaster.vue

@ -70,6 +70,8 @@
<w-button @click="handleConfirm" v-has="'MaterialMaster:confirm'" type="primary"> 确认 </w-button>
<w-button @click="handleElemImport" v-has="'MaterialMaster:elemImport'" type="primary"> 申报要素导入 </w-button>
<w-button @click="handleElemExport" v-has="'MaterialMaster:elemExport'" type="primary"> 申报要素导出 </w-button>
<w-button @click="handleMaterialImport" v-has="'MaterialMaster:import'" type="primary"> 企业物料导入 </w-button>
<w-button @click="handleMaterialDel" :loading="loading" v-has="'MaterialMaster:del'" type="primary"> 删除 </w-button>
<!-- <w-button @click="batchDel" type="danger" v-has="'MaterialMaster:del'">删除</w-button> -->
</div>
@ -478,6 +480,8 @@ export default {
//
elemExportXlsUrl: '/merger/mergerMaterialMaster/elementExportXls',
elemImportExcelUrl: '/merger/mergerMaterialMaster/elementImportExcel',
materialImportExcelUrl: '/merger/mergerMaterialMaster/v1/importExcel',
materialDelUrl: '/merger/mergerMaterialMaster/v1/batchDelete',
},
// popover
popoverContent: {},
@ -669,6 +673,34 @@ export default {
// headId: this.head.id
});
},
handleMaterialImport() {
this.$refs.importModel.show(this.url.materialImportExcelUrl, 'MATERIAL_MASTER_IMPORT', {});
},
handleMaterialDel() {
if (this.selectedRowKeys.length === 0) {
this.$message.warning('请至少选择一条数据进行操作!');
return;
}
const that = this;
this.$confirm({
content: '确认删除选中的数据吗?',
onOk: function () {
that.loading = true;
postAction(that.url.materialDelUrl, that.selectedRowKeys)
.then((res) => {
if (res.success) {
that.$message.success(res.message ? res.message : '删除成功!');
that.loadData();
} else {
that.$message.warning(res.message);
}
})
.finally(() => {
that.loading = false;
});
}
});
},
/* 申报要素导出 */
handleElemExport() {
this.hiddenColumns = true;

10
src/views/merger/mergerapply/modules/MaterialMasterModalForm.vue

@ -170,12 +170,12 @@
</w-form-item>
</w-col>
<w-col :span="12" class="wrap-box">
<md-checkbox v-show="!isFromMip" v-if="model.unit1" class="check-box" v-model="checkFlagObj.unit1ConversionFactorCheckFlag"></md-checkbox>
<md-checkbox v-show="!isFromMip" v-if="model.unit1 && model.unit1 !== '035'" class="check-box" v-model="checkFlagObj.unit1ConversionFactorCheckFlag"></md-checkbox>
<w-form-item label="法一转换因子" prop="unit1ConversionFactor">
<w-input
v-model="model.unit1ConversionFactor"
maxlength="10"
:disabled="materialDisabled(loginUserRqualNeedPeopleDisabled(),checkFlagObj.unit1ConversionFactorCheckFlag)"
:disabled="materialDisabled( model.unit1 === '035' || loginUserRqualNeedPeopleDisabled(),checkFlagObj.unit1ConversionFactorCheckFlag)"
@input="handleInputNumber('unit1ConversionFactor', $event)"
/>
</w-form-item>
@ -193,12 +193,12 @@
</w-form-item>
</w-col>
<w-col :span="12" class="wrap-box">
<md-checkbox v-show="!isFromMip" v-if="model.unit2" class="check-box" v-model="checkFlagObj.unit2ConversionFactorCheckFlag"></md-checkbox>
<md-checkbox v-show="!isFromMip" v-if="model.unit2 && model.unit2 !== '035'" class="check-box" v-model="checkFlagObj.unit2ConversionFactorCheckFlag"></md-checkbox>
<w-form-item label="法二转换因子" prop="unit2ConversionFactor" :rules="unit2ConversionFactorRules()">
<w-input
maxlength="10"
v-model="model.unit2ConversionFactor"
:disabled="materialDisabled(!model.unit2 || loginUserRqualNeedPeopleDisabled(), checkFlagObj.unit2ConversionFactorCheckFlag)"
:disabled="materialDisabled(!model.unit2 || model.unit2 === '035' || loginUserRqualNeedPeopleDisabled(), checkFlagObj.unit2ConversionFactorCheckFlag)"
@input="handleInputNumber('unit2ConversionFactor', $event)"
@blur="handleBlur('unit2ConversionFactor', $event)"
/>
@ -864,7 +864,7 @@ export default {
this.model.codeTs = value;
},
unit2ConversionFactorRules() {
if (this.model.unit2) {
if (this.model.unit2 && this.model.unit2 !== '035') {
return [
{ required: true, message: '请输入法二转换因子!' },
{ pattern: /^[\d]{0,7}([.][0-9]{0,2})?$/g, message: '整数不能超过7位,小数不能超过2位', trigger: 'blur' }

69
src/views/merger/mergeredConfig/productClassify/index.vue

@ -111,6 +111,14 @@
>
驳回
</w-button>
<w-button
v-if="flag === 'queryClassify'"
@click="transferHandle"
type="primary"
v-has="'queryClassify:transfer'"
>
转派
</w-button>
<w-button
v-if="flag === 'queryClassify'"
v-has="'queryClassify:resetClassify'"
@ -130,6 +138,14 @@
>
变更HSCode(全球)
</w-button>
<w-button
v-if="flag === 'queryClassify'"
@click="importModelHandle"
type="primary"
v-has="'queryClassify:import'"
>
导入修改HSCODE
</w-button>
<w-button
v-if="flag === 'productClassify'"
@click="importModel"
@ -203,6 +219,7 @@
>
<a v-else @click="handleEdit(row)">{{ text }}</a>
</div>
<a v-else-if="flag === 'reviewClassify'" @click="handleEdit(row)">{{ text }}</a>
<a v-else @click="handleDetail(row)">{{ text }}</a>
</span>
<span slot="classifyStatus" slot-scope="text, records">
@ -374,6 +391,7 @@
</w-form>
</j-modal>
<ApprovalProgressTemplate ref="ApprovalProgressTemplate" @ok="handleOk" />
<ApprovalProgressTemplateNew ref="ApprovalProgressTemplateNew" @ok="handleOk" />
<FlowListModal ref="FlowListModal" @ok="handleOk" />
<batch-audit-pass-dialog ref="batchAuditPassDialogRef" @ok="passHandleOk" />
<batch-audit-user-dialog ref="batchAuditUserDialogRef" @ok="userHandleOk" />
@ -382,6 +400,7 @@
<script>
import ApprovalProgressTemplate from '@/components/ApprovalProgressTemplate/index';
import ApprovalProgressTemplateNew from '@/components/ApprovalProgressTemplate/indexNew';
import { JeecgListMixin, WGridResizeByCssMixin } from '@/mixins/JeecgListMixin';
import { mixinDevice } from '@/utils/mixin';
import ExcelExportModel from '@/views/excel/modules/ExcelExportModel.vue';
@ -409,11 +428,13 @@ export default {
ExcelExportPage,
ExcelImportPage,
ApprovalProgressTemplate,
ApprovalProgressTemplateNew,
FlowListModal,
AppprovalUserSelect,
},
data() {
return {
fdTemplateCode: '',
flag: 'productClassify',
authObj: {
query: 'productClassify:query',
@ -704,6 +725,7 @@ export default {
},
],
url: {
getFdTemplateCodeApi: '/merger/mergerGoods/v1/check-merger-goods-by-id', // Code
list: '/merger/mergerGoods/list',
delete: '/merger/mergerGoods/delete',
deleteBatch: '/merger/mergerGoods/deleteBatch',
@ -815,7 +837,7 @@ export default {
this.handleDetail(this.record);
}
} else if (this.flag === 'reviewClassify') {
this.handleDetail(this.record);
this.handleEdit(this.record);
}
}
},
@ -860,7 +882,17 @@ export default {
return ' ';
}
},
showApprovalDialog(type,data) {
// data.fdTemplateCode = type;
if(type === 'mergerApply'){
this.$refs.ApprovalProgressTemplate.show(data);
} else {
this.$refs.ApprovalProgressTemplateNew.show(data);
}
},
async submitFlow(record) {
//
this.fdTemplateCode = 'mergerApply';
if (record.globalLock === 'N') {
const resp = await getAction(this.url.preAuditVerification, {
id: record.id,
@ -872,27 +904,41 @@ export default {
countryCode: record.country,
hscode: record.hsCode,
});
// ID
const fdTemplateData = await getAction(this.url.getFdTemplateCodeApi, { id: record.id });
if (fdTemplateData && String(fdTemplateData.code) === '50002') {
this.$message.error(fdTemplateData.message);
return false;
} else if (fdTemplateData && String(fdTemplateData.code) === '50001') {
this.fdTemplateCode = 'mergerApplyFactory';
} else {
this.fdTemplateCode = 'mergerApply';
}
if (valid.success) {
this.$refs.ApprovalProgressTemplate.show({
const data = {
fdTemplateCode: this.fdTemplateCode || 'mergerApply',
id: record.id,
defaultverifyBy: record.verifyBy,
flowId: record.flowId,
type: 'submit',
title: `${record.countryName}${record.partNo} 商品归类`,
});
};
this.showApprovalDialog(this.fdTemplateCode , data);
} else {
if (valid.code === 5010) {
const that = this;
this.$confirm({
content: valid.message + ',是否继续提交?',
onOk: function () {
that.$refs.ApprovalProgressTemplate.show({
const data = {
fdTemplateCode: this.fdTemplateCode || 'mergerApply',
id: record.id,
defaultverifyBy: record.verifyBy,
flowId: record.flowId,
type: 'submit',
title: `${record.countryName}${record.partNo} 商品归类`,
});
}
that.showApprovalDialog(that.fdTemplateCode , data);
},
});
} else {
@ -943,6 +989,16 @@ export default {
type: 'audit',
});
},
transferHandle() {
if (this.selectedRowKeys.length === 0) {
this.$warning({ title: '提示', content: '请至少选择一条数据!' });
return;
}
this.flowStatusCode = '';
this.currentBy = '';
this.currentByName = '';
this.changeExamineVisible = true;
},
//
changeExamineStatus(code) {
if (this.selectedRowKeys.length === 0) {
@ -1174,6 +1230,9 @@ export default {
const para = {};
this.$refs.importModel.show(this.url.importExcelUrl, 'MERGER_GOODS', para);
},
importModelHandle() {
this.$refs.importModel.show(this.url.importExcelUrl, 'MERGER_GOODS_HS_CODE_IMPORT', {});
},
returnOK() {
this.$refs.returnForm.validate(async (valid) => {
if (valid) {

260
src/views/merger/mergeredConfig/productClassify/modules/MergerGoodsForm.vue

@ -7,8 +7,9 @@
:disabled="formDisabled"
type="primary"
@click="submitForm"
>保存</w-button
>
>
保存
</w-button>
<w-button
v-if="flag === 'queryClassify'"
@click="submitForm"
@ -412,14 +413,10 @@
<w-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="附加编码" prop="additionalCode">
<div style="display: flex; align-items: center; width: 100%">
<w-input v-model="model.additionalCode" readonly placeholder="请选择附加编码" />
<div
@click="showAdditionCodeHandle"
class="plus-box"
>
<div @click="showAdditionCodeHandle" class="plus-box">
<a-icon type="plus" style="color: #ffffff" />
</div>
</div>
</w-form-item>
</w-col>
</w-row>
@ -443,7 +440,7 @@
v-model="activeKeyBottom"
type="card"
style="width: 100%"
class="ant-modal-tab tabFixed merger-tab"
class="ant-modal-tab merger-tab"
>
<w-tab-pane key="declarationElements" v-if="model.country === 'CN'" :force-render="true" tab="申报要素">
<a-table
@ -574,7 +571,8 @@
</w-form>
</j-modal>
<ApprovalProgressTemplate ref="ApprovalProgressTemplate" @ok="$emit('close')" />
<addition-code-dialog ref="additionCodeDialogRef" @confirm="confirmAdditionCode"></addition-code-dialog>
<ApprovalProgressTemplateNew ref="ApprovalProgressTemplateNew" @ok="$emit('close')" />
<addition-code-dialog ref="additionCodeDialogRef" @confirm="confirmAdditionCode" />
</a-spin>
</template>
@ -592,6 +590,7 @@ import CNattachmentCode from './CNattachmentCode';
import CNregulatoryConditions from './CNregulatoryConditions';
import CNtaxrateDesc from './CNtaxrateDesc';
import ApprovalProgressTemplate from '@/components/ApprovalProgressTemplate/index';
import ApprovalProgressTemplateNew from '@/components/ApprovalProgressTemplate/indexNew';
import additionCodeDialog from './additionCodeDialog';
export default {
@ -605,6 +604,7 @@ export default {
copGNoInfo,
CNhSCodeModal,
ApprovalProgressTemplate,
ApprovalProgressTemplateNew,
CNtaxrateInfo,
CNtaxrateInfoCN,
CNregulatoryConditions,
@ -626,6 +626,7 @@ export default {
},
data() {
return {
fdTemplateCode: '',
// activeKeyTop: 'devClassify',
activeKeyBottom: 'declarationElements',
elemList: [],
@ -657,6 +658,7 @@ export default {
hscodDetail: '/interfaces/hscode/detail',
preAuditVerification: '/merger/mergerGoods/preAuditVerification',
regulationValid: '/interfaces/hscode/desc/regulationExpand',
getFdTemplateCodeApi: '/merger/mergerGoods/v1/check-merger-goods-by-id', // Code
},
//
elementColumns: [
@ -754,117 +756,159 @@ export default {
// yyyy-MM-dd
return `${year}-${month}-${day}`;
},
getSubmitFlowUrl() {
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
return {
httpurl,
method,
};
},
async submitFlow() {
if (this.model.globalLock === 'N') {
// HSCode
if (this.model.country === 'GC') {
if (this.model.hsCode.length !== 6) {
this.$message.error('国家为全球时,HSCode必须是6位');
return; // return
}
} else if (!['GC', 'CN'].includes(this.model.country)) {
if (this.model.hsCode && this.model.hsCode.length < 6) {
this.$message.error('国家为海外时,HSCode必须大于等于6位');
return; // return
}
this.fdTemplateCode = 'mergerApply';
if (this.model.globalLock === 'Y') {
return this.$message.error('全球锁为Y的数据不允许提交');
}
// HSCode
if (this.model.country === 'GC') {
if (this.model.hsCode.length !== 6) {
return this.$message.error('国家为全球时,HSCode必须是6位');
}
const that = this;
//
this.$refs.form.validate(async (valid) => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
const goodsElementList = this.elementDataSource;
goodsElementList.forEach((item) => {
item.goodsId = this.model.id;
item.codeTs = this.model.hsCode;
});
const elemList = [];
this.$refs.devClassify.dataSource.forEach((item) => {
elemList.push({
id: item.id,
elemValue: item.elemValue,
});
} else if (!['GC', 'CN'].includes(this.model.country)) {
if (this.model.hsCode && this.model.hsCode.length < 6) {
return this.$message.error('国家为海外时,HSCode必须大于等于6位');
}
}
const that = this;
//
this.$refs.form.validate(async (valid) => {
if (valid) {
that.confirmLoading = true;
const { httpurl, method } = this.getSubmitFlowUrl();
const goodsElementList = this.elementDataSource;
goodsElementList.forEach((item) => {
item.goodsId = this.model.id;
item.codeTs = this.model.hsCode;
});
const elemList = [];
this.$refs.devClassify.dataSource.forEach((item) => {
elemList.push({
id: item.id,
elemValue: item.elemValue,
});
try {
//
const res = await httpAction(
httpurl,
{ ...this.model, goodsElementList, elemList, isForceSave: this.isForceSave, saveType: 2 },
method
);
});
try {
//
const res = await httpAction(
httpurl,
{ ...this.model, goodsElementList, elemList, isForceSave: this.isForceSave, saveType: 2 },
method
);
if (res.success) {
// that.$message.success(res.message);
if (this.activeKeyBottom === 'modifyRecord') {
this.getLogList();
}
that.isForceSave = false;
//
const resp = await getAction(this.url.preAuditVerification, {
id: this.model.id,
});
if (resp.success) {
if (this.model.country === 'ID' || this.model.country === 'TH') {
this.SubmitValid();
} else {
this.$refs.ApprovalProgressTemplate.show({
id: this.model.id,
flowId: this.model.flowId,
defaultverifyBy: this.model.verifyBy,
type: 'submit',
title: `${this.model.countryName}${this.model.partNo} 商品归类`,
});
}
if (res.success) {
// that.$message.success(res.message);
if (this.activeKeyBottom === 'modifyRecord') {
this.getLogList();
}
that.isForceSave = false;
//
const resp = await getAction(this.url.preAuditVerification, {
id: this.model.id,
});
if (resp.success) {
if (this.model.country === 'ID' || this.model.country === 'TH') {
this.SubmitValid();
} else {
this.$message.error(resp.message);
this.$refs.ApprovalProgressTemplate.show({
fdTemplateCode: 'mergerApply',
id: this.model.id,
flowId: this.model.flowId,
defaultverifyBy: this.model.verifyBy,
type: 'submit',
title: `${this.model.countryName}${this.model.partNo} 商品归类`,
});
}
} else {
if (!res.result) {
this.$message.error(resp.message);
}
} else {
if (!res.result) {
that.confirmLoading = false;
that.$message.warning(res.message);
} else {
if (!res.result.isForceSave) {
that.confirmLoading = false;
that.$message.warning(res.message);
} else {
if (!res.result.isForceSave) {
that.confirmLoading = false;
that.twiceSubmitFlow(res);
}
that.twiceSubmitFlow(res);
}
}
} catch (error) {
that.$message.error('操作失败,请重试');
} finally {
that.confirmLoading = false;
}
} catch (error) {
that.$message.error('操作失败,请重试');
} finally {
that.confirmLoading = false;
}
});
}
});
},
//
showApprovalDialog(type,data) {
// data.fdTemplateCode = type;
if(type === 'mergerApply'){
this.$refs.ApprovalProgressTemplate.show(data);
} else {
this.$message.error('全球锁为Y的数据不允许提交');
this.$refs.ApprovalProgressTemplateNew.show(data);
}
},
//
validFactoryMode(id) {
return new Promise((resolve, reject) => {
getAction(this.url.getFdTemplateCodeApi, { id }).then(res => {
if (res && String(res.code) === '50002') {
this.$message.error(res.message);
resolve(false);
} else if (res && String(res.code) === '50001') {
resolve('mergerApplyFactory');
} else {
resolve('mergerApply');
}
}).catch((error) => {
reject(error);
});
});
},
async auditFlow() {
this.fdTemplateCode = 'mergerApply';
if (this.model.country === 'ID' || this.model.country === 'TH') {
const data = {
countryCode: this.model.country,
hscode: this.model.hsCode
hscode: this.model.hsCode,
};
if ( this.model.country === 'TH' ) {
if (this.model.country === 'TH') {
data.additionalCode = this.model.additionalCode;
}
if( this.model.country === 'ID'){
const res = await this.validFactoryMode(this.model.id);
if(res === false){
return false;
}
this.fdTemplateCode = res;
}
const valid = await getAction(this.url.regulationValid, data);
if (valid.success) {
this.$refs.ApprovalProgressTemplate.show({
const data = {
fdTemplateCode: this.fdTemplateCode || 'mergerApply',
id: this.model.id,
flowId: this.model.flowId,
type: 'audit',
});
};
this.showApprovalDialog(this.fdTemplateCode,data);
} else {
if (valid.code === 5010) {
this.$message.error(valid.message + ',请先维护数据!');
@ -874,6 +918,7 @@ export default {
}
} else {
this.$refs.ApprovalProgressTemplate.show({
fdTemplateCode: 'mergerApply',
id: this.model.id,
flowId: this.model.flowId,
type: 'audit',
@ -933,13 +978,13 @@ export default {
if (record) {
this.model.hsCode = record.codeTS || record.hscode;
if (this.model.country === 'TH') {
this.initAdditionalCode();
this.initAdditionalCode();
}
this.queryByIdHscode('enter');
}
this.CNhSCodeModalShow = false;
},
initAdditionalCode(){
initAdditionalCode() {
this.model.additionalCode = '';
this.regulatoryConditionsDataSource = [];
if (this.activeKeyBottom === 'regulatoryConditions') {
@ -1134,7 +1179,7 @@ export default {
const resp = await getAction(this.url.hscodDetail, {
hscode: this.model.hsCode,
countryCode: this.model.country,
additionalCode: this.model.country === 'TH' ? this.model.additionalCode : undefined
additionalCode: this.model.country === 'TH' ? this.model.additionalCode : undefined,
});
if (resp.success) {
const result = JSON.parse(resp.result);
@ -1410,33 +1455,44 @@ export default {
async SubmitValid() {
const data = {
countryCode: this.model.country,
hscode: this.model.hsCode
hscode: this.model.hsCode,
};
if ( this.model.country === 'TH' ) {
if (this.model.country === 'TH') {
data.additionalCode = this.model.additionalCode;
}
const valid = await getAction(this.url.regulationValid, data);
if( this.model.country === 'ID'){
const res = await this.validFactoryMode(this.model.id);
if(res === false){
return false;
}
this.fdTemplateCode = res;
}
if (valid.success) {
this.$refs.ApprovalProgressTemplate.show({
const data = {
fdTemplateCode: this.fdTemplateCode || 'mergerApply',
id: this.model.id,
flowId: this.model.flowId,
defaultverifyBy: this.model.verifyBy,
type: 'submit',
title: `${this.model.countryName}${this.model.partNo} 商品归类`,
});
};
this.showApprovalDialog(this.fdTemplateCode,data);
} else {
if (valid.code === 5010) {
const that = this;
this.$confirm({
content: valid.message + ',是否继续提交?',
onOk: function () {
that.$refs.ApprovalProgressTemplate.show({
const data = {
fdTemplateCode: that.fdTemplateCode || 'mergerApply',
id: that.model.id,
flowId: that.model.flowId,
defaultverifyBy: that.model.verifyBy,
type: 'submit',
title: `${that.model.countryName}${that.model.partNo} 商品归类`,
});
};
that.showApprovalDialog(that.fdTemplateCode,data);
},
});
} else {

56
src/views/merger/mergeredConfig/productClassify/modules/ModifyRecordList.vue

@ -20,7 +20,38 @@
:components="resizableComponents"
:custom-row="selectRow"
class="j-table-force-nowrap"
/>
>
<span slot="beforeData" slot-scope="text, row">
<div v-if="row.isFile">
<div v-if="row.before && row.before.length">
<WInputUploadFile
:fileValueList.sync="row.before"
:disabled="false"
:uploadBtnShow="false"
:DelBtnShow="false"
/>
</div>
</div>
<div v-else>
{{ text }}
</div>
</span>
<span slot="afterData" slot-scope="text, row">
<div v-if="row.isFile">
<div v-if="row.after && row.after.length">
<WInputUploadFile
:fileValueList.sync="row.after"
:disabled="false"
:uploadBtnShow="false"
:DelBtnShow="false"
/>
</div>
</div>
<div v-else>
{{ text }}
</div>
</span>
</a-table>
</div>
<w-table-columns-win
ref="choose"
@ -66,14 +97,16 @@ export default {
title: '变更前数据',
align: 'center',
dataIndex: 'before',
width: 150,
scopedSlots: { customRender: 'beforeData' },
width: 250,
ellipsis: true
},
{
title: '变更后数据',
align: 'center',
dataIndex: 'after',
width: 150,
scopedSlots: { customRender: 'afterData' },
width: 250,
ellipsis: true
}
],
@ -88,7 +121,22 @@ export default {
computed: {},
methods: {
show (record) {
this.dataSource = JSON.parse(record.diffList)
const that = this;
this.dataSource = JSON.parse(record.diffList);
this.dataSource.forEach(item => {
if (item.field.includes('(附件)')) {
item.isFile = true;
item.after = that.parseStr(item.after);
item.before = that.parseStr(item.before);
}
})
},
parseStr(fieldString) {
try {
return JSON.parse(fieldString);
} catch (error) {
return fieldString;
}
},
initDictConfig () { },
getSuperFieldList () {

2
src/views/merger/mergeredConfig/productClassify/modules/ModifyRecordModal.vue

@ -24,7 +24,7 @@ export default {
data () {
return {
title: '',
width: 800,
width: 1100,
visible: false,
disableSubmit: false
}

Loading…
Cancel
Save