| | |
| | | title: "查看详细信息",
|
| | | setForm: {},
|
| | | },
|
| | | batchApplyCodeTableData: {},
|
| | | batchSelectTableData: {},
|
| | | savedList: [],
|
| | | tab1Loading: false,
|
| | | tab2Loading: false,
|
| | |
| | | if (first === true) {
|
| | | this.codeRuleOid = data.codeRuleOid;
|
| | | // 第一次打开直接赋值不校验
|
| | | this.batchApplyCodeTableData[data.codeRuleOid] = {
|
| | | this.batchSelectTableData[data.codeRuleOid] = {
|
| | | name: data.name,
|
| | | templateOid: data.oid,
|
| | | cloNamesList: data.cloNamesList,
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | if (!this.batchApplyCodeTableData[data.codeRuleOid]) {
|
| | | this.batchApplyCodeTableData[data.codeRuleOid] = {
|
| | | if (!this.batchSelectTableData[data.codeRuleOid]) {
|
| | | this.batchSelectTableData[data.codeRuleOid] = {
|
| | | name: data.name,
|
| | | templateOid: data.oid,
|
| | | cloNamesList: data.cloNamesList,
|
| | |
| | | codeRuleOid: data.codeRuleOid,
|
| | | };
|
| | | }
|
| | | }
|
| | | if (this.type === 'historyImport') {
|
| | | if (first === true) {
|
| | | // 第一次打开直接赋值不校验
|
| | | this.batchSelectTableData[data.codeClassifyOid] = {
|
| | | name: data.name,
|
| | | templateOid: data.oid,
|
| | | cloNamesList: data.cloNamesList,
|
| | | codeClassifyOid: data.codeClassifyOid,
|
| | | codeRuleOid: data.codeRuleOid,
|
| | | };
|
| | | // 不是第一次打开需要优先校验
|
| | | }else if (this.localCodeClassifyOid === data.codeClassifyOid) {
|
| | | console.log("重复点击");
|
| | | }
|
| | | if (!this.batchSelectTableData[data.codeClassifyOid]) {
|
| | | this.batchSelectTableData[data.codeClassifyOid] = {
|
| | | name: data.name,
|
| | | templateOid: data.oid,
|
| | | cloNamesList: data.cloNamesList,
|
| | | codeClassifyOid: data.codeClassifyOid,
|
| | | tab1Selected: []
|
| | | };
|
| | | }
|
| | | this.selection = this.batchSelectTableData[this.localCodeClassifyOid]['tab1Selected']
|
| | | }
|
| | | this.localCodeClassifyOid = data.codeClassifyOid;
|
| | | this.cloNamesList = data.cloNamesList;
|
| | |
| | | (item) => !this.savedList.includes(item.oid)
|
| | | );
|
| | | if (this.type === "batchApplyCode") {
|
| | | this.batchApplyCodeTableData[data.codeRuleOid]["tab1"] =
|
| | | this.batchSelectTableData[data.codeRuleOid]["tab1"] =
|
| | | this.tab1Table;
|
| | | }
|
| | | if (this.type === "historyImport") {
|
| | | this.batchSelectTableData[data.codeClassifyOid]["tab1"] =
|
| | | this.tab1Table;
|
| | | }
|
| | | });
|
| | |
| | | this.tab2Loading = false
|
| | | this.tab2Table = res.data.data;
|
| | | if (this.tab2Table.length > 0 && this.type === "batchApplyCode") {
|
| | | this.batchApplyCodeTableData[data.codeRuleOid]["codeApply"] = {};
|
| | | this.batchApplyCodeTableData[data.codeRuleOid]["tab2"] =
|
| | | res.data.data;
|
| | | this.batchSelectTableData[data.codeRuleOid]["codeApply"] = {};
|
| | | this.batchSelectTableData[data.codeRuleOid]["tab2"] =
|
| | | this.tab2Table
|
| | | if (this.$refs.CodeApply) {
|
| | | this.$refs.CodeApply.loading = true;
|
| | | }
|
| | | this.getCodeRule();
|
| | | }
|
| | | if (this.type === "historyImport") {
|
| | | this.batchSelectTableData[data.codeClassifyOid]["tab2"] =
|
| | | this.tab2Table
|
| | | }
|
| | | });
|
| | | getFormTemplate({
|
| | |
| | | },
|
| | | tab1TableSelectChange(selection) {
|
| | | this.selectedTab1Table = selection;
|
| | | if (this.batchSelectTableData[this.localCodeClassifyOid]) {
|
| | | this.batchSelectTableData[this.localCodeClassifyOid]['tab1Selected'] = selection
|
| | | }
|
| | | },
|
| | | resembleRowChange(row) {
|
| | | if (!row || !row.oid) {
|
| | |
| | | return false;
|
| | | }
|
| | | }
|
| | | let lookedCodeRuleOidList = Object.keys(this.batchApplyCodeTableData);
|
| | | let lookedCodeRuleOidList = Object.keys(this.batchSelectTableData);
|
| | | let noLookCodeRuleOidList = this.leftTree.filter(
|
| | | (item) => !lookedCodeRuleOidList.includes(item.codeRuleOid)
|
| | | );
|
| | |
| | | }
|
| | | let errorData = [];
|
| | | let successData = [];
|
| | | for (const key in this.batchApplyCodeTableData) {
|
| | | if (Object.hasOwnProperty.call(this.batchApplyCodeTableData, key)) {
|
| | | const element = this.batchApplyCodeTableData[key];
|
| | | for (const key in this.batchSelectTableData) {
|
| | | if (Object.hasOwnProperty.call(this.batchSelectTableData, key)) {
|
| | | const element = this.batchSelectTableData[key];
|
| | | if (element.tab1.length > 0) {
|
| | | errorData.push(element);
|
| | | }
|
| | |
| | | },
|
| | | };
|
| | | });
|
| | | } else if (this.type === 'historyImport') {
|
| | | let lookedCodeRuleOidList = Object.keys(this.batchSelectTableData);
|
| | | let noLookCodeRuleOidList = this.leftTree.filter(
|
| | | (item) => !lookedCodeRuleOidList.includes(item.codeClassifyOid)
|
| | | );
|
| | | let noLookName = noLookCodeRuleOidList.map((item) => item.name);
|
| | | if (noLookName.length > 0) {
|
| | | this.$message.warning(`数据${noLookName}还未曾查看,请先查看!`);
|
| | | return false;
|
| | | }
|
| | | params.codeImprotSaveDatVOList = this.batchSelectTableData.map(item => {
|
| | | return {
|
| | | Clos: item.cloNamesList,
|
| | | dataList: item.tab2.concat(item.tab1Selected),
|
| | | orderDTO: {
|
| | | codeClassifyOid: item.codeClassifyOid,
|
| | | templateOid: item.templateOid,
|
| | | secDTOList: this.secDTOList,
|
| | | },
|
| | | }
|
| | | })
|
| | | } else {
|
| | | params.codeImprotSaveDatVOList = [
|
| | | {
|
| | |
| | | this.submitLoading = true
|
| | | submitHistoryimport(params).then((res) => {
|
| | | this.submitLoading = false
|
| | | console.log(res);
|
| | | if (res.data.code === 200) {
|
| | | this.$message.success(res.data.msg);
|
| | | }
|
| | |
| | | },
|
| | | // 重新编辑
|
| | | reEdit(row) {
|
| | | console.log(row, "row");
|
| | | this.currentSelectedResembleRow = {
|
| | | templateOid: row.codetemplateoid,
|
| | | codeClassifyOid: row.codeclassifyid,
|
| | |
| | | // 直接编辑后保存
|
| | | FormTemplateSubmit(form) {
|
| | | addSaveCode(form).then((res) => {
|
| | | console.log(res);
|
| | | if (res.data.code === 200) {
|
| | | this.savedList.push(form.oid);
|
| | | this.$message.success("新增成功!");
|