| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { componentSubmit } from "./apis"; |
| | | import { materialSubmit } from "./apis"; |
| | | import const_work_level from "@/assets/js/const/const_work_level"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | let data = { ...this.formData, ...values }; |
| | | data.capprovingList = this.list; |
| | | data.mapprovingList = this.list; |
| | | data.nextUser = getItemByKey(data.nextUserName, this.userList).id; |
| | | componentSubmit(data) |
| | | materialSubmit(data) |
| | | .then((res) => { |
| | | let rs = res.data; |
| | | if (rs.code == 1 && rs.data) { |
| | |
| | | export const zipParse = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "componentApproving/zipParse", |
| | | url: "materialApproving/zipParse", |
| | | headers: { |
| | | "Content-Type": "multipart/form-data" |
| | | }, |
| | | data |
| | | }) |
| | | } |
| | | /** |
| | | * 物料审批提交 |
| | | * @returns |
| | | */ |
| | | export const materialSubmit = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "worksheetMain/materialSubmit", |
| | | data |
| | | }) |
| | | } |
| | |
| | | :columns="columns" |
| | | :data-source="dataSource" |
| | | :pagination="false" |
| | | rowKey="subName" |
| | | rowKey="subCode" |
| | | :rowClassName=" |
| | | (record) => (1 == record.replaceStatus ? 'is-replace' : '') |
| | | " |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getBomAndMaterial, componentRelatedSubmit } from "./apis"; |
| | | import { getBomAndMaterial, materialRelatedSubmit } from "./apis"; |
| | | import { getAllMaterialNoLimit } from "../materialsCenter/apis"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | |
| | | }); |
| | | }, |
| | | checkList(obj) { |
| | | const { components } = obj; |
| | | const { components, subCode } = obj; |
| | | getAllMaterialNoLimit().then((res) => { |
| | | res = res.data; |
| | | const { code, data, data2 } = res; |
| | |
| | | let list = []; |
| | | this.spinning = false; |
| | | if (code && data) { |
| | | list = data2.map((v) => { |
| | | list = data2.filter((v) => v.subCode != subCode).map((v) => { |
| | | return { |
| | | ...v, |
| | | title: v.subModel, |
| | |
| | | submit() { |
| | | // 分析相应的修改 提交 添加关联 删除关联 替换操作分开 |
| | | let links_add = [], |
| | | links_del = [], |
| | | replaces = []; |
| | | links_del = []; |
| | | this.dataSource.forEach((v) => { |
| | | this.getComponentsChange(v, links_add, links_del, replaces); |
| | | this.getComponentsChange(v, links_add, links_del); |
| | | }); |
| | | console.log(links_add, links_del, replaces, "0-0-0-0="); |
| | | if (!links_add.length && !links_del.length && !replaces.length) { |
| | | console.log(links_add, links_del, "0-0-0-0="); |
| | | if (!links_add.length && !links_del.length) { |
| | | this.$message.warn("没有任何修改, 不会提交审核"); |
| | | return false; |
| | | } |
| | |
| | | this.createCase({ |
| | | addedList: links_add, |
| | | removedList: links_del, |
| | | replacedList: replaces, |
| | | main: { |
| | | nextUser: this.info.nextUser, |
| | | title: `对${this.parentData.parentModel}的修改`, |
| | |
| | | }); |
| | | }, |
| | | createCase(obj) { |
| | | componentRelatedSubmit(obj).then((res) => { |
| | | materialRelatedSubmit(obj).then((res) => { |
| | | res = res.data; |
| | | let { code, data, data2, msg } = res; |
| | | if (code && data) { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getComponentsChange(obj, arrAdd, arrDel, replace) { |
| | | getComponentsChange(obj, arrAdd, arrDel) { |
| | | const { |
| | | components, |
| | | componentsBak, |
| | | parentModel, |
| | | subName1, |
| | | replaceId, |
| | | replaceStatus, |
| | | id, |
| | | oldSubName, |
| | | quantity |
| | | parentCode, |
| | | customCode, |
| | | subCode, |
| | | version, |
| | | } = obj; |
| | | if (replaceId) { |
| | | replace.push({ |
| | | componentId: replaceId, |
| | | parentModel, |
| | | subName: oldSubName, |
| | | quantity |
| | | }); |
| | | } |
| | | // 取新增的 |
| | | let add = components |
| | | .filter( |
| | | (v) => |
| | | !(replaceId == v.id || componentsBak.some((val) => val.id == v.id)) |
| | | ) |
| | | .filter((v) => !componentsBak.some((val) => val.id == v.id)) |
| | | .map((v) => ({ |
| | | componentId: v.id, |
| | | parentModel, |
| | | subName: subName1, |
| | | quantity |
| | | materialId: v.id, |
| | | parentCode, |
| | | customCode, |
| | | subCode, |
| | | version, |
| | | })); |
| | | // 删除的 |
| | | let del = componentsBak |
| | | .filter((v) => !components.some((val) => val.id == v.id)) |
| | | .map((v) => ({ |
| | | componentId: v.id, |
| | | parentModel, |
| | | subName: subName1, |
| | | quantity |
| | | materialId: v.id, |
| | | parentCode, |
| | | customCode, |
| | | subCode, |
| | | version, |
| | | })); |
| | | arrAdd.push(...add); |
| | | if (replaceId && replaceStatus) { |
| | | arrAdd.push({ |
| | | componentId: id, |
| | | parentModel, |
| | | subName: oldSubName, |
| | | quantity |
| | | }); |
| | | } |
| | | arrDel.push(...del); |
| | | }, |
| | | }, |
| | |
| | | centered |
| | | :footer="false" |
| | | :width="1300"> |
| | | <draw-upload :list="subList" text="审核结果" no-footer></draw-upload> |
| | | <draw-upload v-if="type == 1" :list="subList" text="审核结果" no-footer></draw-upload> |
| | | <replace-info v-if="type == 2" :list="subList" text="审核结果" no-footer></replace-info> |
| | | <material-info v-if="type == 3" :list="subList" text="审核结果" no-footer></material-info> |
| | | </a-modal> |
| | | </div> |
| | | </page-toggle-transition> |
| | |
| | | import {approvedListPage, linkInfo} from "@/pages/workplace/apis"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from '../replaceInfo'; |
| | | import MaterialInfo from '../materialInfo'; |
| | | |
| | | export default { |
| | | name: "NotApproved", |
| | |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | DrawUpload, |
| | | ReplaceInfo, |
| | | MaterialInfo |
| | | }, |
| | | props: { |
| | | isShow: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 0, |
| | | loading: false, |
| | | workDetailVisible: false, |
| | | page: 1, |
| | |
| | | let loading = this.$layer.loading(); |
| | | linkInfo(id).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | let rsData = rs.data; |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rsData.approvingBomList; |
| | | let { |
| | | data: { |
| | | productApproving, |
| | | mapprovingList, |
| | | mpApprovingList |
| | | }, |
| | | code, |
| | | } = res.data; |
| | | let list = []; |
| | | if(code) { |
| | | if (productApproving) { |
| | | this.type = 1; |
| | | list = productApproving.bomApprovingList; |
| | | } |
| | | if (mpApprovingList) { |
| | | this.type = 2; |
| | | list = mpApprovingList; |
| | | } |
| | | if (mapprovingList) { |
| | | this.type = 3; |
| | | list = mapprovingList; |
| | | } |
| | | } |
| | | this.subList = data; |
| | | this.subList = list; |
| | | this.workDetailVisible = true; |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | |
| | | centered |
| | | :footer="false" |
| | | :width="1300"> |
| | | <draw-upload :list="subList" text="审核结果" no-footer></draw-upload> |
| | | <draw-upload v-if="type == 1" :list="subList" text="审核结果" no-footer></draw-upload> |
| | | <replace-info v-if="type == 2" :list="subList" text="审核结果" no-footer></replace-info> |
| | | <material-info v-if="type == 3" :list="subList" text="审核结果" no-footer></material-info> |
| | | </a-modal> |
| | | </div> |
| | | </page-toggle-transition> |
| | |
| | | import AuditForm from "@/pages/workplace/workForm/auditForm"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from '../replaceInfo'; |
| | | import MaterialInfo from '../materialInfo'; |
| | | |
| | | export default { |
| | | name: "HandledList", |
| | |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | AuditForm, |
| | | ReplaceInfo, |
| | | MaterialInfo |
| | | }, |
| | | props: { |
| | | isShow: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 0, |
| | | loading: false, |
| | | workDetailVisible: false, |
| | | auditFormVisible: false, |
| | |
| | | let loading = this.$layer.loading(); |
| | | linkInfo(id).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | let rsData = rs.data; |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rsData.approvingBomList; |
| | | let { |
| | | data: { |
| | | productApproving, |
| | | mapprovingList, |
| | | mpApprovingList, |
| | | links |
| | | }, |
| | | code, |
| | | } = res.data; |
| | | let list = []; |
| | | if(code) { |
| | | if (productApproving) { |
| | | this.type = 1; |
| | | list = productApproving.bomApprovingList; |
| | | } |
| | | if (mpApprovingList) { |
| | | this.type = 2; |
| | | list = mpApprovingList; |
| | | } |
| | | if (mapprovingList) { |
| | | this.type = 3; |
| | | list = mapprovingList; |
| | | } |
| | | } |
| | | this.subList = data; |
| | | this.subList = list; |
| | | this.workDetailVisible = true; |
| | | |
| | | // 设置审核表单 |
| | | this.formData.id = rsData.links[rsData.links.length-1].id; |
| | | this.formData.mainId = rsData.id; |
| | | this.formData.id = links[links.length-1].id; |
| | | this.formData.mainId = id; |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | | this.$layer.close(loading); |
| | |
| | | centered |
| | | :footer="false" |
| | | :width="1300"> |
| | | <draw-upload v-if="isReload" :list="subList"> |
| | | <draw-upload v-if="isReload && type == 1" :list="subList"> |
| | | <template slot="footer"> |
| | | <a-button type="primary" style="margin-right: 8px" @click="showVisibleModal(1)">审核通过</a-button> |
| | | <a-button type="danger" @click="showVisibleModal(0)">驳回</a-button> |
| | | </template> |
| | | </draw-upload> |
| | | <replace-info v-if="isReload && type == 2" :list="subList"> |
| | | <template slot="footer"> |
| | | <a-button type="primary" style="margin-right: 8px" @click="showVisibleModal(1)">审核通过</a-button> |
| | | <a-button type="danger" @click="showVisibleModal(0)">驳回</a-button> |
| | | </template> |
| | | </replace-info> |
| | | <material-info v-if="isReload && type == 3" :list="subList"> |
| | | <template slot="footer"> |
| | | <a-button type="primary" style="margin-right: 8px" @click="showVisibleModal(1)">审核通过</a-button> |
| | | <a-button type="danger" @click="showVisibleModal(0)">驳回</a-button> |
| | | </template> |
| | | </material-info> |
| | | </a-modal> |
| | | <a-modal |
| | | v-model="auditFormVisible" |
| | |
| | | import ApproveForm from "@/pages/workplace/workForm/approveForm"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from '../replaceInfo'; |
| | | import MaterialInfo from '../materialInfo'; |
| | | |
| | | export default { |
| | | name: "HandlingList", |
| | |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | AuditForm, |
| | | ReplaceInfo, |
| | | MaterialInfo |
| | | }, |
| | | props: { |
| | | isShow: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 0, |
| | | loading: false, |
| | | workDetailVisible: false, |
| | | auditFormVisible: false, |
| | |
| | | let loading = this.$layer.loading(); |
| | | linkInfo(id).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | let rsData = rs.data; |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rsData.approvingBomList; |
| | | let { |
| | | data: { |
| | | productApproving, |
| | | links, |
| | | mpApprovingList, |
| | | mapprovingList |
| | | }, |
| | | code, |
| | | } = res.data; |
| | | let list = []; |
| | | if(code) { |
| | | if (productApproving) { |
| | | this.type = 1; |
| | | list = productApproving.bomApprovingList; |
| | | } |
| | | if (mpApprovingList) { |
| | | this.type = 2; |
| | | list = mpApprovingList; |
| | | } |
| | | if (mapprovingList) { |
| | | this.type = 3; |
| | | list = mapprovingList; |
| | | } |
| | | } |
| | | this.subList = data; |
| | | this.subList = list; |
| | | this.workDetailVisible = true; |
| | | |
| | | // 设置审核表单 |
| | | this.formData.id = rsData.links[rsData.links.length-1].id; |
| | | this.formData.parentId = rsData.links[rsData.links.length-1].parentId, |
| | | this.formData.id = links[links.length-1].id; |
| | | this.formData.parentId = links[links.length-1].parentId, |
| | | this.formData.mainId = id; |
| | | }).catch(error=>{ |
| | | console.log(error); |
New file |
| | |
| | | <template> |
| | | <div class="draw-upload"> |
| | | <a-spin :spinning="spinning" tip="拼命加载中..."> |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" |
| | | :scroll="{ y }" |
| | | bordered |
| | | :columns="columns" |
| | | :data-source="dataSource" |
| | | :pagination="false" |
| | | rowKey="subCode" |
| | | > |
| | | </a-table> |
| | | <div class="modal-footer" v-if="!noFooter"> |
| | | <slot name="footer"> |
| | | <a-button type="primary" @click="handleClick">{{ text }}</a-button> |
| | | </slot> |
| | | </div> |
| | | </a-spin> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "", |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | }, |
| | | }, |
| | | text: { |
| | | type: String, |
| | | default: "提交审核", |
| | | }, |
| | | noFooter: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | y: { |
| | | type: Number, |
| | | default: 500 |
| | | } |
| | | }, |
| | | data() { |
| | | const columns = [ |
| | | { |
| | | title: "料号", |
| | | dataIndex: "subCode", |
| | | width: 120, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "名称", |
| | | dataIndex: "subName", |
| | | align: "center", |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: "型号", |
| | | dataIndex: "subModel", |
| | | align: "center", |
| | | } |
| | | ]; |
| | | return { |
| | | columns: columns, |
| | | // y: 500, |
| | | spinning: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleClick() { |
| | | this.$emit("success", this.list); |
| | | }, |
| | | }, |
| | | computed: { |
| | | dataSource() { |
| | | return this.list.map((item) => { |
| | | return item; |
| | | }); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .content-label, |
| | | .content-value { |
| | | font-weight: bold; |
| | | } |
| | | .modal-footer { |
| | | padding: 8px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | |
| | | centered |
| | | :footer="false" |
| | | :width="1300"> |
| | | <draw-upload :list="subListDetail" no-footer></draw-upload> |
| | | <draw-upload v-if="type == 1" :list="subListDetail" no-footer></draw-upload> |
| | | <replace-info v-if="type == 2" :list="subListDetail" no-footer></replace-info> |
| | | <material-info v-if="type == 3" :list="subListDetail" no-footer></material-info> |
| | | </a-modal> |
| | | </div> |
| | | </page-toggle-transition> |
| | |
| | | import const_job_status from "@/assets/js/const/const_job_status"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from '../replaceInfo'; |
| | | import MaterialInfo from '../materialInfo'; |
| | | |
| | | export default { |
| | | name: "MyDraw", |
| | |
| | | AStepItem, |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | ReplaceInfo, |
| | | MaterialInfo |
| | | }, |
| | | watch: { |
| | | isShow(n) { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 0, |
| | | loading: false, |
| | | drawUploadVisible: false, |
| | | submitFormVisible: false, |
| | |
| | | let loading = this.$layer.loading(); |
| | | linkInfo(id).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | let rsData = rs.data; |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rsData.approvingBomList; |
| | | let { |
| | | data: { |
| | | productApproving, |
| | | mpApprovingList, |
| | | mapprovingList |
| | | }, |
| | | code, |
| | | } = res.data; |
| | | let list = []; |
| | | if(code) { |
| | | if (productApproving) { |
| | | this.type = 1; |
| | | list = productApproving.bomApprovingList; |
| | | } |
| | | if (mpApprovingList) { |
| | | this.type = 2; |
| | | list = mpApprovingList; |
| | | } |
| | | if (mapprovingList) { |
| | | this.type = 3; |
| | | list = mapprovingList; |
| | | } |
| | | } |
| | | this.subListDetail = data; |
| | | this.subListDetail = list; |
| | | this.workDetailVisible = true; |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | |
| | | centered |
| | | :footer="false" |
| | | :width="1300"> |
| | | <draw-upload :list="subList" text="审核结果" no-footer></draw-upload> |
| | | <draw-upload v-if="type == 1" :list="subList" text="审核结果" no-footer></draw-upload> |
| | | <replace-info v-if="type == 2" :list="subList" text="审核结果" no-footer></replace-info> |
| | | <material-info v-if="type == 3" :list="subList" text="审核结果" no-footer></material-info> |
| | | </a-modal> |
| | | </div> |
| | | </page-toggle-transition> |
| | |
| | | import {approvingListPage, linkInfo} from "@/pages/workplace/apis"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from '../replaceInfo'; |
| | | import MaterialInfo from '../materialInfo'; |
| | | |
| | | export default { |
| | | name: "NotApproved", |
| | |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | DrawUpload, |
| | | ReplaceInfo, |
| | | MaterialInfo |
| | | }, |
| | | props: { |
| | | isShow: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 0, |
| | | loading: false, |
| | | workDetailVisible: false, |
| | | page: 1, |
| | |
| | | let loading = this.$layer.loading(); |
| | | linkInfo(id).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | let rsData = rs.data; |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rsData.approvingBomList; |
| | | let { |
| | | data: { |
| | | productApproving, |
| | | mapprovingList, |
| | | mpApprovingList |
| | | }, |
| | | code, |
| | | } = res.data; |
| | | let list = []; |
| | | if(code) { |
| | | if (productApproving) { |
| | | this.type = 1; |
| | | list = productApproving.bomApprovingList; |
| | | } |
| | | if (mpApprovingList) { |
| | | this.type = 2; |
| | | list = mpApprovingList; |
| | | } |
| | | if (mapprovingList) { |
| | | this.type = 3; |
| | | list = mapprovingList; |
| | | } |
| | | } |
| | | this.subList = data; |
| | | this.subList = list; |
| | | this.workDetailVisible = true; |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | |
| | | centered |
| | | :footer="false" |
| | | :width="1300"> |
| | | <draw-upload :list="subList" no-footer></draw-upload> |
| | | <draw-upload v-if="type == 1" :list="subList" no-footer></draw-upload> |
| | | <replace-info v-if="type == 2" :list="subList" no-footer></replace-info> |
| | | <material-info v-if="type == 3" :list="subList" no-footer></material-info> |
| | | </a-modal> |
| | | </div> |
| | | </page-toggle-transition> |
| | |
| | | import AuditForm from "@/pages/workplace/workForm/auditForm"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from '../replaceInfo'; |
| | | import MaterialInfo from '../materialInfo'; |
| | | |
| | | export default { |
| | | name: "RejectedList", |
| | |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | AuditForm, |
| | | ReplaceInfo, |
| | | MaterialInfo |
| | | }, |
| | | props: { |
| | | isShow: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | type: 0, |
| | | loading: false, |
| | | workDetailVisible: false, |
| | | auditFormVisible: false, |
| | |
| | | let loading = this.$layer.loading(); |
| | | linkInfo(id).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | let rsData = rs.data; |
| | | let data = []; |
| | | if(rs.code == 1) { |
| | | data = rsData.approvingBomList; |
| | | let { |
| | | data: { |
| | | productApproving, |
| | | mapprovingList, |
| | | mpApprovingList, |
| | | links |
| | | }, |
| | | code, |
| | | } = res.data; |
| | | let list = []; |
| | | if(code) { |
| | | if (productApproving) { |
| | | this.type = 1; |
| | | list = productApproving.bomApprovingList; |
| | | } |
| | | if (mpApprovingList) { |
| | | this.type = 2; |
| | | list = mpApprovingList; |
| | | } |
| | | if (mapprovingList) { |
| | | this.type = 3; |
| | | list = mapprovingList; |
| | | } |
| | | } |
| | | this.subList = data; |
| | | this.subList = list; |
| | | this.workDetailVisible = true; |
| | | |
| | | // 设置审核表单 |
| | | this.formData.id = rsData.links[rsData.links.length-1].id; |
| | | this.formData.mainId = rsData.id; |
| | | this.formData.id = links[links.length-1].id; |
| | | this.formData.mainId = id; |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | | this.$layer.close(loading); |
New file |
| | |
| | | <template> |
| | | <div class="draw-upload"> |
| | | <a-spin :spinning="spinning" tip="拼命加载中..."> |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" |
| | | :scroll="{ y }" |
| | | bordered |
| | | :columns="columns" |
| | | :data-source="dataSource" |
| | | :pagination="false" |
| | | rowKey="subCode" |
| | | > |
| | | </a-table> |
| | | <div class="modal-footer" v-if="!noFooter"> |
| | | <slot name="footer"> |
| | | <a-button type="primary" @click="handleClick">{{ text }}</a-button> |
| | | </slot> |
| | | </div> |
| | | </a-spin> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "", |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | }, |
| | | }, |
| | | text: { |
| | | type: String, |
| | | default: "提交审核", |
| | | }, |
| | | noFooter: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | y: { |
| | | type: Number, |
| | | default: 500 |
| | | } |
| | | }, |
| | | data() { |
| | | const columns = [ |
| | | { |
| | | title: "子件编码", |
| | | dataIndex: "subCode", |
| | | width: 120, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "母料编号", |
| | | dataIndex: "parentCode", |
| | | align: "center", |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: "定制单号", |
| | | dataIndex: "customCode", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "版本", |
| | | dataIndex: "version", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "替换料物料号", |
| | | dataIndex: "material.subCode", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "替换料物料名称", |
| | | dataIndex: "material.subName", |
| | | align: "center", |
| | | ellipsis: true, |
| | | } |
| | | ]; |
| | | return { |
| | | columns: columns, |
| | | // y: 500, |
| | | spinning: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleClick() { |
| | | this.$emit("success", this.list); |
| | | }, |
| | | }, |
| | | computed: { |
| | | dataSource() { |
| | | return this.list.map((item) => { |
| | | return item; |
| | | }); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .content-label, |
| | | .content-value { |
| | | font-weight: bold; |
| | | } |
| | | .modal-footer { |
| | | padding: 8px; |
| | | text-align: right; |
| | | } |
| | | </style> |