|
|
@@ -1,699 +1,410 @@
|
|
|
-const app = getApp()
|
|
|
+const mixins = require('@/mixins/index.js')
|
|
|
const Constants = require('@/utils/Constants.js');
|
|
|
-const api = require('@/utils/api.js');
|
|
|
-import Dialog from '@/dist/dialog/dialog.js'
|
|
|
-const util = require('@/utils/util.js')
|
|
|
-const common = require('@/utils/common.js')
|
|
|
+const app = getApp()
|
|
|
Page({
|
|
|
-
|
|
|
+ mixins: [mixins],
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- flgAllScan:true,
|
|
|
- sacnFlag:false,
|
|
|
+ formMode: Constants.formMode.index,
|
|
|
+ // 弹出按钮
|
|
|
+ buttonList: [{
|
|
|
+ name: 'merge',
|
|
|
+ title: ''
|
|
|
+ }],
|
|
|
+ contentList: [{
|
|
|
+ code: 'need',
|
|
|
+ title: mixins.$t('totalAmount'),
|
|
|
+ type: 'str'
|
|
|
+ }, {
|
|
|
+ code: 'amount',
|
|
|
+ content: 0,
|
|
|
+ type: 'number'
|
|
|
+ }],
|
|
|
+ // 动态的
|
|
|
+ cardList: [],
|
|
|
+ contentObj: {},
|
|
|
+ popContent: [{
|
|
|
+ code: 'outingQty',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t('count'),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'whId',
|
|
|
+ name: 'whName',
|
|
|
+ title: '仓库',
|
|
|
+ type: 'drop',
|
|
|
+ dropType: 'warehouse'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'skuSpec',
|
|
|
+ title: '规格',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'nonStdCode',
|
|
|
+ title: '商品批次',
|
|
|
+ type: 'str',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+
|
|
|
+ // 路由
|
|
|
+ routeObjName: 'outboundProcessing',
|
|
|
+ inboundOtherService: app.globalData['inboundOtherService'],
|
|
|
+ inboundSaleReturnService: app.globalData['inboundSaleReturnService'],
|
|
|
+ // 主键Id
|
|
|
+ primaryKey: 'outId',
|
|
|
},
|
|
|
- /**
|
|
|
- * @desc : 展开,收起更多功能事件
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- listToggle() {
|
|
|
+ /**
|
|
|
+ * @desc : dk-from choose 回调事件
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
+ */
|
|
|
+ chooseData(e) {
|
|
|
+ console.log("t", e, this.data.formData);
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ let code = e.detail.code
|
|
|
+ let data = e.detail.data.data
|
|
|
+ if (code == "whId") { //商品品牌
|
|
|
+ formData.whId = data.id
|
|
|
+ formData.whName = data.name
|
|
|
+ }
|
|
|
+
|
|
|
this.setData({
|
|
|
- showMore: !this.data.showMore
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
})
|
|
|
},
|
|
|
- /**
|
|
|
- * @desc : 小程序出库-扫码数据
|
|
|
- * @author : 王英杰
|
|
|
- * @date : 2023年8月21日
|
|
|
+ /**
|
|
|
+ * @desc : 给表单赋值
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
*/
|
|
|
- getScanData() {
|
|
|
- this.setData({
|
|
|
- loading: true
|
|
|
- })
|
|
|
-
|
|
|
- let param = {
|
|
|
- }
|
|
|
- param.outId = this.data.form.outId
|
|
|
- api.request(Constants.ORDER_OTHER_OUT_SCAN_CODE + 'list_by', 'POST', param).then(res => {
|
|
|
+ setValuesByEdit(data) {
|
|
|
+ console.log("setValuesByEdit", data);
|
|
|
+ let cardList_ = this.data.cardList
|
|
|
+ let contentList_ = this.data.contentList
|
|
|
+ let sumitemAmt = 0
|
|
|
+ let formType = this.data.formType
|
|
|
+ // 入库状态-已入库
|
|
|
+ if (data.outStatus == Constants.outStatus.unOutBound) {
|
|
|
+ //查询采购订单表 未入库的 详细
|
|
|
this.setData({
|
|
|
- loading: false
|
|
|
+ buttonList: [{
|
|
|
+ name: 'merge',
|
|
|
+ title: '关闭'
|
|
|
+ }],
|
|
|
})
|
|
|
- // 返回值
|
|
|
- if (res.data.code === 200) {
|
|
|
- let barcodeList = res.data.data || []
|
|
|
-
|
|
|
- // 返回 值 按著 明細 放入相應的 明細的 barcodeList
|
|
|
-
|
|
|
- this.data.goodsList.forEach(gooditem => {
|
|
|
- if (gooditem.barcodeList == null) {
|
|
|
- gooditem.barcodeList = []
|
|
|
- }
|
|
|
- barcodeList.forEach(it => {
|
|
|
- if (gooditem.itemId == it.outItemId) {
|
|
|
- gooditem.barcodeList.push(it)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- // 条码 是否全部扫描完成
|
|
|
- let flgAllScan = true
|
|
|
- // 条码 是否全部扫描
|
|
|
- for (let index = 0; index < this.data.goodsList.length; index++) {
|
|
|
- const gooditem = this.data.goodsList[index];
|
|
|
- if (gooditem.flgNonStdType == 2) {
|
|
|
- if (gooditem.barcodeList.length == 0
|
|
|
- || gooditem.outQuantity != gooditem.barcodeList.length / gooditem.barcodeList[0].nonStdNum) {
|
|
|
- flgAllScan = false
|
|
|
- break
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (gooditem.outQuantity != gooditem.barcodeList.length ) {
|
|
|
- flgAllScan = false
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- barcodeList,
|
|
|
- flgAllScan
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ buttonList: [{
|
|
|
+ name: 'merge',
|
|
|
+ title: '出库办理'
|
|
|
+ }],
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ sumitemAmt = Number(data.outingQty) * Number(data.outingAmt)
|
|
|
+ cardList_.forEach(card => {
|
|
|
+ if (card.name === 'items') {
|
|
|
+ if (formType == 1) {
|
|
|
+ card.info = "(待入库)",
|
|
|
+ card.color = "#E4002B"
|
|
|
+ } else {
|
|
|
+ card.info = "(已入库)",
|
|
|
+ card.color = "#1B365D"
|
|
|
+ }
|
|
|
+ card.itemAmt = sumitemAmt
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
- /**查看条码里的收起 展开 */
|
|
|
- onClickScan(e){
|
|
|
- let barList = this.data.goodsList
|
|
|
- barList[e.currentTarget.dataset.index].checked = !barList[e.currentTarget.dataset.index].checked
|
|
|
- this.setData({
|
|
|
- goodsList: barList
|
|
|
- })
|
|
|
- },
|
|
|
- /**关闭查看条码 */
|
|
|
- closeChoosedItemInfo_scan(){
|
|
|
- this.setData({
|
|
|
- sacnFlag: false
|
|
|
- })
|
|
|
- },
|
|
|
-// 补码扫描 查看
|
|
|
-openSacn(e) {
|
|
|
- if (this.data.flgAllScan){
|
|
|
- this.setData({
|
|
|
- sacnFlag: true,
|
|
|
- })
|
|
|
- }else{
|
|
|
- let outId = this.data.form.outId
|
|
|
- wx.navigateTo({
|
|
|
- url: '/package7/pages/supplementary_scan_barcode/supplementary_scan_barcode?outId=' + outId,
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
-},
|
|
|
- /**
|
|
|
- * @desc : 删除图片
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/31 18:16
|
|
|
- */
|
|
|
- deleteImg(e) {
|
|
|
- let index = e.detail.index;
|
|
|
- let arr = this.data.fileList;
|
|
|
- arr.splice(index, 1);
|
|
|
+ contentList_[1].content = sumitemAmt
|
|
|
+
|
|
|
+ // 刷新商品明细 显示 查看更多
|
|
|
+ let card = this.data.cardList.filter(it => it.name == 'items');
|
|
|
+ this.selectComponent('#dk-form-bill').handleContentObj(card[0])
|
|
|
+
|
|
|
this.setData({
|
|
|
- fileList: arr
|
|
|
+ itemData: data,
|
|
|
+ cardList: cardList_,
|
|
|
+ contentList: contentList_,
|
|
|
+ formData: JSON.stringify(data),
|
|
|
+ sumitemAmt
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * @desc : 图片上传
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/31 18:16
|
|
|
+ * @desc : 保存的參數設置
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
*/
|
|
|
- afterRead(event) {
|
|
|
- const _this = this;
|
|
|
- const {
|
|
|
- file
|
|
|
- } = event.detail;
|
|
|
- let annexPaths = _this.data.annexPaths || []
|
|
|
- let arr = _this.data.fileList;
|
|
|
- file.forEach(res => {
|
|
|
- // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
|
|
- wx.uploadFile({
|
|
|
- url: `${config.server_add}:${config.server_port}` + '/basic-server/file/upload',
|
|
|
- filePath: res.path,
|
|
|
- name: 'file',
|
|
|
- formData: {
|
|
|
- 'folder': 't_order/annex_paths'
|
|
|
- },
|
|
|
- header: {
|
|
|
- 'Authorization': 'Bearer ' + app.globalData.token
|
|
|
- },
|
|
|
- success(res) {
|
|
|
- let data = JSON.parse(res.data)
|
|
|
- if (data.code === 200) {
|
|
|
+ setParams(params) {
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ params.allEdit = true //大编辑
|
|
|
+ params.itemList = formData.goodsList //商品明细
|
|
|
+ params.deleteItemList = []
|
|
|
+ params.fromId = formData.fromId //来源id
|
|
|
+ params.fromNo = formData.fromNo //来源单号
|
|
|
+ params.orgId = formData.orgId //组织部门
|
|
|
+ params.staffId = formData.staffId // 员工
|
|
|
+ params.supId = formData.supId // 供应商
|
|
|
+ params.whId = formData.whId // 仓库
|
|
|
+ params.remarks = formData.remarks // 备注
|
|
|
+ params.makeStaff = formData.staffId // 制单人
|
|
|
|
|
|
- arr.push({
|
|
|
- url: data.data.absolutelyPath,
|
|
|
- FilePath: data.data.relativePath,
|
|
|
- deletable: true
|
|
|
- })
|
|
|
- let file = data.data.relativePath.split('/')
|
|
|
- annexPaths.push({
|
|
|
- url: data.data.relativePath,
|
|
|
- type: 'image',
|
|
|
- name: file[file.length - 1],
|
|
|
- createTime: util.formatDataTime(new Date())
|
|
|
- })
|
|
|
- _this.setData({
|
|
|
- fileList: arr,
|
|
|
- annexPaths: annexPaths
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 输入事件监听
|
|
|
- * @author : 王英杰
|
|
|
- * @date : 2023年9月12日
|
|
|
- */
|
|
|
- changeField(e) {
|
|
|
- let key = e.currentTarget.dataset.key
|
|
|
- let form = this.data.form
|
|
|
- form[key] = e.detail
|
|
|
- this.setData({
|
|
|
- form,
|
|
|
- })
|
|
|
+ console.log("save", this.data.params);
|
|
|
+ return params
|
|
|
},
|
|
|
/**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
+ * @desc : 保存数据服务
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
*/
|
|
|
- onLoad(options) {
|
|
|
- if (options.item) {
|
|
|
- let item = JSON.parse(decodeURIComponent(options.item))
|
|
|
- this.setData({item})
|
|
|
- let param = {
|
|
|
- outId: item.outId,
|
|
|
- }
|
|
|
+ saveData() {
|
|
|
+ if (this.data.itemData.outStatus == Constants.outStatus.outBounding) {
|
|
|
+ return this.excute(this.data.service, this.data.service.otheroutBoundInsert , this.data.params)
|
|
|
+ } else {
|
|
|
+ wx.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ loadInit() {
|
|
|
+ let contentObj = {}
|
|
|
+ let cardList = []
|
|
|
|
|
|
- let form = {
|
|
|
- "addressArea": null,
|
|
|
- "addressFull": "辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1",
|
|
|
- "addressGcj02": null,
|
|
|
- "addressName": "沈阳市浑南区人民政府(新聪街西)",
|
|
|
- "addressNo": "1",
|
|
|
- "ageComposition": null,
|
|
|
- "ageCompositionName": null,
|
|
|
- "annexPaths": null,
|
|
|
- "ascpId": 29039,
|
|
|
- "ascpName": null,
|
|
|
- "categoryQuantity": 1,
|
|
|
- "contactName": null,
|
|
|
- "deliveryPhone": "",
|
|
|
- "contractNo": "",
|
|
|
- "cpId": 20834,
|
|
|
- "customerFrom": 28,
|
|
|
- "customerId": 3515,
|
|
|
- "customerName": "XIAO6",
|
|
|
- "customerPhone": "14132141212",
|
|
|
- "decisionMaker": null,
|
|
|
- "decisionMakerName": null,
|
|
|
- "deliveryDate": null,
|
|
|
- "deliveryTime": "2023-11-01 16:06:41",
|
|
|
- "deliveryType": null,
|
|
|
- "deliveryTypeName": "仓库送货",
|
|
|
- "deliveryUser": null,
|
|
|
- "deliveryUserName": null,
|
|
|
- "docCode": null,
|
|
|
- "doneTime": "2023-11-01 16:09:18",
|
|
|
- "doneUser": 643,
|
|
|
- "doneUserName": null,
|
|
|
- "erpOutNo": null,
|
|
|
- "erpPushResult": null,
|
|
|
- "erpPushStatus": null,
|
|
|
- "erpPushStatusName": null,
|
|
|
- "fitupStyle": null,
|
|
|
- "fitupStyleName": null,
|
|
|
- "fitupType": 88,
|
|
|
- "fitupTypeName": "精装升级",
|
|
|
- "flgAllowReverse": true,
|
|
|
- "flgAllowTodone": true,
|
|
|
- "flgToErp": false,
|
|
|
- "flgValid": true,
|
|
|
- "fromName": "自然进店",
|
|
|
- "hgcrmPushResult": null,
|
|
|
- "hgcrmPushStatus": null,
|
|
|
- "hgcrmPushStatusName": null,
|
|
|
- "houseType": null,
|
|
|
- "houseTypeName": null,
|
|
|
- "installUser": null,
|
|
|
- "installUserName": null,
|
|
|
- "makingDate": null,
|
|
|
- "makingTime": "2023-11-01 16:09:18",
|
|
|
- "makingUser": 643,
|
|
|
- "makingUserName": null,
|
|
|
- "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
|
|
|
- "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
|
|
|
- "opCreateTime": "2023-11-01 16:09:18",
|
|
|
- "opCreateTimeEnd": null,
|
|
|
- "opCreateTimeStart": null,
|
|
|
- "opCreateUserId": 643,
|
|
|
- "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.187.79\"}",
|
|
|
- "opTimestamp": "2023-11-01 16:09:19",
|
|
|
- "opUpdateTime": "2023-11-01 16:09:18",
|
|
|
- "opUpdateUserId": 643,
|
|
|
- "orderAnnexPaths": [],
|
|
|
- "orderId": 8794,
|
|
|
- "orderNo": "SA-0726-555-202311010KKI",
|
|
|
- "orderOutItemResponseList": [
|
|
|
+ if (this.data.item.outType == Constants.outType.sale) {
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: mixins.$t('saleOutBound'),
|
|
|
+ })
|
|
|
+ cardList = [{
|
|
|
+ name: 'main',
|
|
|
+ title: mixins.$t('outBoundInfo'),
|
|
|
+ }, {
|
|
|
+ name: 'items',
|
|
|
+ title: mixins.$t('goodsDetail'),
|
|
|
+ chooseGoodsFlag: '',
|
|
|
+ itemAmt: '',
|
|
|
+ displayNum: 2
|
|
|
+ }, {
|
|
|
+ name: 'other',
|
|
|
+ title: mixins.$t('otherInfo')
|
|
|
+ }]
|
|
|
+ contentObj = {
|
|
|
+ main: [
|
|
|
+ {
|
|
|
+ code: 'staffId',
|
|
|
+ name: 'staffName',
|
|
|
+ title: mixins.$t('responsiblePerson'),
|
|
|
+ type: 'choose',
|
|
|
+ required: true,
|
|
|
+ urlKey: 'chooseStaff'
|
|
|
+ }, {
|
|
|
+ code: 'orgId',
|
|
|
+ name: 'orgName',
|
|
|
+ title: mixins.$t('orgId'),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'chooseOrg'
|
|
|
+ },
|
|
|
{
|
|
|
- "barcodeList": [],
|
|
|
- "bomSkuId": null,
|
|
|
- "brandName": "恒洁卫浴",
|
|
|
- "canOutQuantity": 1,
|
|
|
- "cpId": 20834,
|
|
|
- "decimalPlaces": null,
|
|
|
- "entryGoingAmount": null,
|
|
|
- "erpOutItemId": null,
|
|
|
- "erpOutNo": null,
|
|
|
- "flgNonStandardType": null,
|
|
|
- "flgNonStdType": null,
|
|
|
- "flgScanCode": 0,
|
|
|
- "flgValid": true,
|
|
|
- "iconPathType": null,
|
|
|
- "iconThumPath": null,
|
|
|
- "itemId": 2409,
|
|
|
- "ivtId": 176,
|
|
|
- "ivtQty": 2,
|
|
|
- "ivtUsableQty": 0,
|
|
|
- "nonStandardArea": null,
|
|
|
- "nonStandardCode": "",
|
|
|
- "nonStdCode": "",
|
|
|
- "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
|
|
|
- "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
|
|
|
- "opCreateTime": "2023-11-01 16:09:18",
|
|
|
- "opCreateUserId": 643,
|
|
|
- "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.187.79\"}",
|
|
|
- "opTimestamp": "2023-11-01 16:09:25",
|
|
|
- "opUpdateTime": "2023-11-01 16:09:18",
|
|
|
- "opUpdateUserId": 643,
|
|
|
- "orderAmount": 0,
|
|
|
- "orderId": 8794,
|
|
|
- "orderItemId": 28131,
|
|
|
- "orderNo": null,
|
|
|
- "orderPriceSale": 0,
|
|
|
- "orderQuantity": 1,
|
|
|
- "originalDocumentNo": null,
|
|
|
- "originalDocumentType": null,
|
|
|
- "originalOutGoingAmount": 0,
|
|
|
- "originalOutGoingQuantity": 1,
|
|
|
- "outAmount": 0,
|
|
|
- "outDate": null,
|
|
|
- "outGoingAmount": 0,
|
|
|
- "outGoingQty": null,
|
|
|
- "outGoingQuantity": 1,
|
|
|
- "outId": 1312,
|
|
|
- "outQuantity": 1,
|
|
|
- "outStatus": 3,
|
|
|
- "outStatusName": null,
|
|
|
- "refCostAmt": null,
|
|
|
- "refCostPrice": null,
|
|
|
- "rejectAmount": 0,
|
|
|
- "rejectId": null,
|
|
|
- "rejectItemId": null,
|
|
|
- "rejectQuantity": 0,
|
|
|
- "remarks": null,
|
|
|
- "skuCode": "201000503N9000",
|
|
|
- "skuId": 9619320,
|
|
|
- "skuModel": "201000503N9000",
|
|
|
- "skuName": "分水阀芯\\提拉开关\\Φ=20.1",
|
|
|
- "skuSpecs": "102",
|
|
|
- "skuType": 0,
|
|
|
- "skuTypeName": "配件\\五金类配件",
|
|
|
- "skuVolume": null,
|
|
|
- "skuWeight": null,
|
|
|
- "soutId": null,
|
|
|
- "soutItemId": null,
|
|
|
- "specsList": [],
|
|
|
- "specsName": "五金类配件",
|
|
|
- "specsValues": null,
|
|
|
- "spuId": null,
|
|
|
- "titleTag": "HEGII",
|
|
|
- "unitName": null,
|
|
|
- "usableQty": 1,
|
|
|
- "whId": 146,
|
|
|
- "whName": "怀化易尚国际装饰仓"
|
|
|
- }
|
|
|
+ code: 'outDate',
|
|
|
+ name: 'outDate',
|
|
|
+ type: 'date',
|
|
|
+ },
|
|
|
],
|
|
|
- "orgId": 30883,
|
|
|
- "orgName": "辰溪县金海店",
|
|
|
- "outDate": "2023-11-01",
|
|
|
- "outId": 1312,
|
|
|
- "outKind": "出库类型-销售",
|
|
|
- "outKindName": null,
|
|
|
- "outNo": "WO-0726-555-202311010KKK",
|
|
|
- "outObjectId": null,
|
|
|
- "outObjectName": null,
|
|
|
- "outObjectType": null,
|
|
|
- "outReason": null,
|
|
|
- "outReasonName": null,
|
|
|
- "outServiceType": null,
|
|
|
- "outStatus": 3,
|
|
|
- "outStatusName": null,
|
|
|
- "rejectId": null,
|
|
|
- "rejectNo": null,
|
|
|
- "remarks": "",
|
|
|
- "remarksInside": null,
|
|
|
- "returnAddressFull": null,
|
|
|
- "returnContactName": null,
|
|
|
- "returnContactPhone": null,
|
|
|
- "sale1Id": null,
|
|
|
- "sale2EntryWhId": null,
|
|
|
- "sale2Id": null,
|
|
|
- "sale2OpeMode": "分销模式-自营",
|
|
|
- "salesChannel": 1,
|
|
|
- "salesChannelCode": "false",
|
|
|
- "serviceType": 1,
|
|
|
- "serviceTypeName": "送安一体",
|
|
|
- "soutId": null,
|
|
|
- "staffId": 38,
|
|
|
- "staffName": "姜永辉",
|
|
|
- "sumAmount": null,
|
|
|
- "sumEntryGoingAmount": null,
|
|
|
- "sumEntryGoingQuantity": null,
|
|
|
- "sumOutAmount": 0,
|
|
|
- "sumOutGoingAmount": 0,
|
|
|
- "sumOutGoingQuantity": 1,
|
|
|
- "sumOutQuantity": 1,
|
|
|
- "sumQuantity": 1,
|
|
|
- "sumRejectAmount": null,
|
|
|
- "sumRejectQuantity": null,
|
|
|
- "supplierId": null,
|
|
|
- "supplierName": null,
|
|
|
- "toiletCount": 9,
|
|
|
- "toiletCountName": null
|
|
|
+ items: [{
|
|
|
+ code: 'sumQuantity',
|
|
|
+ name: 'collectName',
|
|
|
+ type: 'drop',
|
|
|
+ required: true,
|
|
|
+ dropType: 'collect',
|
|
|
+
|
|
|
+ }, {
|
|
|
+ code: 'sumAmount',
|
|
|
+ type: 'number',
|
|
|
+ title: '收款金额',
|
|
|
+ required: true
|
|
|
+ }],
|
|
|
+
|
|
|
+ other: [{
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ title: '备注'
|
|
|
+ }, {
|
|
|
+ code: 'file',
|
|
|
+ type: 'uploader',
|
|
|
+ title: '附件'
|
|
|
+ }]
|
|
|
}
|
|
|
- let goodsList = [
|
|
|
- {
|
|
|
- "barcodeList": [],
|
|
|
- "bomSkuId": null,
|
|
|
- "brandName": "恒洁卫浴",
|
|
|
- "canOutQuantity": 1,
|
|
|
- "cpId": 20834,
|
|
|
- "decimalPlaces": null,
|
|
|
- "entryGoingAmount": null,
|
|
|
- "erpOutItemId": null,
|
|
|
- "erpOutNo": null,
|
|
|
- "flgNonStandardType": null,
|
|
|
- "flgNonStdType": null,
|
|
|
- "flgScanCode": 0,
|
|
|
- "flgValid": true,
|
|
|
- "iconPathType": null,
|
|
|
- "iconThumPath": null,
|
|
|
- "itemId": 2409,
|
|
|
- "ivtId": 176,
|
|
|
- "ivtQty": 2,
|
|
|
- "ivtUsableQty": 0,
|
|
|
- "nonStandardArea": null,
|
|
|
- "nonStandardCode": "",
|
|
|
- "nonStdCode": "",
|
|
|
- "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
|
|
|
- "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
|
|
|
- "opCreateTime": "2023-11-01 16:09:18",
|
|
|
- "opCreateUserId": 643,
|
|
|
- "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.187.79\"}",
|
|
|
- "opTimestamp": "2023-11-01 16:09:25",
|
|
|
- "opUpdateTime": "2023-11-01 16:09:18",
|
|
|
- "opUpdateUserId": 643,
|
|
|
- "orderAmount": 0,
|
|
|
- "orderId": 8794,
|
|
|
- "orderItemId": 28131,
|
|
|
- "orderNo": null,
|
|
|
- "orderPriceSale": 0,
|
|
|
- "orderQuantity": 1,
|
|
|
- "originalDocumentNo": null,
|
|
|
- "originalDocumentType": null,
|
|
|
- "originalOutGoingAmount": 0,
|
|
|
- "originalOutGoingQuantity": 1,
|
|
|
- "outAmount": 0,
|
|
|
- "outDate": null,
|
|
|
- "outGoingAmount": 0,
|
|
|
- "outGoingQty": null,
|
|
|
- "outGoingQuantity": 1,
|
|
|
- "outId": 1312,
|
|
|
- "outQuantity": 1,
|
|
|
- "outStatus": 3,
|
|
|
- "outStatusName": null,
|
|
|
- "refCostAmt": null,
|
|
|
- "refCostPrice": null,
|
|
|
- "rejectAmount": 0,
|
|
|
- "rejectId": null,
|
|
|
- "rejectItemId": null,
|
|
|
- "rejectQuantity": 0,
|
|
|
- "remarks": null,
|
|
|
- "skuCode": "201000503N9000",
|
|
|
- "skuId": 9619320,
|
|
|
- "skuModel": "201000503N9000",
|
|
|
- "skuName": "分水阀芯\\提拉开关\\Φ=20.1",
|
|
|
- "skuSpecs": "102",
|
|
|
- "skuType": 0,
|
|
|
- "skuTypeName": "配件\\五金类配件",
|
|
|
- "skuVolume": null,
|
|
|
- "skuWeight": null,
|
|
|
- "soutId": null,
|
|
|
- "soutItemId": null,
|
|
|
- "specsList": [],
|
|
|
- "specsName": "五金类配件",
|
|
|
- "specsValues": null,
|
|
|
- "spuId": null,
|
|
|
- "titleTag": "HEGII",
|
|
|
- "unitName": null,
|
|
|
- "usableQty": 1,
|
|
|
- "whId": 146,
|
|
|
- "whName": "怀化易尚国际装饰仓"
|
|
|
- }
|
|
|
- ]
|
|
|
- let annexPaths = []
|
|
|
- let fileList = []
|
|
|
this.setData({
|
|
|
- form:form,
|
|
|
- goodsList:goodsList,
|
|
|
- annexPaths,
|
|
|
- fileList:fileList
|
|
|
+ contentObj,
|
|
|
+ cardList,
|
|
|
})
|
|
|
- if(form.orderOutItemResponseList){
|
|
|
- this.countGoodsList(form.orderOutItemResponseList)
|
|
|
- }
|
|
|
- // api.request(Constants.SALES_OUTBOUND + "select_sale_out_by_out_id", 'POST', param).then(res => {
|
|
|
- // this.setData({
|
|
|
- // loading: false
|
|
|
- // })
|
|
|
- // if (res.data.code === 200) {
|
|
|
- // let detailData = res.data.data
|
|
|
- // detailData.serviceType = 1, //服务类型id
|
|
|
- // detailData.serviceTypeName = '送安一体', //服务类型name
|
|
|
- // detailData.staffId = app.globalData.user.userId
|
|
|
- // detailData.staffName = app.globalData.user.userName
|
|
|
- // detailData.orgId = app.globalData.user.orgId
|
|
|
- // detailData.orgName = app.globalData.user.orgName
|
|
|
- // // detailData.orgName = app.globalData.user.orgName
|
|
|
- // let sum = 0
|
|
|
- // detailData.orderOutItemResponseList.forEach(element => {
|
|
|
- // sum += element.outQuantity
|
|
|
- // });
|
|
|
- // detailData.sumQuantity = sum
|
|
|
- // let annexPaths = res.data.data.annexPaths || []
|
|
|
- // let fileList = []
|
|
|
- // if(annexPaths){ //把查出的附件 赋值给当前页面
|
|
|
- // annexPaths.forEach(function(item, index, array) {
|
|
|
- // fileList.push({"FilePath":item.url,"deletable":true,url:'https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/'+item.url})
|
|
|
- // })
|
|
|
- // }
|
|
|
- // this.setData({
|
|
|
- // form:detailData,
|
|
|
- // goodsList:detailData.orderOutItemResponseList,
|
|
|
- // annexPaths,
|
|
|
- // fileList:fileList
|
|
|
- // })
|
|
|
- // if(detailData.orderOutItemResponseList){
|
|
|
- // this.countGoodsList(detailData.orderOutItemResponseList)
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
- // })
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- /**计算商品相关的属性 */
|
|
|
- countGoodsList(List) {
|
|
|
- let goodsList = []
|
|
|
- let sumGoodsAmount = 0
|
|
|
- let sumEntryGoingQuantity = 0
|
|
|
- //
|
|
|
- List.forEach(function (res, index) {
|
|
|
- if (res.bomItems) { //bom品进入
|
|
|
- res.bomItems.forEach(item => {
|
|
|
- item.itemQuantity = item.bomItemQuantity //入库中数量
|
|
|
- item.entryGoingQuantity = item.bomItemQuantity //入库中数量
|
|
|
- item.whId = res.whId //仓库
|
|
|
- item.whName = res.whName //仓库
|
|
|
- item.orderPriceSale = item.orderPriceSale ? item.orderPriceSale : 0 //入库单价
|
|
|
- item.entryGoingAmount = item.entryGoingQuantity * parseFloat(item.orderPriceSale)
|
|
|
- sumGoodsAmount += item.entryGoingAmount
|
|
|
- sumEntryGoingQuantity += item.entryGoingQuantity
|
|
|
- goodsList.push(item)
|
|
|
- })
|
|
|
- } else { //正常品进入
|
|
|
- res.entryGoingQuantity = res.itemQuantity //入库中数量
|
|
|
- res.orderPriceSale = res.orderPriceSale ? res.orderPriceSale : 0 //入库单价
|
|
|
- res.entryGoingAmount = res.entryGoingQuantity * parseFloat(res.orderPriceSale);
|
|
|
- sumGoodsAmount += res.entryGoingAmount
|
|
|
- sumEntryGoingQuantity += res.entryGoingQuantity
|
|
|
- goodsList.push(res)
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- let form = this.data.form
|
|
|
- form.sumEntryGoingAmount = sumGoodsAmount
|
|
|
- form.sumEntryGoingQuantity = sumEntryGoingQuantity
|
|
|
- form.categoryQuantity = common.getCategoryQuantity(goodsList); // 计算品类数
|
|
|
- form.sumQuantity = goodsList.length
|
|
|
- this.setData({
|
|
|
- form: form,
|
|
|
-
|
|
|
+ } else if (this.data.item.outType == Constants.outType.other) {
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: mixins.$t('otherOutWh'),
|
|
|
})
|
|
|
- this.setData({
|
|
|
- goodsList: goodsList,
|
|
|
- })
|
|
|
- },
|
|
|
+ cardList = [{
|
|
|
+ name: 'main',
|
|
|
+ title: mixins.$t('outBoundInfo'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'items',
|
|
|
+ title: mixins.$t('goodsDetail'),
|
|
|
+ info: '(' + mixins.$t('warehousingProcessing') + ')',
|
|
|
+ color: '#E4002B',
|
|
|
+ displayNum: 2
|
|
|
+ }, {
|
|
|
+ name: 'other',
|
|
|
+ title: mixins.$t('otherInfo')
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ contentObj = {
|
|
|
+ main: [
|
|
|
+ {
|
|
|
+ code: 'outReason',
|
|
|
+ name: 'outReasonName',
|
|
|
+ type: 'choose',
|
|
|
+ required: true,
|
|
|
+ urlKey: 'chooseStorageInReason'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'staffId',
|
|
|
+ name: 'staffName',
|
|
|
+ title: mixins.$t('responsiblePerson'),
|
|
|
+ type: 'choose',
|
|
|
+ required: true,
|
|
|
+ urlKey: 'chooseStaff'
|
|
|
+ }, {
|
|
|
+ code: 'orgId',
|
|
|
+ name: 'orgName',
|
|
|
+ title: mixins.$t('orgId'),
|
|
|
+ type: 'choose',
|
|
|
+ required: true,
|
|
|
+ urlKey: 'chooseOrg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'outDate',
|
|
|
+ name: 'outDate',
|
|
|
+ type: 'date',
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'outObject',
|
|
|
+ name: 'outObjectName',
|
|
|
+ title: mixins.$t('outObject'),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'chooseStorageObject'
|
|
|
+ },
|
|
|
+ ],
|
|
|
|
|
|
- /** 转日期格式为 yy-mm-dd*/
|
|
|
- formatDate(dateString) {
|
|
|
- var date = new Date(dateString);
|
|
|
- var year = date.getFullYear();
|
|
|
- var month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
|
- var day = ("0" + date.getDate()).slice(-2);
|
|
|
- return year + "-" + month + "-" + day;
|
|
|
- },
|
|
|
- formatDate_hours_minutes_seconds(timestamp) {
|
|
|
- // 创建一个新的Date对象
|
|
|
- var date = new Date(timestamp);
|
|
|
-
|
|
|
- // 获取年、月、日、时、分、秒
|
|
|
- var year = date.getFullYear();
|
|
|
- var month = ('0' + (date.getMonth() + 1)).slice(-2);
|
|
|
- var day = ('0' + date.getDate()).slice(-2);
|
|
|
- var hours = ('0' + date.getHours()).slice(-2);
|
|
|
- var minutes = ('0' + date.getMinutes()).slice(-2);
|
|
|
- var seconds = ('0' + date.getSeconds()).slice(-2);
|
|
|
-
|
|
|
- // 组合成YY-MM-DD HH:mm:ss格式
|
|
|
- return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc :销售出库回退
|
|
|
- * @author : 王英杰
|
|
|
- * @date : 2023年8月25日
|
|
|
- */
|
|
|
- deal(e) {
|
|
|
- if(this.data.loading){
|
|
|
- return
|
|
|
- }
|
|
|
- let form = this.data.form
|
|
|
- let param = {
|
|
|
- sale1Id: form.sale1Id,
|
|
|
- sale2Id: form.sale2Id,
|
|
|
- cpId: form.cpId,
|
|
|
- ascpId: form.ascpId,
|
|
|
- }
|
|
|
- param.outId = this.data.item.outId
|
|
|
- this.setData({
|
|
|
- loading: true
|
|
|
- })
|
|
|
- api.request(Constants.SALES_OUTBOUND + 'sale_out_back_no_erp', 'POST', param).then(res => {
|
|
|
+ items: [{
|
|
|
+ code: 'collectType',
|
|
|
+ name: 'collectName',
|
|
|
+ type: 'drop',
|
|
|
+ required: true,
|
|
|
+ dropType: 'collect'
|
|
|
+ }, {
|
|
|
+ code: 'collectAmount',
|
|
|
+ type: 'number',
|
|
|
+ title: '收款金额',
|
|
|
+ required: true
|
|
|
+ }],
|
|
|
+
|
|
|
+ other: [{
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ title: '备注',
|
|
|
+ readonly: false
|
|
|
+ }, {
|
|
|
+ code: 'file',
|
|
|
+ type: 'uploader',
|
|
|
+ title: '附件'
|
|
|
+ }]
|
|
|
+ }
|
|
|
this.setData({
|
|
|
- loading: false
|
|
|
+ contentObj,
|
|
|
+ cardList,
|
|
|
})
|
|
|
+ } else {
|
|
|
+ cardList = [{
|
|
|
+ name: 'main',
|
|
|
+ title: mixins.$t('outBoundInfo'),
|
|
|
+ }, {
|
|
|
+ name: 'items',
|
|
|
+ title: mixins.$t('goodsDetail'),
|
|
|
+ chooseGoodsFlag: '',
|
|
|
+ itemAmt: '',
|
|
|
+ displayNum: 2
|
|
|
+ }, {
|
|
|
+ name: 'other',
|
|
|
+ title: mixins.$t('otherInfo')
|
|
|
+ }]
|
|
|
+ contentObj = {
|
|
|
+ main: [
|
|
|
+ {
|
|
|
+ code: 'staffId',
|
|
|
+ name: 'staffName',
|
|
|
+ title: mixins.$t('responsiblePerson'),
|
|
|
+ type: 'choose',
|
|
|
+ required: true,
|
|
|
+ urlKey: 'chooseStaff'
|
|
|
+ }, {
|
|
|
+ code: 'orgId',
|
|
|
+ name: 'orgName',
|
|
|
+ title: mixins.$t('orgId'),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'chooseOrg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'outDate',
|
|
|
+ name: 'outDate',
|
|
|
+ type: 'date',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ items: [{
|
|
|
+ code: 'sumQuantity',
|
|
|
+ name: 'collectName',
|
|
|
+ type: 'drop',
|
|
|
+ required: true,
|
|
|
+ dropType: 'collect',
|
|
|
|
|
|
- if (res.data.code === 200) {
|
|
|
- wx.navigateBack({
|
|
|
- delta: 1
|
|
|
- })
|
|
|
+ }, {
|
|
|
+ code: 'sumAmount',
|
|
|
+ type: 'number',
|
|
|
+ title: '收款金额',
|
|
|
+ required: true
|
|
|
+ }],
|
|
|
|
|
|
+ other: [{
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ title: '备注'
|
|
|
+ }, {
|
|
|
+ code: 'file',
|
|
|
+ type: 'uploader',
|
|
|
+ title: '附件'
|
|
|
+ }]
|
|
|
}
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ contentObj,
|
|
|
+ cardList,
|
|
|
+ })
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: mixins.$t('purReturnOutBound'),
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
- // 小编辑保存
|
|
|
- submit(e) {
|
|
|
- // 校验
|
|
|
- let flag = this.beforeSaveCheck(e.type)
|
|
|
- let that = this
|
|
|
- if (flag) {
|
|
|
- let objItem = this.data.form
|
|
|
- //保存前校验
|
|
|
- let param = { //取部门的这四个属性
|
|
|
- sale1Id: objItem.sale1Id,
|
|
|
- sale2Id: objItem.sale2Id,
|
|
|
- cpId: objItem.cpId,
|
|
|
- ascpId: objItem.ascpId,
|
|
|
- }
|
|
|
- param.outId = objItem.outId
|
|
|
- param.outNo = objItem.outNo
|
|
|
- param.customerId = objItem.customerId
|
|
|
- param.customerName = objItem.customerName
|
|
|
- param.customerPhone = objItem.customerPhone
|
|
|
- param.contactName = objItem.contactName
|
|
|
- param.deliveryPhone = objItem.deliveryPhone
|
|
|
- param.salesChannel = objItem.salesChannel
|
|
|
- param.orgId = objItem.orgId //部门
|
|
|
- param.orderId = objItem.orderId
|
|
|
- param.orderNo = objItem.orderNo
|
|
|
- param.outStatus = objItem.outStatus //2:出库中 3:已出库 4:出库暂存
|
|
|
- param.sumOutGoingQuantity = objItem.sumOutGoingQuantity //合计出库中数量
|
|
|
- param.sumOutGoingAmount = objItem.sumOutGoingAmount //合计出库中金额
|
|
|
- param.sumOutQuantity = objItem.autoOutFlg?objItem.sumOutGoingQuantity:0 //合计已出库数量
|
|
|
- param.sumOutAmount = objItem.autoOutFlg?objItem.sumOutGoingAmount:0 //合计已出库金额
|
|
|
- param.remarks = objItem.remarks||"" //备注
|
|
|
- param.cpId = objItem.cpId //账套
|
|
|
- param.sale1Id = objItem.sale1Id //经销商ID
|
|
|
- param.sale2Id = objItem.sale2Id //分销商ID
|
|
|
- param.ascpId = objItem.ascpId //所属公司ID
|
|
|
- param.supplierId = "" //供应商ID
|
|
|
- param.outKind = "出库类型-销售" //出库类型
|
|
|
- param.outDate = this.formatDate(Date.now()) //出库日期
|
|
|
- param.categoryQuantity = objItem.categoryQuantity //品类数量
|
|
|
- param.makingUser = app.globalData.user.userId //制单人
|
|
|
- param.makingTime = this.formatDate_hours_minutes_seconds(Date.now())//制单时间
|
|
|
- param.doneUser = app.globalData.user.userId //办理人
|
|
|
- param.doneTime = this.formatDate_hours_minutes_seconds(Date.now()) //办理时间
|
|
|
- param.salesChannelCode = objItem.salesChannelCode //销售渠道编码
|
|
|
- param.deliveryUser = objItem.deliveryUser||"" //送货员
|
|
|
- param.installUser = objItem.installUser||"" //安装员
|
|
|
- param.remarksInside = "" //内部备注
|
|
|
- param.orderOutItemVOList = this.data.goodsList //商品明细
|
|
|
- param.allEdit = false //大编辑
|
|
|
- // 保存和暂存的 扫码数据 全部扫码信息
|
|
|
- param.barcodeList = this.data.barcodeList || []
|
|
|
- param.annexPaths = this.data.annexPaths || []
|
|
|
- param.orderOutItemDeleteList = []
|
|
|
- param.remarksInside = objItem.remarksInside||"" //内部备注
|
|
|
- api.request(Constants.SALES_OUTBOUND + 'sale_out_update_no_erp', 'POST', param).then(res => {
|
|
|
- this.setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
|
|
|
- if (res.data.code === 200) {
|
|
|
- wx.navigateBack({
|
|
|
- delta: 1
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad: function (options) {
|
|
|
|
|
|
- }
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
})
|