|
|
@@ -1,66 +1,467 @@
|
|
|
-// package-base-select/pages/select-Income-category/select-Income-category.js
|
|
|
+/*******************************************************************************
|
|
|
+ * 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: {
|
|
|
+ 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) {
|
|
|
|
|
|
- /**
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
- data: {
|
|
|
+ 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
|
|
|
+ })
|
|
|
+},
|
|
|
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
- onLoad(options) {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow() {
|
|
|
+ /**
|
|
|
+ * @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
|
|
|
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {
|
|
|
+ this.setData({
|
|
|
+ tableData: tableData
|
|
|
+ })
|
|
|
|
|
|
- },
|
|
|
+ this.calculateTotal()
|
|
|
+ },
|
|
|
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload() {
|
|
|
+ /**
|
|
|
+ * @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)
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {
|
|
|
|
|
|
- },
|
|
|
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {
|
|
|
+ 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
|
|
|
+ })
|
|
|
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad(options) {
|
|
|
+ console.log("onLoad");
|
|
|
+ },
|
|
|
|
|
|
- }
|
|
|
})
|