| | |
| | | :prelang="prelang" |
| | | :options="options" |
| | | :ajaxFun="ajaxFun" |
| | | :toolbarMaxLength="4" |
| | | :paramArr="type" |
| | | ref="customerOrderTable" |
| | | > |
| | |
| | | <el-button type="primary" @click="startSync">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="已关联销售订单" |
| | | :visible.sync="showInterrelatedOrderDialog" |
| | | width="60%"> |
| | | <el-table border height="100" :data="interrelatedOrderData"> |
| | | <el-table-column type="index" align="center" label="序号"></el-table-column> |
| | | <el-table-column prop="contractNo" show-overflow-tooltip align="center" label="合同编号"></el-table-column> |
| | | <el-table-column prop="entityName" show-overflow-tooltip align="center" label="工程名称"></el-table-column> |
| | | <el-table-column prop="sourceId" show-overflow-tooltip align="center" label="添加来源"> |
| | | <template scope="scope"> |
| | | <el-tag v-if="scope.row.sourceId == 0" type="success">同步</el-tag> |
| | | <el-tag v-if="scope.row.sourceId == 1" type="info">手动</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="placeOrderDate" show-overflow-tooltip align="center" label="下单日期"></el-table-column> |
| | | <el-table-column prop="customerName" show-overflow-tooltip align="center" label="客户名称"></el-table-column> |
| | | <el-table-column prop="coState" min-width="100" show-overflow-tooltip align="center" label="销售订单状态"></el-table-column> |
| | | <el-table-column prop="partNo" show-overflow-tooltip align="center" label="产品编号"></el-table-column> |
| | | <el-table-column prop="productName" show-overflow-tooltip align="center" label="产品名称"></el-table-column> |
| | | <el-table-column prop="productType" show-overflow-tooltip align="center" label="隶属品牌"></el-table-column> |
| | | <el-table-column prop="otcUnit" show-overflow-tooltip align="center" label="单位"></el-table-column> |
| | | <el-table-column prop="buyQtyDue" show-overflow-tooltip align="center" label="数量"></el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {interrelatedOrder,getInterrelatedOrder,checkHanderOrder} from '@/api/plan/customerOrderInterrelated' |
| | | import ConfirmPullCustomerorder from './confirm-pull-customerorder' |
| | | import TableForm from './customerorder-form' |
| | | import TableFormDEesc from './customerorder-form-desc' |
| | |
| | | exportCustomerOrderSplit, |
| | | syncOrder, |
| | | dropByContractNo, |
| | | downloadProduct, |
| | | downloadWordFile |
| | | } from '../../../api/plan/customerorder' |
| | | import DocumentTable from '@/views/common/document.vue' |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | interrelatedOrderId: null, |
| | | interrelatedOrderData: [], |
| | | showInterrelatedOrderDialog: false, |
| | | uniqueStateArr: [], |
| | | dataForm: { |
| | | selectTime: null, |
| | |
| | | isRefresh: true, // 是否显示刷新按钮 |
| | | isShowHide: true, // 是否显示显影按钮H |
| | | isSearch: true, // 高级查询按钮 |
| | | defaultOrderBy: { column: 'createTime', direction: 'desc' }, |
| | | defaultOrderBy: { column: 'placeOrderDate', direction: 'desc' }, |
| | | cancelRunCreated: true |
| | | }, |
| | | table: { |
| | |
| | | { |
| | | minWidth: '120', |
| | | prop: 'isAudit', |
| | | label: '审核状态', |
| | | label: 'PLM审核状态', |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | |
| | | return this.isAuditList |
| | | } |
| | | }, |
| | | // { |
| | | // minWidth: '80', |
| | | // prop: 'sourceId', |
| | | // label: '订单来源', |
| | | // sort: true, |
| | | // isTrue: true, |
| | | // isSearch: true, |
| | | // searchInfoType: 'text' |
| | | // }, |
| | | { |
| | | minWidth: '120', |
| | | prop: 'isPass', |
| | | label: '审核通过状态', |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'select', |
| | | formatter: this.checkIsPass, |
| | | optList: () => { |
| | | return this.isPassList |
| | | } |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | | width: '100px', |
| | |
| | | // fun: this.packageExportHandle |
| | | // }, |
| | | { |
| | | text: '审核', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.checkHandOrder, |
| | | showFun: (row)=>{return row.sourceId==='1'}, |
| | | show: { |
| | | val: [ |
| | | false, |
| | | ], |
| | | key: 'isPass' |
| | | } |
| | | }, |
| | | { |
| | | text: '已关联订单', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.showInterrelatedOrder, |
| | | }, |
| | | { |
| | | text: '删除', |
| | | type: 'text', |
| | | size: 'small', |
| | |
| | | operatorConfig: { |
| | | fixed: 'right', |
| | | label: '操作', |
| | | width: 100, |
| | | minWidth: 100 |
| | | width: 200, |
| | | minWidth: 200 |
| | | } |
| | | }, |
| | | addOrUpdateVisible: false, |
| | |
| | | } |
| | | ], |
| | | showSalesPartBatch: false, |
| | | addOrUpdateEescVisible: false |
| | | addOrUpdateEescVisible: false, |
| | | isPassList: [{label:'未通过',value: false},{label: '通过',value: true}] |
| | | } |
| | | }, |
| | | components: { |
| | |
| | | } |
| | | }, |
| | | immediate: true |
| | | }, |
| | | interrelatedOrderId(newVal){ |
| | | if(newVal){ |
| | | getInterrelatedOrder(newVal).then(res=>{ |
| | | if(res.status===200){ |
| | | this.interrelatedOrderData = res.data.data |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | permitArr: [] |
| | | }) |
| | | } |
| | | this.table.toolbar.push({ |
| | | text: '下载工艺文件', |
| | | disabled: false, |
| | | type: 'primary', |
| | | fun: this.downloadWord, |
| | | permitArr: ['03plan','04planed'], |
| | | }) |
| | | this.table.toolbar.push({ |
| | | text: '下载排产单', |
| | | disabled: false, |
| | | type: 'primary', |
| | | permitArr: [], |
| | | fun: this.downloadProductionScheduling, |
| | | }) |
| | | this.table.toolbar.push({ |
| | | text: '关联订单', |
| | | disabled: false, |
| | | type: 'primary', |
| | | fun: this.interrelatedOrderFun, |
| | | permitArr: [], |
| | | }) |
| | | if (this.permissions.customerorder_create_masterplan) { |
| | | this.table.toolbar.push({ |
| | | text: '主生产计划', |
| | |
| | | permitArr: [] |
| | | }) |
| | | } |
| | | this.table.toolbar.push({ |
| | | text: '下载Word', |
| | | disabled: false, |
| | | type: 'primary', |
| | | fun: this.downloadWord, |
| | | permitArr: ['03plan','04planed'], |
| | | }) |
| | | }, |
| | | methods: { |
| | | //下载word |
| | | checkHandOrder(val){ |
| | | this.$confirm('确认审核通过该销售订单吗?', '提示', { |
| | | confirmButtonText: '通过', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | checkHanderOrder(val).then(res=>{ |
| | | if(res.status===200){ |
| | | this.$message.success("审核通过") |
| | | this.getData() |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | interrelatedOrderFun(){ |
| | | if(this.multipleSelection.length!=2){ |
| | | this.$message.error("请选择两条销售订单") |
| | | return |
| | | } |
| | | let autoId = null |
| | | let handId = null |
| | | this.multipleSelection.forEach(ele=>{ |
| | | if(ele.sourceId==0){ |
| | | autoId = ele.id |
| | | }else if(ele.sourceId==1){ |
| | | handId = ele.id |
| | | } |
| | | }) |
| | | if(autoId==null || handId==null){ |
| | | this.$message.error("添加来源须为手动和同步") |
| | | return |
| | | } |
| | | interrelatedOrder({ |
| | | customerOrderAutoId: autoId, |
| | | customerOrderHandId: handId |
| | | }).then(res=>{ |
| | | if(res.status===200){ |
| | | this.$message.success("关联成功") |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | //展示已关联订单 |
| | | showInterrelatedOrder(currentOrder){ |
| | | this.interrelatedOrderId = currentOrder.id |
| | | this.showInterrelatedOrderDialog = true |
| | | }, |
| | | //下载排产通知单 |
| | | downloadProductionScheduling(){ |
| | | let ids = this.multipleSelection.map(obj => obj.id) |
| | | if(ids.length<1){ |
| | | this.$message.error("请选择一条数据") |
| | | return |
| | | } |
| | | downloadProduct({ids: ids}).then(res=>{ |
| | | if(res.status===200){ |
| | | transform(res) |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | //下载工艺文件 |
| | | downloadWord(){ |
| | | let ids = this.multipleSelection.map(ele=>ele.id) |
| | | if(ids.length<1){ |
| | | this.$message.error("请选择一条数据") |
| | | return |
| | | } |
| | | downloadWordFile(ids).then().catch(error=>{ |
| | | downloadWordFile(ids).then(response=>{ |
| | | // 处理返回的文件流 |
| | | const blob = response.data |
| | | const link = document.createElement('a') |
| | | link.href = URL.createObjectURL(blob) |
| | | const disposition = response.headers["content-disposition"] |
| | | let temp = disposition.substring(disposition.lastIndexOf('=') + 1) |
| | | link.download = decodeURI(temp) |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | window.setTimeout(function() { |
| | | URL.revokeObjectURL(blob) |
| | | document.body.removeChild(link) |
| | | }, 0) |
| | | }).catch(error=>{ |
| | | console.error(error); |
| | | }) |
| | | }, |
| | |
| | | this.$message.error('请选择销售订单') |
| | | } |
| | | }, |
| | | checkIsPass(row, column, cellValue){ |
| | | this.isPassList.forEach((obj) => { |
| | | if (obj.value === cellValue) { |
| | | if(obj.value){ |
| | | cellValue = "<span style='color:#34BD66;'>"+obj.label+"</span>" |
| | | }else{ |
| | | cellValue = "<span style='color:#E84738;'>"+obj.label+"</span>" |
| | | } |
| | | } |
| | | }) |
| | | return cellValue |
| | | }, |
| | | formatDutyDate(row, column, cellValue) { |
| | | if (cellValue) { |
| | | const dutyDateList = /\d{4}-\d{1,2}-\d{1,2}/g.exec(cellValue) |
| | |
| | | }, |
| | | // 新增 / 修改 |
| | | addOrUpdateHandle(row) { |
| | | this.addOrUpdateVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.addOrUpdate.init(row ? row.id : row) |
| | | }) |
| | | if(row.isPass){ |
| | | this.addOrUpdateVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.addOrUpdate.init(row ? row.id : row) |
| | | }) |
| | | }else{ |
| | | this.addSampleVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.addSampleForm.init(row ? row.contractNo : null) |
| | | }) |
| | | } |
| | | }, |
| | | // 新增样品订单 |
| | | addSampleCustomerOrder() { |
| | | this.addSampleVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.addSampleForm.init(0) |
| | | this.$refs.addSampleForm.init(null) |
| | | }) |
| | | }, |
| | | // 打开日期选择框 |
| | |
| | | } |
| | | }) |
| | | if (flag) { |
| | | checkOA(this.multipleSelection.map((e) => e.id)).then((res) => { |
| | | |
| | | checkOA(this.multipleSelection.map((e) => e.id),{}).then((res) => { |
| | | if (!res.data.data.success) { |
| | | this.$confirm(`${res.data.data.message}`, '提示', { |
| | | confirmButtonText: '确定', |
| | |
| | | } else { |
| | | if (this.judgeCoState(this.multipleSelection)) { |
| | | if (event == 'RELEVANCE') { |
| | | if(!this.multipleSelection[0].isPass){ |
| | | this.$message.error("请先审核通过,再关联工艺文件") |
| | | return |
| | | } |
| | | const firstPartNo = this.multipleSelection[0].partNo |
| | | this.multipleSelection.forEach((item) => { |
| | | if (item.isDocument) { |