12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016 |
- <template>
- <div>
- <by-bill :propConfig="config" @search="search" ref="bill" @resert="resert" @detail="openEdit" @onRefresh="resert"
- @pagination="pagination" @clickTab="clickTab" @onOrder="onOrder" @onSave="onSave">
- </by-bill>
- <vxe-modal v-model="vxeValue" width="90%" height="90%" show-zoom resize transfer show-footer>
- <template #title>
- <!-- <span>拆单</span> -->
- </template>
- <template #default>
- <div class="fl" style="width: 45%;margin-right: 10%;">
- <div style="margin-bottom: 20px;">主单销售数据</div>
- <by-table ref="leftTable" :propConfig="leftTableConfig"></by-table>
- </div>
- <!-- <div class="fl" style="font-size: 80px;margin: 10% 6% 0 6%;transform: rotate(90deg);"><i
- class="el-icon-sort"></i></div> -->
- <div class="fl" style="width: 45%;">
- <div style="margin-bottom: 20px;">拆单销售数据</div>
- <by-table ref="rightTable" :propConfig="rightTableConfig" @onChangeRow="rightChange"></by-table>
- </div>
- </template>
- <template #footer>
- <div class="btn">
- <el-button type="primary" size="small" @click="doConfirm">确定</el-button>
- </div>
- </template>
- </vxe-modal>
- </div>
- </template>
- <script lang="ts">
- import { Component, Prop, Vue, Watch } from "vue-property-decorator";
- import api from "@/api/order";
- import OrderType from "./components/orderType.vue";
- import Assembly from "@/components/Assembly/saleOrder.vue";
- @Component
- export default class SaleOrder extends Vue {
- vxeValue = false
- isCitation = false
- timeNum = 0;
- timer : any = null
- baseInfo : any = {} // 订单数据
- regularData : any = [] // 固定值
- leftTableConfig : any = {
- attr: {
- size: 'mini',
- height: 490,
- align: 'center',
- },
- columns:
- [
- {
- width: 128,
- title: '物料名称',
- field: 'materialName',
- },
- {
- width: 128,
- title: '数量',
- field: 'number',
- },
- {
- width: 128,
- title: '已拆单数量',
- field: 'splitOrderNumber',
- },
- {
- width: 128,
- title: '可拆单数量',
- field: 'splitNumber',
- }
- ]
- }
- rightTableConfig : any = {
- attr: {
- size: 'mini',
- height: 490,
- align: 'center',
- },
- columns:
- [
- {
- width: 128,
- title: '物料名称',
- field: 'materialName',
- },
- {
- width: 128,
- title: '数量',
- field: 'number',
- component: 'by-input',
- compConfig: {
- attr: {
- size: 'mini',
- type: 'integer',
- placeholder: '请输入数量'
- },
- }
- },
- ]
- }
- config : any = {
- attr: {
- activeName: 'all'
- },
- // 引单
- source: [
- {
- title: '订单任务',
- search: {
- attr: {
- size: 'medium',
- },
- columns: [
- [
- {
- span: 6,
- label: '单据编号',
- prop: 'orderNumber',
- component: 'by-input',
- compConfig: {
- attr: {
- placeholder: '请输入单据编号',
- clearable: true
- }
- }
- },
- {
- span: 6,
- label: '机构名称',
- prop: 'organizationName',
- component: 'by-input',
- compConfig: {
- attr: {
- placeholder: '请输入机构名称',
- clearable: true
- },
- },
- },
- {
- span: 6,
- label: '交货时间',
- prop: 'deliveryData',
- component: 'by-date-picker',
- compConfig: {
- attr: {
- format: 'yyyy-MM-dd hh:ss:mm',
- type: 'datetime',
- },
- }
- },
- ],
- ]
- },
- tool: {
- tools: {
- search: true,
- refresh: true
- },
- customTools: [
- {
- name: '引单', icon: 'el-icon-bottom', audit: [''], event: {
- click: () => {
- (this as any).citationOrder()
- }
- }
- },
- ]
- },
- table: {
- attr: {
- calculateH: '100%',
- size: 'mini',
- seq: true,
- align: 'left',
- radio: true,
- triggerRowCheck: 'row'
- },
- columns: [
- {
- width: 160,
- title: '单据编号',
- field: 'orderNumber',
- fixed: 'left'
- },
- {
- width: 120,
- title: '机构名称',
- field: 'organizationName',
- },
- {
- width: 80,
- title: '来源类型',
- field: 'sourceType',
- },
- {
- width: 120,
- title: '交货人',
- field: 'delivery',
- },
- {
- width: 150,
- title: '交货时间',
- field: 'deliveryData',
- },
- {
- width: 200,
- title: '交货地点',
- field: 'deliveryAddress',
- },
- {
- width: 130,
- title: '联系方式',
- field: 'deliveryPhone',
- },
- {
- width: 130,
- title: '交货方式',
- field: 'deliveryWay',
- },
- ]
- }
- },
- ],
- // 单据
- bill: {
- tool: {
- tools: {
- save: true
- },
- customTools: []
- },
- log: {
- request: {
- url: '/supply/supplyPurchaseOrderOperateLog/page',
- method: 'GET'
- }
- },
- form: {
- attr: {
- size: 'medium',
- },
- columns: [
- [
- {
- span: 8,
- label: '单据编号',
- prop: 'orderNumber',
- component: 'by-input',
- compConfig: {
- attr: {
- readonly: true,
- },
- }
- },
- {
- span: 8,
- label: '机构名称',
- prop: 'organizationName',
- component: 'by-input',
- compConfig: {
- attr: {
- readonly: true,
- },
- }
- },
- {
- span: 8,
- label: '联系方式',
- prop: 'phone',
- component: 'by-input',
- compConfig: {
- attr: {
- readonly: true,
- },
- }
- },
- {
- span: 8,
- label: '收货人',
- prop: 'consignee',
- component: 'by-input',
- compConfig: {
- attr: {
- readonly: true,
- },
- }
- },
- {
- span: 8,
- label: '计划交货时间',
- prop: 'planDeliveryData',
- component: 'by-date-picker',
- compConfig: {
- attr: {
- format: 'yyyy-MM-dd hh:ss:mm',
- type: 'datetime',
- readonly: true,
- },
- }
- },
- {
- span: 8,
- label: '确定交货时间',
- prop: 'affirmDeliveryData',
- component: 'by-input',
- compConfig: {
- attr: {
- readonly: true,
- },
- }
- },
- {
- span: 8,
- label: '交货地点',
- prop: 'address',
- component: 'by-input',
- compConfig: {
- attr: {
- readonly: true,
- },
- }
- },
- ],
- [
- {
- span: 28,
- label: '备注',
- slot: true,
- prop: 'remark',
- component: 'by-input',
- compConfig: {
- attr: {
- size: 'mini',
- placeholder: '请输入备注',
- type: 'textarea',
- readonly: false,
- },
- }
- },
- ]
- ]
- },
- tableConfig: [
- {
- table: {
- attr: {
- size: 'mini',
- calculateH: '100%',
- align: 'center',
- readonly: true
- },
- columns:
- [{
- width: 300,
- title: '物料名称',
- field: 'materialName',
- },
- {
- width: 150,
- title: '单位',
- field: 'unit',
- },
- {
- width: 150,
- title: '数量',
- field: 'number',
- },
- {
- width: 150,
- title: '已交付数量',
- field: 'outNumber',
- },
- {
- width: 150,
- title: '单价',
- field: 'unitPrice',
- },
- {
- width: 150,
- title: '实际金额',
- field: 'realityPrice',
- },
- {
- width: 150,
- title: '优惠金额',
- field: 'prePrice',
- },
- {
- width: 150,
- title: '合计金额',
- field: 'totalPrice',
- },
- ]
- }
- }
- ]
- },
- // 综合
- all: {
- search: {
- attr: {
- size: 'mini',
- },
- columns: [
- [
- {
- span: 6,
- label: '单据编号',
- prop: 'orderNumber',
- component: 'by-input',
- compConfig: {
- attr: {
- placeholder: '请输入单据编号',
- clearable: true
- }
- }
- },
- {
- span: 6,
- label: '机构名称',
- prop: 'organizationName',
- component: 'by-input',
- compConfig: {
- attr: {
- placeholder: '请输入机构名称',
- clearable: true
- },
- },
- },
- ],
- ]
- },
- tool: {
- tools: {
- search: true,
- refresh: true
- },
- customTools: [
- {
- name: '终止订单', icon: 'el-icon-close', audit: [''], event: {
- click: () => {
- (this as any).doBackOrder()
- }
- }
- }
- ]
- },
- table: {
- attr: {
- calculateH: '100%',
- size: 'mini',
- seq: true,
- align: 'left',
- radio: true
- },
- columns: [
- {
- width: 144,
- title: '单据编号',
- field: 'orderNumber',
- isDetail: true,
- },
- {
- width: 50,
- component: OrderType,
- },
- {
- width: 180,
- title: '机构名称',
- field: 'organizationName',
- },
- {
- width: 90,
- title: '收货人',
- field: 'consignee',
- },
- {
- width: 120,
- title: '联系方式',
- field: 'phone',
- },
- {
- width: 150,
- title: '计划交货时间',
- field: 'planDeliveryData',
- },
- {
- width: 150,
- title: '确定交货时间',
- field: 'affirmDeliveryData',
- },
- {
- width: 150,
- title: '交货地点',
- field: 'address',
- },
- {
- width: 150,
- title: '状态',
- field: 'status',
- component: Assembly,
- },
- {
- width: 110,
- title: '操作',
- action: true,
- plugins: [
- {
- icon: 'el-icon-edit',
- name: '查看',
- audit: '',
- event: {
- click: (item : any) => {
- (this as any).openEdit(item)
- }
- }
- },
- {
- name: '拆单',
- event: {
- show: (item : any) => {
- return item.isMaster === 1
- },
- click: (item : any) => (this as any).orderTaking(item)
- }
- },
- ]
- }
- ]
- }
- },
- // 终止订单
- returnOrder: {
- search: {
- attr: {
- size: 'mini',
- },
- columns: [
- [
- {
- span: 6,
- label: '单据编号',
- prop: 'orderNumber',
- component: 'by-input',
- compConfig: {
- attr: {
- placeholder: '请输入单据编号',
- clearable: true
- }
- }
- },
- {
- span: 6,
- label: '机构名称',
- prop: 'organizationName',
- component: 'by-input',
- compConfig: {
- attr: {
- placeholder: '请输入机构名称',
- clearable: true
- },
- },
- },
- ],
- ]
- },
- tool: {
- tools: {
- search: true,
- refresh: true
- },
- },
- table: {
- attr: {
- calculateH: '100%',
- size: 'mini',
- seq: true,
- align: 'left',
- checkbox: true
- },
- columns: [
- {
- width: 168,
- title: '单据编号',
- field: 'orderNumber',
- isDetail: true,
- fixed: 'left'
- },
- {
- width: 180,
- title: '机构名称',
- field: 'organizationName',
- },
- {
- width: 90,
- title: '收货人',
- field: 'consignee',
- },
- {
- width: 120,
- title: '联系方式',
- field: 'phone',
- },
- {
- width: 150,
- title: '计划交货时间',
- field: 'planDeliveryData',
- },
- {
- width: 150,
- title: '确定交货时间',
- field: 'affirmDeliveryData',
- },
- {
- width: 150,
- title: '交货地点',
- field: 'address',
- },
- {
- width: 150,
- title: '状态',
- field: 'status',
- component: Assembly,
- },
- {
- width: 110,
- title: '操作',
- action: true,
- plugins: [{
- icon: 'el-icon-edit',
- name: '查看',
- audit: '',
- event: {
- click: (item : any) => {
- (this as any).openEdit(item)
- }
- }
- },
- ]
- }
- ]
- }
- },
- }
- created() {
- this.timer = setInterval(() => {
- this.getDataList()
- }, 500)
- }
- // 引单
- citationOrder() {
- let parentData : any = (this as any).$refs.bill.getSourceTableSelectData(0);
- console.log(parentData);
- if (parentData.length <= 0) return this.$message.warning('请选择引单数据');
- let loading = this.$loading({ target: '.main-container' });
- api.single({ id: parentData[0].id }, 'supplyTaskOrder').then((res : any) => {
- if (res.code === 200) {
- parentData = res.data ? [res.data] : parentData;
- parentData = parentData.map((item : any) => {
- item.address = item.deliveryAddress
- item.consignee = item.delivery
- item.phone = item.deliveryPhone
- item.planDeliveryData = item.deliveryData
- const { ...newData } = item
- return newData
- });
- let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
- billConfig.tool.tools = { order: true };
- billConfig.tool.customTools = [];
- this.isCitation = true;
- (this.$refs.bill as any).showTab = 'bill';
- loading.close();
- setTimeout(() => {
- (this.$refs.bill as any).setBillConfig(billConfig);
- (this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
- (this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
- }, 0)
- } else loading.close();
- }).catch(() => loading.close());
- };
- // 接单
- onOrder() {
- this.$confirm('确定接单吗', '注意', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- let data = (this.$refs.bill as any).getBillFormValue();
- let loading = this.$loading({ target: '.main-container' });
- api.ordersaccepting({ ids: data.id }, 'supplyTaskOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- this.getDataList();
- this.$message.success('接单成功');
- (this.$refs.bill as any).showTab = 'all';
- } else this.$message.error(res.msg);
- }).catch(() => loading.close());
- }).catch(() => this.$message.info('已取消接单'));
- }
- // 右拆单数据变化
- rightChange(e : any) {
- if (0 <= e.number && e.number <= this.regularData[e.dataIndex].splitNumber) {
- let leftTableData = (this.$refs.leftTable as any).getValue();
- leftTableData[e.dataIndex].splitNumber = leftTableData[e.dataIndex].number - e.number;
- (this.$refs.leftTable as any).setValue(leftTableData);
- } else {
- let leftTableData = (this.$refs.leftTable as any).getValue();
- let rifhtTableData = (this.$refs.rightTable as any).getValue();
- rifhtTableData[e.dataIndex].number = '0';
- leftTableData[e.dataIndex].splitNumber = leftTableData[e.dataIndex].number - leftTableData[e.dataIndex].splitOrderNumber;
- (this.$refs.leftTable as any).setValue(leftTableData);
- (this.$refs.rightTable as any).setValue(rifhtTableData);
- this.$message.warning('输入值只能是自然数且不能大于可拆单数量');
- }
- }
- // 打开拆单
- orderTaking(item : any) {
- let loading = this.$loading({ target: '.main-container' });
- api.single({ id: item.id }, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- console.log(res);
- if (res.code === 200) {
- this.vxeValue = true;
- this.baseInfo = res.data;
- this.regularData = (this as any).$lodash.cloneDeep(res.data.suborderList);
- let rightData = (this as any).$lodash.cloneDeep(res.data.suborderList);
- this.regularData.map((v : any) => {
- v.splitNumber = v.number - v.splitOrderNumber;
- })
- rightData.map((v : any, i : any) => {
- v.number = '0';
- v.dataIndex = i;
- v.splitNumber = v.number - v.splitOrderNumber;
- });
- setTimeout(() => {
- (this.$refs.leftTable as any).setValue(this.regularData);
- (this.$refs.rightTable as any).setValue(rightData);
- }, 0)
- }
- }).catch(() => loading.close());
- }
- // 确认拆单
- doConfirm() {
- let rifhtNewData : any = [];
- let rifhtTableData = (this.$refs.rightTable as any).getValue();
- rifhtTableData.map((v : any) => {
- rifhtNewData.push({
- id: v.id,
- inSplitOrderNumber: v.number
- })
- });
- let isTrue = rifhtNewData.filter((v : any) => v.inSplitOrderNumber != 0);
- let obj : any = {
- id: this.baseInfo.id,
- splitList: rifhtNewData,
- };
- if (isTrue.length > 0) {
- this.$confirm('确定拆单吗!', '注意', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- let loading = this.$loading({ target: '.main-container' });
- api.splitOrder(obj, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- this.$message.success('拆单成功');
- this.getPageList({}, 'all'); // 综合数据
- this.vxeValue = false;
- } else this.$message.error(res.msg);
- }).catch(() => loading.close());
- }).catch(() => this.$message.info('已取消拆单'));
- } else this.$message.warning('请输入拆单销售数据');
- }
- getDataList() {
- if (!this.$refs.bill) {
- if (this.timeNum > 5) {
- clearInterval(this.timer)
- }
- this.timeNum++;
- return
- }
- clearInterval(this.timer);
- this.getPageList({}, 'all'); // 综合数据
- }
- // 获取分页数据
- getPageList(query : any, type : any) {
- let data = (this.$refs.bill as any).getTablePage('all');
- query.pageNo = data.pageNo;
- query.pageSize = data.pageSize;
- let loading = this.$loading({ target: '.main-container' });
- api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- (this.$refs.bill as any).setTabTableValue(type, res.data.records);
- let page = {
- pageNo: res.data.current, //当前页
- pageSize: res.data.size, //每页条数
- total: res.data.total //总条数
- };
- (this.$refs.bill as any).setTablePage(type, page)
- } else this.$message.error(res.msg);
- }).catch(() => loading.close());
- }
- // 获取引单分页数据
- getCitationList(query : any) {
- let data = (this.$refs.bill as any).getTablePage('all');
- query.pageNo = data.pageNo;
- query.pageSize = data.pageSize;
- query.submitState = 1; // 已提交
- query.status = 0; // 未接单
- let loading = this.$loading({ target: '.main-container' });
- api.pageList(query, 'supplyTaskOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- (this.$refs.bill as any).setSourceTableData(0, res.data.records);
- let page = {
- pageNo: res.data.current, //当前页
- pageSize: res.data.size, //每页条数
- total: res.data.total //总条数
- };
- (this.$refs.bill as any).setSourcePage(0, page);
- } else this.$message.error(res.msg)
- }).catch(() => loading.close());
- }
- // 保存
- onSave(){
- let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
- console.log('保存参数query ==> ', query);
- let loading = this.$loading({ target: '.main-container' });
- api.updateList(query, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- this.$message.success('保存成功');
- this.getPageList({}, 'all'); // 综合数据
- (this.$refs.bill as any).showTab = 'all';
- } else this.$message.error(res.msg);
- }).catch(() => loading.close());
- }
- // 打开编辑
- openEdit(e : any) {
- e = e.row ? e.row : e;
- let loading = this.$loading({ target: '.main-container' });
- api.single({ id: e.id }, 'supplyPurchaseOrder').then((res : any) => {
- if (res.code === 200) {
- let parentData = res.data ? res.data : e;
- console.log(parentData);
- let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
- if (parentData.status === 2) {
- billConfig.tool.customTools = [];
- } else {
- billConfig.tool.customTools = [
- {
- name: '终止订单', icon: 'el-icon-close', audit: [''], event: {
- click: () => {
- (this as any).doBackOrder2(parentData)
- }
- }
- }
- ];
- // 主单
- if (parentData.isMaster === 1) {
- billConfig.tool.customTools = [
- {
- name: '拆单', icon: 'el-icon-minus', audit: [''], event: {
- click: () => {
- (this as any).orderTaking(parentData)
- }
- }
- },
- {
- name: '终止订单', icon: 'el-icon-close', audit: [''], event: {
- click: () => {
- (this as any).doBackOrder2(parentData)
- }
- }
- }
- ];
- }
- };
- billConfig.tool.tools = {};
- billConfig.form.columns[0].map((v:any) => {
- v.compConfig.attr.readonly = true;
- })
- console.log(billConfig.form.columns[0]);
- billConfig.form.columns[1][0].compConfig.attr.readonly = true;
- if (parentData.status === 0) {
- billConfig.form.columns[0][2].compConfig.attr.readonly = false;
- billConfig.form.columns[0][3].compConfig.attr.readonly = false;
- billConfig.form.columns[0][4].compConfig.attr.readonly = false;
- billConfig.form.columns[0][6].compConfig.attr.readonly = false;
- billConfig.form.columns[1][0].compConfig.attr.readonly = false;
- billConfig.tool.tools = { save: true };
- };
- (this.$refs.bill as any).setBillConfig(billConfig);
- (this.$refs.bill as any).setBillFormValue(parentData); // 设置单据表单数据
- (this.$refs.bill as any).setBillTableValue(parentData.suborderList, 0);// 设置第1张单据表格数据
- (this.$refs.bill as any).showTab = 'bill';
- loading.close();
- } else loading.close();
- }).catch(() => loading.close());
- }
- // 导航切换
- clickTab(e : any) {
- console.log('导航切换 ==> ', e);
- // submitState: 提交状态
- if (e === 'source') {
- this.getCitationList({});
- }
- if (e === 'all') this.getDataList();
- if (e === 'returnOrder') this.getPageList({ status: 2 }, 'returnOrder');
- if (e === 'bill') {
- let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
- billConfig.tool.tools = {};
- billConfig.tool.customTools = [];
- (this.$refs.bill as any).setBillConfig(billConfig);
- }
- }
- // 工具栏终止订单
- doBackOrder() {
- let selectData = (this as any).$refs.bill.getTableSelectData('all');
- // if (selectData.length > 1) return this.$message.warning('只能选择一条终止订单数据');
- let ids : any = [];
- if (selectData.length > 0) {
- selectData.map((v : any) => {
- ids.push(v.id);
- })
- } else return this.$message({ type: 'warning', message: '请选择终止订单数据' })
- // console.log(ids);
- this.$confirm('确定终止订单吗!', '注意', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- let loading = this.$loading({ target: '.main-container' });
- api.stoporder({ ids: ids }, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- this.$message.success('终止订单成功');
- this.getDataList();
- (this.$refs.bill as any).showTab = 'all';
- } else this.$message.error(res.msg)
- }).catch(() => loading.close());
- }).catch(() => this.$message.info('已取消终止订单'));
- }
- // 单据操作终止订单
- doBackOrder2(e : any) {
- this.$confirm('确定终止订单吗!', '注意', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- let loading = this.$loading({ target: '.main-container' });
- api.stoporder({ ids: e.id }, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- this.$message.success('终止订单成功');
- this.getDataList();
- (this.$refs.bill as any).showTab = 'all';
- } else this.$message.error(res.msg)
- }).catch(() => loading.close());
- }).catch(() => this.$message.info('已取消终止订单'));
- }
- // 分页
- pagination(e : any) {
- console.log('分页 ==> ', e);
- if(e.type==='source_0'){
- let query : any = (this as any).$refs.bill.$refs.source_0[0].getSearchValue();
- query.pageNo = e.page.pageNum;
- query.pageSize = e.page.pageSize;
- this.getCitationList(query);
- }else{
- let query : any = (this as any).$refs.bill.getSearchValue(e.type);
- query.pageNo = e.page.pageNum;
- query.pageSize = e.page.pageSize;
- if (e.type === 'returnOrder') query.status = 2; // 终止订单数据
- let loading = this.$loading({ target: '.main-container' });
- api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
- loading.close();
- if (res.code === 200) {
- (this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
- } else this.$message.error(res.msg);
- }).catch(() => loading.close());
- }
- }
- // 搜索
- search(parames : any) {
- let query = parames.value
- if (parames.type === 'source_0') {
- this.getCitationList(query); // 引单数据
- } else {
- if (query.type === 'returnOrder') query.status = 2; // 终止订单数据
- this.getPageList(query, parames.type) // 获取综合分页数据
- }
- }
- // 刷新/重置
- resert(e : any) {
- let data : any = e.type ? e.type : e;
- console.log('刷新/重置 ==> ', data);
- if (data === 'source_0') {
- (this as any).$refs.bill.$refs.source_0[0].clearSearch();
- this.getCitationList({}); // 引单数据
- } else {
- (this as any).$refs.bill.$refs[data].clearSearch();
- if (data === 'all') this.getPageList({}, 'all'); // 综合数据
- if (data === 'returnOrder') this.getPageList({ status: 2 }, 'returnOrder'); // 终止订单数据
- }
- }
- }
- </script>
|