|
|
@@ -1,506 +0,0 @@
|
|
|
-/*******************************************************************************
|
|
|
- * Copyright(c) 2021 dongke All rights reserved. / Confidential
|
|
|
- * 类的信息:
|
|
|
- * 1.程序名称:
|
|
|
- * 2.功能描述:单据列表-应收单据 -应付单据
|
|
|
- * 编辑履历:
|
|
|
- * 作者 日期 版本 修改内容
|
|
|
- * jyh 2022-5-25 1.00 新建
|
|
|
- *******************************************************************************/
|
|
|
-const Constants = require('@/utils/Constants.js');
|
|
|
-const mixins = require('@/mixins/index.js')
|
|
|
-Page({
|
|
|
- mixins: [mixins],
|
|
|
- /**
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
- data: {
|
|
|
- // 弹出按钮
|
|
|
- buttonList: [{
|
|
|
- code: "add",
|
|
|
- name: 'merge',
|
|
|
- color:'#C7A974',
|
|
|
- title: '新建'
|
|
|
- },{
|
|
|
- code: "save",
|
|
|
- name: 'merge',
|
|
|
- title: '确定'
|
|
|
- }],
|
|
|
- returnTotalAmount: 0,
|
|
|
- allChecked: false,
|
|
|
- tableData: [
|
|
|
- {
|
|
|
- "addressArea": null,
|
|
|
- "addressFull": null,
|
|
|
- "addressGcj02": null,
|
|
|
- "addressName": null,
|
|
|
- "addressNo": null,
|
|
|
- "annexPaths": null,
|
|
|
- "channelName": null,
|
|
|
- "contactName": null,
|
|
|
- "contactPhone": null,
|
|
|
- "cpId": 1,
|
|
|
- "cusCode": null,
|
|
|
- "cusFromName": null,
|
|
|
- "cusId": null,
|
|
|
- "cusName": null,
|
|
|
- "cusPhone": null,
|
|
|
- "flgValid": true,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromNo": "PO240320048T995E",
|
|
|
- "goodsList": null,
|
|
|
- "inboundItemList": [
|
|
|
- {
|
|
|
- "costAmt": 0,
|
|
|
- "costPrice": 0,
|
|
|
- "cpId": 1,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromItemId": "10112024-0320-0000-0000-0000157e51f1",
|
|
|
- "intoAmt": 0,
|
|
|
- "intoId": "10112024-0320-0000-0000-00001581e811",
|
|
|
- "intoItemId": "10112024-0320-0000-0000-00001582320f",
|
|
|
- "intoQty": 0,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoingAmt": 2,
|
|
|
- "intoingQty": 2,
|
|
|
- "invId": null,
|
|
|
- "invQty": 0,
|
|
|
- "itemId": "10112024-0320-0000-0000-00001582320f",
|
|
|
- "itemIndex": 1,
|
|
|
- "nonStdCode": "-",
|
|
|
- "outQty": 0,
|
|
|
- "priceInto": 1,
|
|
|
- "pricePurchase": 1,
|
|
|
- "priceStd": 2,
|
|
|
- "rejectQty": 0,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "skuCode": "A00Z01S7",
|
|
|
- "skuId": "10112024-0304-0000-0000-00000907f868",
|
|
|
- "skuImages": {
|
|
|
- "path": "https://lingtui-1315959497.cos.ap-beijing.myqcloud.com/20240306152837.jpg"
|
|
|
- },
|
|
|
- "skuModel": "112",
|
|
|
- "skuName": "SSS"
|
|
|
- },
|
|
|
- {
|
|
|
- "costAmt": 0,
|
|
|
- "costPrice": 0,
|
|
|
- "cpId": 1,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromItemId": "10112024-0320-0000-0000-0000157f4b6a",
|
|
|
- "intoAmt": 0,
|
|
|
- "intoId": "10112024-0320-0000-0000-00001581e811",
|
|
|
- "intoItemId": "10112024-0320-0000-0000-00001583b1c5",
|
|
|
- "intoQty": 0,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoingAmt": 20.44,
|
|
|
- "intoingQty": 2,
|
|
|
- "invId": null,
|
|
|
- "invQty": 0,
|
|
|
- "itemId": "10112024-0320-0000-0000-00001583b1c5",
|
|
|
- "itemIndex": 2,
|
|
|
- "nonStdCode": "-",
|
|
|
- "outQty": 0,
|
|
|
- "priceInto": 10.22,
|
|
|
- "pricePurchase": 10.22,
|
|
|
- "priceStd": 798,
|
|
|
- "rejectQty": 0,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "skuCode": "AAA1",
|
|
|
- "skuId": "10112024-0228-0000-0000-000001c3cc7e",
|
|
|
- "skuImages": {
|
|
|
- "path": "https://lingtui-1315959497.cos.ap-beijing.myqcloud.com/20240306152837.jpg"
|
|
|
- },
|
|
|
- "skuModel": "AAA",
|
|
|
- "skuName": "AAA"
|
|
|
- },
|
|
|
- {
|
|
|
- "costAmt": 0,
|
|
|
- "costPrice": 0,
|
|
|
- "cpId": 1,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromItemId": "10112024-0320-0000-0000-000015800512",
|
|
|
- "intoAmt": 0,
|
|
|
- "intoId": "10112024-0320-0000-0000-00001581e811",
|
|
|
- "intoItemId": "10112024-0320-0000-0000-00001584c494",
|
|
|
- "intoQty": 0,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoingAmt": 20000,
|
|
|
- "intoingQty": 2,
|
|
|
- "invId": null,
|
|
|
- "invQty": 0,
|
|
|
- "itemId": "10112024-0320-0000-0000-00001584c494",
|
|
|
- "itemIndex": 3,
|
|
|
- "nonStdCode": "-",
|
|
|
- "outQty": 0,
|
|
|
- "priceInto": 10000,
|
|
|
- "pricePurchase": 10000,
|
|
|
- "priceStd": 2000,
|
|
|
- "rejectQty": 0,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "skuCode": "HE900AB",
|
|
|
- "skuId": "10112024-0306-0000-0000-00000a70e010",
|
|
|
- "skuImages": null,
|
|
|
- "skuModel": "智能一体机盖板HE900A ",
|
|
|
- "skuName": "智能一体机盖板HE900A "
|
|
|
- }
|
|
|
- ],
|
|
|
- "intoAmt": 0,
|
|
|
- "intoDate": null,
|
|
|
- "intoId": "10112024-0320-0000-0000-00001581e811",
|
|
|
- "intoNo": "AA240320048XE811",
|
|
|
- "intoQty": 0,
|
|
|
- "intoReason": null,
|
|
|
- "intoReasonName": null,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoStatusName": null,
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoTypeName": null,
|
|
|
- "intoingAmt": 10011.22,
|
|
|
- "intoingQty": 6,
|
|
|
- "makeStaff": "10112024-0315-0000-0000-000012034444",
|
|
|
- "makeStaffName": null,
|
|
|
- "makeTime": "2024-03-20 13:52:52",
|
|
|
- "orgId": "10112024-0221-0000-0000-000000011b47",
|
|
|
- "orgName": null,
|
|
|
- "payableId": null,
|
|
|
- "receivableId": null,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "staffId": "10112024-0315-0000-0000-000012034444",
|
|
|
- "staffName": null,
|
|
|
- "sumAmount": null,
|
|
|
- "sumQuantity": null,
|
|
|
- "supId": "10112024-0307-0000-0000-00000c81ca28",
|
|
|
- "supplierName": null,
|
|
|
- "whId": null,
|
|
|
- "whName": null
|
|
|
- },
|
|
|
- {
|
|
|
- "addressArea": null,
|
|
|
- "addressFull": null,
|
|
|
- "addressGcj02": null,
|
|
|
- "addressName": null,
|
|
|
- "addressNo": null,
|
|
|
- "annexPaths": null,
|
|
|
- "channelName": null,
|
|
|
- "contactName": null,
|
|
|
- "contactPhone": null,
|
|
|
- "cpId": 1,
|
|
|
- "cusCode": null,
|
|
|
- "cusFromName": null,
|
|
|
- "cusId": null,
|
|
|
- "cusName": null,
|
|
|
- "cusPhone": null,
|
|
|
- "flgValid": true,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromNo": "PO240320048T995E",
|
|
|
- "goodsList": null,
|
|
|
- "inboundItemList": [
|
|
|
- {
|
|
|
- "costAmt": 0,
|
|
|
- "costPrice": 0,
|
|
|
- "cpId": 1,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromItemId": "10112024-0320-0000-0000-0000157e51f1",
|
|
|
- "intoAmt": 0,
|
|
|
- "intoId": "10112024-0320-0000-0000-0000159171f9",
|
|
|
- "intoItemId": "10112024-0320-0000-0000-000015922409",
|
|
|
- "intoQty": 0,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoingAmt": 2,
|
|
|
- "intoingQty": 2,
|
|
|
- "invId": null,
|
|
|
- "invQty": 0,
|
|
|
- "itemId": "10112024-0320-0000-0000-000015922409",
|
|
|
- "itemIndex": 1,
|
|
|
- "nonStdCode": "-",
|
|
|
- "outQty": 0,
|
|
|
- "priceInto": 1,
|
|
|
- "pricePurchase": 1,
|
|
|
- "priceStd": 2,
|
|
|
- "rejectQty": 0,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "skuCode": "A00Z01S7",
|
|
|
- "skuId": "10112024-0304-0000-0000-00000907f868",
|
|
|
- "skuImages": {
|
|
|
- "path": "https://lingtui-1315959497.cos.ap-beijing.myqcloud.com/20240306152837.jpg"
|
|
|
- },
|
|
|
- "skuModel": "112",
|
|
|
- "skuName": "SSS"
|
|
|
- },
|
|
|
- {
|
|
|
- "costAmt": 0,
|
|
|
- "costPrice": 0,
|
|
|
- "cpId": 1,
|
|
|
- "fromId": "10112024-0320-0000-0000-0000157d995e",
|
|
|
- "fromItemId": "10112024-0320-0000-0000-0000157f4b6a",
|
|
|
- "intoAmt": 0,
|
|
|
- "intoId": "10112024-0320-0000-0000-0000159171f9",
|
|
|
- "intoItemId": "10112024-0320-0000-0000-00001593290f",
|
|
|
- "intoQty": 0,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoingAmt": 20.44,
|
|
|
- "intoingQty": 2,
|
|
|
- "invId": null,
|
|
|
- "invQty": 0,
|
|
|
- "itemId": "10112024-0320-0000-0000-00001593290f",
|
|
|
- "itemIndex": 2,
|
|
|
- "nonStdCode": "-",
|
|
|
- "outQty": 0,
|
|
|
- "priceInto": 10.22,
|
|
|
- "pricePurchase": 10.22,
|
|
|
- "priceStd": 798,
|
|
|
- "rejectQty": 0,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "skuCode": "AAA1",
|
|
|
- "skuId": "10112024-0228-0000-0000-000001c3cc7e",
|
|
|
- "skuImages": {
|
|
|
- "path": "https://lingtui-1315959497.cos.ap-beijing.myqcloud.com/20240306152837.jpg"
|
|
|
- },
|
|
|
- "skuModel": "AAA",
|
|
|
- "skuName": "AAA"
|
|
|
- }
|
|
|
- ],
|
|
|
- "intoAmt": 0,
|
|
|
- "intoDate": null,
|
|
|
- "intoId": "10112024-0320-0000-0000-0000159171f9",
|
|
|
- "intoNo": "AA240320049D71F9",
|
|
|
- "intoQty": 0,
|
|
|
- "intoReason": null,
|
|
|
- "intoReasonName": null,
|
|
|
- "intoStatus": "入库状态-入库中",
|
|
|
- "intoStatusName": null,
|
|
|
- "intoType": "入库类型-采购入库",
|
|
|
- "intoTypeName": null,
|
|
|
- "intoingAmt": 20022.44,
|
|
|
- "intoingQty": 6,
|
|
|
- "makeStaff": "10112024-0315-0000-0000-000012034444",
|
|
|
- "makeStaffName": null,
|
|
|
- "makeTime": "2024-03-20 13:55:56",
|
|
|
- "orgId": "10112024-0221-0000-0000-000000011b47",
|
|
|
- "orgName": null,
|
|
|
- "payableId": null,
|
|
|
- "receivableId": null,
|
|
|
- "remarks": null,
|
|
|
- "returnAmt": 0,
|
|
|
- "returnQty": 0,
|
|
|
- "staffId": "10112024-0315-0000-0000-000012034444",
|
|
|
- "staffName": null,
|
|
|
- "sumAmount": null,
|
|
|
- "sumQuantity": null,
|
|
|
- "supId": "10112024-0307-0000-0000-00000c81ca28",
|
|
|
- "supplierName": null,
|
|
|
- "whId": null,
|
|
|
- "whName": null
|
|
|
- }
|
|
|
- ],
|
|
|
- active:0,
|
|
|
- choooseInboundItemList: [],
|
|
|
- // 路由
|
|
|
- routeObjName: 'common',
|
|
|
- formMode: Constants.formMode.index,
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 加载数据源
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- getData(params) {
|
|
|
-
|
|
|
- return this.excute(this.data.service, this.data.service.getDictionaryData, params);
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 设置查询参数
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- setSearchParams(params) {
|
|
|
- // 从上一个页面的urlkeypara传入
|
|
|
- params.dictCode = "基础资料-收入类别"
|
|
|
- return params
|
|
|
- },
|
|
|
- /**
|
|
|
-* @desc : 顶部切换
|
|
|
-* @date : 2024/2/1 15:49
|
|
|
-* @author : 王英杰
|
|
|
-*/
|
|
|
-changeTag(e) {
|
|
|
- this.setData({
|
|
|
- active: e.detail.index
|
|
|
- })
|
|
|
-},
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 父级商品信息选择
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- onListItemChange(e) {
|
|
|
- let tableData = this.data.tableData
|
|
|
- let index = e.currentTarget.dataset.index
|
|
|
- tableData[index].checked = !tableData[index].checked
|
|
|
- let inboundItemList = tableData[index].inboundItemList
|
|
|
- if (inboundItemList && inboundItemList.length > 0) {
|
|
|
- inboundItemList.forEach(res => {
|
|
|
- res.checked = tableData[index].checked
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- this.setData({
|
|
|
- tableData: tableData
|
|
|
- })
|
|
|
- this.calculateTotal()
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 子级商品信息选择
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- onChangeItemCheckbox(e) {
|
|
|
- let tableData = this.data.tableData
|
|
|
- let index = e.currentTarget.dataset.index
|
|
|
- let index_ = e.currentTarget.dataset.index_
|
|
|
- console.log(index, index_)
|
|
|
- tableData[index].inboundItemList[index_].checked = !tableData[index].inboundItemList[index_].checked
|
|
|
-
|
|
|
- this.setData({
|
|
|
- tableData: tableData
|
|
|
- })
|
|
|
-
|
|
|
- this.calculateTotal()
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 全退
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- onCheckboxChange(e) {
|
|
|
- console.log(e.detail.checked)
|
|
|
- let checked = e.detail.checked
|
|
|
- let tableData = this.data.tableData
|
|
|
- tableData.forEach(res => {
|
|
|
- res.checked = checked
|
|
|
- if (res.inboundItemList && res.inboundItemList.length > 0) {
|
|
|
- res.inboundItemList.forEach(item => {
|
|
|
- item.checked = checked
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- tableData: tableData
|
|
|
- })
|
|
|
- this.calculateTotal()
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 计算金额/过滤出已选数据
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- calculateTotal() {
|
|
|
- let tableData = this.data.tableData
|
|
|
- let choooseInboundItemList = []
|
|
|
- let returnTotalAmount = Number(0)
|
|
|
- //过滤出已选数据
|
|
|
- tableData.forEach(res => {
|
|
|
- if (res.inboundItemList && res.inboundItemList.length > 0) {
|
|
|
- res.inboundItemList.forEach(item => {
|
|
|
- if (item.checked) {
|
|
|
- item.itemQty = Number(item.rejectQty * -1)
|
|
|
- item.itemQtyMax = Number(item.rejectQty * -1)
|
|
|
- item.priceReturn = Number(item.priceInto * -1)
|
|
|
- item.itemAmt = Number(item.rejectQty * item.priceInto * -1)
|
|
|
- choooseInboundItemList.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- if (choooseInboundItemList && choooseInboundItemList.length > 0) {
|
|
|
- choooseInboundItemList.forEach(res => {
|
|
|
- returnTotalAmount += Number(res.rejectQty * res.priceInto)
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- this.setData({
|
|
|
- choooseInboundItemList: choooseInboundItemList,
|
|
|
- returnTotalAmount: returnTotalAmount.toFixed(2),
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 跳转退货页
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 姜永辉
|
|
|
- */
|
|
|
- returnData() {
|
|
|
- let item = e.detail.item
|
|
|
- const eventChannel = this.getOpenerEventChannel();
|
|
|
- eventChannel.emit('bindData', {
|
|
|
- data: {
|
|
|
- choooseInboundItemList: choooseInboundItemList,
|
|
|
- goodsRejectedAmount: that.data.returnTotalAmount,
|
|
|
- item: JSON.stringify(item)
|
|
|
- }
|
|
|
- })
|
|
|
- wx.navigateBack({
|
|
|
- delta: 1
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 按钮点击事件回调
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 王英杰
|
|
|
- */
|
|
|
- open(e) {
|
|
|
- let that = this
|
|
|
- let code = e.detail.name
|
|
|
- if (code == "add") { //新建事件
|
|
|
-
|
|
|
- }
|
|
|
- if (code == "save") { //选择确定
|
|
|
- let list = this.data.tableData
|
|
|
- let chooseList = [] //
|
|
|
- let alreadyList = this.data.alreadyList //之前已经选择的
|
|
|
- let tempList = list.filter(itt => {
|
|
|
- return itt.checked
|
|
|
- })
|
|
|
- chooseList = alreadyList.concat(tempList)
|
|
|
-
|
|
|
- if (!(chooseList && chooseList.length > 0)) {
|
|
|
- wx.showToast({
|
|
|
- title: mixins.$t('pleaseChoose'),//"请至少选择一件商品" ,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
- wx.navigateTo({
|
|
|
- url: that.data.route.openPurchase.url,
|
|
|
- success: function (res) {
|
|
|
- res.eventChannel.emit('params', {choooseItemList: chooseList })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
-})
|