diff --git a/components/count-down/index.js b/components/count-down/index.js index 28fe551..a60ca79 100644 --- a/components/count-down/index.js +++ b/components/count-down/index.js @@ -49,33 +49,33 @@ VantComponent({ this.remain = this.data.time; this.setRemain(this.remain); if (this.data.autoStart) { - this.start(); + this.start() } }, tick() { if (this.data.millisecond) { - this.microTick(); + this.microTick() } else { - this.macroTick(); + this.macroTick() } }, microTick() { this.tid = simpleTick(() => { this.setRemain(this.getRemain()); if (this.remain !== 0) { - this.microTick(); + this.microTick() } }); }, macroTick() { this.tid = simpleTick(() => { - const remain = this.getRemain(); + const remain = this.getRemain() if (!isSameSecond(remain, this.remain) || remain === 0) { - this.setRemain(remain); + this.setRemain(remain) } if (this.remain !== 0) { - this.macroTick(); + this.macroTick() } }); }, @@ -86,12 +86,12 @@ VantComponent({ this.remain = remain; const timeData = parseTimeData(remain); if (this.data.useSlot) { - this.$emit('change', timeData); + this.$emit('change', timeData) } this.setData({ formattedTime: parseFormat(this.data.format, timeData) }) if (remain === 0) { - this.pause(); - this.$emit('finish'); + this.pause() + this.$emit('finish') } } } diff --git a/pages/api/saas.js b/pages/api/saas.js index 6a26520..7e3d87c 100644 --- a/pages/api/saas.js +++ b/pages/api/saas.js @@ -10,11 +10,39 @@ const sconfig = { // *****************************************账户业务********************************************** const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product-line-token/by/login-token`, params, sconfig) const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, sconfig) -const getOrderList = (params) => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, params, sconfig) +const getOrderList = (params) => mGet(`/ztb-factory/factory-customer/get/order-list`, params, sconfig) +const getOrderInfo = (id) => mGet(`/ztb-factory/factory-customer/get/order-detail/${id}`, null, sconfig) +const pricingOrder = (params) => mPost(`/ztb-factory/factory/edit/order-price`, params, sconfig) +const cancelOrder = (params) => mPost(`/ztb-factory/factory/cancel/order`, params, sconfig) +const checkingOrder = (params) => mPost(`/ztb-factory/factory/edit/order-status`, params, sconfig) +const createOrder = (params) => mPost(`/ztb-factory/factory-customer/save/order`, params, sconfig) +const getFactoryOrderList = (status, params) => mGet(`/ztb-factory/factory/wechat-applet/get/order-list/${status}`, params, sconfig) +const getFactoryOrderInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/order-detail/${id}`, null, sconfig) +const getPaperPrice = (params) => mGet(`/ztb-factory/factory/get/product-price-list`, params, sconfig) +const savePaperPrice = (params) => mPost(`/ztb-factory/factory/save/product-price`, params, sconfig) +const updatePaperPrice = (params) => mPost(`/ztb-factory/factory/update/product-price`, params, sconfig) +const getCustomerList = (params) => mGet(`/ztb-factory/factory/wechat-applet/get/customer-list`, params, sconfig) +const editCustomer = (params) => mPost(`/ztb-factory/factory/edit/customer`, params, sconfig) +const deleteCustomer = (id) => mPost(`/ztb-factory/factory/delete/customer/${id}`, null, sconfig) +const getCustomerInfo = (id) => mPost(`/ztb-factory/factory/wechat-applet/get/customer-detail/${id}`, null, sconfig) export { sconfig, loginToken, getBaseInfo, - getOrderList + getFactoryOrderList, + getFactoryOrderInfo, + getOrderList, + getOrderInfo, + createOrder, + checkingOrder, + pricingOrder, + cancelOrder, + getPaperPrice, + savePaperPrice, + updatePaperPrice, + getCustomerList, + editCustomer, + deleteCustomer, + getCustomerInfo } \ No newline at end of file diff --git a/pages/enterprise/address-new/index.js b/pages/enterprise/address-new/index.js deleted file mode 100644 index a69cccf..0000000 --- a/pages/enterprise/address-new/index.js +++ /dev/null @@ -1,110 +0,0 @@ -// pages/enterprise/address-new/index.js -import { deleteAddress, saveAddress } from "../../api/user" -const util = require('../../../utils/util') -const region = require('../../../utils/area') -const storage = require('../../../utils/storage') -const event = require('../../../utils/event') -const app = getApp() - -Page({ - /** - * 页面的初始数据 - */ - data: { - id: null, - show: false, - areaList: region.default, - form: { - receiver:'', - receiverMobile:'', - detail:'', - isDefault: 0, - provinceId: '', - provinceName: '', - cityId: '', - cityName: '', - districtId: '', - districtName: '' - }, - requesting: false - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - if(options.id){ - this.setData({ id: Number(options.id)}) - } - var json = storage.get('gdw-address') - if(json){ - storage.remove('gdw-address') - var form = JSON.parse(json) - form.areaStr = form.provinceName + ' ' + form.cityName + ' ' + form.districtName - this.setData({ form: form}) - } - }, - showRegion: function(){ - if(this.data.disabled){ - return - } - this.setData({ show: true }) - }, - bindinput: function(e){ - this.data.form[e.target.id] = e.detail.value - }, - onChange: function({ detail }) { - // 需要手动对 checked 状态进行更新 - this.setData({ ['form.isDefault']: detail ? 1 : 0 }) - }, - onConfirm: function({ detail }){ - this.data.form.enterpriseId = app.accountInfo.enterpriseId - this.data.form.provinceId = detail.values[0].code - this.data.form.provinceName = detail.values[0].name - this.data.form.cityId = detail.values[1].code - this.data.form.cityName = detail.values[1].name - this.data.form.districtId = detail.values[2].code - this.data.form.districtName = detail.values[2].name - var areaStr = detail.values[0].name + ' ' + detail.values[1].name + ' ' + detail.values[2].name - this.setData({ show: false, ['form.areaStr']: areaStr }) - }, - deleteForm: function(){ - wx.showLoading({ title: '处理中', mask: true }) - deleteAddress(this.data.form.id).then(result => { - wx.hideLoading() - event.emit('EventMessage', { what: 40, desc: 'Address' }) - util.showBackToast('地址已删除') - }).catch(err => { - wx.hideLoading() - }) - }, - submitForm: function () { - if(util.isEmpty(this.data.form.receiver)){ - util.showToast('请输入联系人') - return - } - if(util.isEmpty(this.data.form.receiverMobile)){ - util.showToast('请输入联系电话') - return - } - if(util.isEmpty(this.data.form.districtId)){ - util.showToast('请选择所在地区') - return - } - if(util.isEmpty(this.data.form.detail)){ - util.showToast('请输入详细地址') - return - } - wx.showLoading({ title: '处理中', mask: true }) - saveAddress(this.data.form).then(result => { - wx.hideLoading() - event.emit('EventMessage', { what: 40, desc: 'Address' }) - util.showBackToast('添加成功') - }).catch(err => { - wx.hideLoading() - util.showToast(err) - }) - }, - onClose: function() { - this.setData({ show: false }) - } -}) \ No newline at end of file diff --git a/pages/enterprise/address-new/index.json b/pages/enterprise/address-new/index.json deleted file mode 100644 index 05ed41f..0000000 --- a/pages/enterprise/address-new/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "usingComponents": { - "van-switch": "/components/switch/index", - "van-popup": "/components/popup/index", - "van-area": "/components/area/index", - "van-button": "/components/button/index" - } -} \ No newline at end of file diff --git a/pages/enterprise/address-new/index.wxml b/pages/enterprise/address-new/index.wxml deleted file mode 100644 index b4d68f0..0000000 --- a/pages/enterprise/address-new/index.wxml +++ /dev/null @@ -1,38 +0,0 @@ - - - {{ id ? '编辑' : '新增' }}地址 - - - - - 收货人: - - - - 手机号码: - - - - 所在地区: - {{form.areaStr||'请选择所在地区'}} - - - - - 详细地址: - - - - - 设为默认地址: - - - - - 删除 - 保存 - - - - - diff --git a/pages/enterprise/address-new/index.wxss b/pages/enterprise/address-new/index.wxss deleted file mode 100644 index 4c495eb..0000000 --- a/pages/enterprise/address-new/index.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/enterprise/address-new/index.wxss */ \ No newline at end of file diff --git a/pages/enterprise/address/index.js b/pages/enterprise/address/index.js deleted file mode 100644 index d7a5b2a..0000000 --- a/pages/enterprise/address/index.js +++ /dev/null @@ -1,81 +0,0 @@ -// pages/enterprise/address/index.js -import Dialog from '../../../components/dialog/dialog' -import { getAddressList, deleteAddress } from "../../api/user" -const event = require('../../../utils/event') -const util = require('../../../utils/util') -const storage = require('../../../utils/storage') - -Page({ - /** - * 页面的初始数据 - */ - data: { - type: 0, - addressList: [] - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - if(options.type){ - this.data.type = Number(options.type) - } - event.on('EventMessage', this, this.onEvent) - this.fetchAddressList() - }, - onEvent: function (message) { - if (message.what == 40) { - this.fetchAddressList() - } - }, - fetchAddressList: function(){ - wx.showLoading({ title: '加载中', mask: true }) - // /product/{id}产品详情 - getAddressList().then(result => { - wx.hideLoading() - this.setData({ addressList: result.data}) - }).catch(err => { - wx.hideLoading() - }) - }, - lookItem: function(e){ - var item = this.data.addressList[e.currentTarget.dataset.index] - if(this.data.type == 1){ - event.emit('EventMessage', { what: 41, obj: item, desc: 'Address' }) - wx.navigateBack() - } else { - storage.put('gdw-address', JSON.stringify(item), 1) - wx.navigateTo({ url: '/pages/enterprise/address-new/index?id=' + item.id }) - } - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - addAddress: function (e) { - if(e.currentTarget.dataset.index >= 0){ - var item = this.data.addressList[e.currentTarget.dataset.index] - storage.put('gdw-address', JSON.stringify(item), 1) - wx.navigateTo({ url: '/pages/enterprise/address-new/index?id=' + item.id }) - } else { - wx.navigateTo({ url: '/pages/enterprise/address-new/index' }) - } - }, - delAddress: function(e){ - var item = this.data.addressList[e.currentTarget.dataset.index] - var that = this - Dialog.confirm({ title: '温馨提示', message: '确定删除该地址?' }).then(() => { - wx.showLoading({ title: '处理中', mask: true }) - deleteAddress(item.id).then(result => { - wx.hideLoading() - util.showToast('地址已删除') - that.fetchAddressList() - }).catch(err => { - console.log(err) - wx.hideLoading() - }) - }) - }, - onUnload: function(){ - event.remove('EventMessage', this) - } -}) \ No newline at end of file diff --git a/pages/enterprise/address/index.json b/pages/enterprise/address/index.json deleted file mode 100644 index c9bdfd2..0000000 --- a/pages/enterprise/address/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "usingComponents": { - "van-cell": "/components/cell/index", - "van-checkbox": "/components/checkbox/index", - "van-button": "/components/button/index", - "van-dialog": "/components/dialog/index" - } -} \ No newline at end of file diff --git a/pages/enterprise/address/index.wxml b/pages/enterprise/address/index.wxml deleted file mode 100644 index eec6d6a..0000000 --- a/pages/enterprise/address/index.wxml +++ /dev/null @@ -1,32 +0,0 @@ - - - 地址管理 - - - - - - - {{item.receiver}} - {{item.receiverMobile}} - - {{item.provinceName + item.cityName + item.districtName + item.detail}} - - - - - - 已设为默认 - - - 删除 - 编辑 - - - - - - 新增地址 - - - \ No newline at end of file diff --git a/pages/enterprise/address/index.wxss b/pages/enterprise/address/index.wxss deleted file mode 100644 index d84f111..0000000 --- a/pages/enterprise/address/index.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/enterprise/address/index.wxss */ \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index 9812ca6..a19e08a 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -140,7 +140,7 @@ Page({ this.setData({ loginEnable: true }) } }, - onChange: function(e) { + onCountChange: function(e) { if(e.detail.minutes != 0){ return } diff --git a/pages/login/index.wxml b/pages/login/index.wxml index f5380db..53ba143 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -18,7 +18,7 @@ - + {{second}} diff --git a/pages/process/index.wxs b/pages/process/index.wxs index 7d865fd..3f4dc29 100644 --- a/pages/process/index.wxs +++ b/pages/process/index.wxs @@ -1,66 +1,31 @@ -function itemStatus(status) { - if(status == -1){ - return '待设计工序' - } else if(status == 0){ - return '生产中' +// 订单状态。0:待接单,10:待反馈, 1:待验货,2:待确认,23:待厂长审核 3:待付款,30:待运营审核,31:待会计审核 4:已完成,5:已取消,6:不通过 +function orderStatus(status) { + if(status == 0){ + return '待接单' + } else if(status == 10){ + return '待反馈' } else if(status == 1){ - return '待生产' + return '待验货' + } else if(status == 2){ + return '待确认' + } else if(status == 23){ + return '待厂长审核' } else if(status == 3){ - return '已完成' + return '待付款' + } else if(status == 30){ + return '待运营审核' + } else if(status == 31){ + return '待会计审核' } else if(status == 4){ - return '待分配' - } - return '' -} - -// 已完成:3;已发货:5;生成中:0 -function orderStatus(status, type) { - if(status == -1){ - return '待提交' - } else if(status == 0 || status == 4){ - if(type == 1){ - return '采购中' - } else { - return '进行中' - } - } else if(status == 3){ return '已完成' } else if(status == 5){ - return '' + return '已取消' } else if(status == 6){ - return '已终止' - } - return '' -} - -// 生产单状态:待生产:1;已完成:3;生产中:0;已终止:6 -function prodStatus(status) { - if(status == 1){ - return '待生产' - } else if(status == 0){ - return '生产中' - } else if(status == 3){ - return '已完成' - } else if(status == 6){ - return '已终止' - } - return '' -} - -function orderType(type) { - if(type == 0){ - return '加工件' - } else if(type == 1){ - return '物料' - } else if(type == 2){ - return '成品' + return '不通过' } return '' } module.exports = { - itemStatus: itemStatus, - orderStatus: orderStatus, - prodStatus: prodStatus, - orderType: orderType + orderStatus: orderStatus } \ No newline at end of file diff --git a/pages/process/index/index.js b/pages/process/index/index.js index df434a4..6b8a868 100644 --- a/pages/process/index/index.js +++ b/pages/process/index/index.js @@ -14,11 +14,11 @@ Component({ data: { height: app.globalData.safeFragmentHeight, tabList: [ - { status: 0, badge: 2, name: '定价', icon: '/assets/image/icon_pricing.png' }, - { status: 1, badge: 4, name: '过磅审核', icon: '/assets/image/icon_checking.png' }, - { status: 2, badge: '', name: '代付款', icon: '/assets/image/icon_payment.png' }, - { status: 3, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' }, - { status: 4, badge: '', name: '已关闭', icon: '/assets/image/icon_close.png' } + { status: 1, badge: 2, name: '定价', icon: '/assets/image/icon_pricing.png' }, + { status: 2, badge: 4, name: '过磅审核', icon: '/assets/image/icon_checking.png' }, + { status: 3, badge: '', name: '代付款', icon: '/assets/image/icon_payment.png' }, + { status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' }, + { status: 5, badge: '', name: '已关闭', icon: '/assets/image/icon_close.png' } ] }, lifetimes: { diff --git a/pages/process/index/index.wxml b/pages/process/index/index.wxml index 13b0813..0a71ca6 100644 --- a/pages/process/index/index.wxml +++ b/pages/process/index/index.wxml @@ -1,4 +1,4 @@ - + 工作台 @@ -51,7 +51,7 @@ - + \ No newline at end of file diff --git a/pages/process/order-check/index.js b/pages/process/order-check/index.js index 7ad5f4d..67e05ff 100644 --- a/pages/process/order-check/index.js +++ b/pages/process/order-check/index.js @@ -1,5 +1,8 @@ // pages/process/order-check/index.js import Dialog from '../../../components/dialog/dialog' +import { pricingOrder, cancelOrder, getFactoryOrderInfo, getPaperPrice} from "../../api/saas" +const event = require('../../../utils/event') +const util = require('../../../utils/util') const app = getApp() Page({ @@ -8,17 +11,32 @@ Page({ */ data: { safeBottom: app.globalData.safeBottom, - form: { - plateNumber: null - } + paperList: null, + form: null, + deductType: 1, + columns: [], + visible: false }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.setData({ - safeBottom: app.globalData.safeBottom - }) + if(options.id){ + wx.showLoading({ title: '正在获取', mask: true }) + getPaperPrice().then(result => { + this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + getFactoryOrderInfo(options.id).then(result => { + wx.hideLoading() + this.setData({ form: result.data }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + } }, showPlate: function (e) { this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard') @@ -30,7 +48,20 @@ Page({ } }, showCategory: function(){ - + this.setData({ visible: true }) + }, + onConfirm: function({ picker, value, index }){ + this.setData({ visible: false }) + }, + onHide: function(){ + this.setData({ visible: false }) + }, + changeDeductType: function(e){ + if(e.currentTarget.dataset.type == 1){ + this.setData({ deductType: e.currentTarget.dataset.type, [form.deductPercent]: null }) + } else { + this.setData({ deductType: e.currentTarget.dataset.type, [form.deductWeight]: null }) + } }, bindInput: function (e) { this.data.form[e.target.id] = e.detail.value @@ -40,19 +71,36 @@ Page({ this.setData({ ['form.isDefault']: detail ? 1 : 0 }) }, paddingOrder: function(){ - this.setData({ ['form.checking']: !this.data.form.checking }) + this.setData({ ['form.weighingType']: !this.data.form.weighingType }) }, cancelOrder: function(e){ Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { + wx.showLoading({ title: '处理中', mask: true }) + cancelOrder({ id: this.data.form.id }).then(result => { + wx.hideLoading() + util.showBackToast('订单已经删除') + event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + }) + }, + priceOrder: function(){ + wx.showLoading({ title: '处理中', mask: true }) + pricingOrder(this.data.form).then(result => { + wx.hideLoading() + util.showBackToast('定价成功') + event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) }) }, viewImage: function (e) { var imgList = [] - for (let index = 0; index < this.data.imgList.length; index++) { - if (this.data.imgList[index].indexOf('.mp4') >= 0) { - continue - } - imgList.push(this.data.imgList[index]) + for (let index = 0; index < this.data.form.preWeighingPicture.length; index++) { + imgList.push(this.data.this.data.form.preWeighingPicture[index].url) } wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) } diff --git a/pages/process/order-check/index.wxml b/pages/process/order-check/index.wxml index 7805737..dc19064 100644 --- a/pages/process/order-check/index.wxml +++ b/pages/process/order-check/index.wxml @@ -3,92 +3,99 @@ 定价详情 - - - - 客户姓名 - 客户姓名 - - - - - 车牌号码 - {{form.plateNumber || '请输入车牌号码'}} - - - - - - 废纸品类 - * + + + + + 客户姓名 + {{form.factoryCustomerName}} - 请选择废纸品类 - - - - - - - 单价(元/KG) - * + + + + 车牌号码 + {{form.plateNumber || '请输入车牌号码'}} - - - - - - - 扣重(KG) - * + + + + + 废纸品类 + * + + 请选择废纸品类 - - - - - - - 扣点(%) - * + + + + + + 单价(元/KG) + * + + - - - - - - 是否无皮过磅 - - - - - - - 毛重(KG) - 2000.00 - - - - - - 过毛重照片 - - - + + + + + + 扣重(KG) + * + + + + + + + + + 扣点(%) + * + + + + + + + 是否无皮过磅 + + + + + + + 毛重(KG) + 2000.00 + + + + + 过毛重照片 + + + + + - - - + - - - + + - + 取消 - 提交 + 提交 + - \ No newline at end of file + + + + \ No newline at end of file diff --git a/pages/process/order-info/index.js b/pages/process/order-info/index.js index 7ad5f4d..9a8e955 100644 --- a/pages/process/order-info/index.js +++ b/pages/process/order-info/index.js @@ -1,5 +1,8 @@ // pages/process/order-check/index.js import Dialog from '../../../components/dialog/dialog' +import { cancelOrder, getFactoryOrderInfo, checkingOrder} from "../../api/saas" +const event = require('../../../utils/event') +const util = require('../../../utils/util') const app = getApp() Page({ @@ -8,17 +11,22 @@ Page({ */ data: { safeBottom: app.globalData.safeBottom, - form: { - plateNumber: null - } + form: null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.setData({ - safeBottom: app.globalData.safeBottom - }) + if(options.id){ + wx.showLoading({ title: '正在获取', mask: true }) + getFactoryOrderInfo(options.id).then(result => { + wx.hideLoading() + this.setData({ safeBottom: app.globalData.safeBottom, form: result.data }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + } }, showPlate: function (e) { this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard') @@ -44,15 +52,38 @@ Page({ }, cancelOrder: function(e){ Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { + wx.showLoading({ title: '正在获取', mask: true }) + cancelOrder({ id: this.data.form.id }).then(result => { + wx.hideLoading() + util.showBackToast('订单已经删除') + event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + }) + }, + checkOrder: function(){ + wx.showLoading({ title: '正在获取', mask: true }) + checkingOrder({ id: this.data.form.id }).then(result => { + wx.hideLoading() + util.showBackToast('订单审核已通过') + event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) }) }, viewImage: function (e) { var imgList = [] - for (let index = 0; index < this.data.imgList.length; index++) { - if (this.data.imgList[index].indexOf('.mp4') >= 0) { - continue + if(e.currentTarget.dataset.type == 0){ + for (let index = 0; index < this.data.form.preWeighingPicture.length; index++) { + imgList.push(this.data.this.data.form.preWeighingPicture[index].url) + } + } else { + for (let index = 0; index < this.data.form.aftWeighingPicture.length; index++) { + imgList.push(this.data.this.data.form.aftWeighingPicture[index].url) } - imgList.push(this.data.imgList[index]) } wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) } diff --git a/pages/process/order-info/index.json b/pages/process/order-info/index.json index e55b6ea..f99e98b 100644 --- a/pages/process/order-info/index.json +++ b/pages/process/order-info/index.json @@ -5,6 +5,8 @@ "van-button": "/components/button/index", "van-loading": "/components/loading/index", "van-image": "/components/image/index", - "van-dialog": "/components/dialog/index" + "van-dialog": "/components/dialog/index", + "van-popup": "/components/popup/index", + "van-picker": "/components/picker/index" } } \ No newline at end of file diff --git a/pages/process/order-info/index.wxml b/pages/process/order-info/index.wxml index b907993..6a410fd 100644 --- a/pages/process/order-info/index.wxml +++ b/pages/process/order-info/index.wxml @@ -2,117 +2,119 @@ 过磅详情 - - - 待过磅审核 - - - - 客户姓名 - 刘财顺 - - - - - 车牌号码 - {{form.plateNumber || '请输入车牌号码'}} - - - - - 废纸品类 - 黄纸板 - - - - - 毛重(KG) - 黄纸板 - - - - - 皮重(KG) - 黄纸板 - - - - - 净重(KG) - 黄纸板 - - - - - 定价员 - 黄纸板 - - - - - 定价时间 - 2021年1月20日 21:46:27 + + + + + 待过磅审核 - - - - + + + 客户姓名 + {{form.factoryCustomerName}} + + + + + 车牌号码 + {{form.plateNumber || '请输入车牌号码'}} + + + + + 废纸品类 + {{form.productId}} + + + + + 毛重(KG) + {{form.totalWeight}} + + + + + 皮重(KG) + {{form.emptyWeight}} + + + + + 净重(KG) + {{form.netWeight}} + + + + + 定价员 + {{form.inspectorName}} + + + + + 定价时间 + {{form.inspectionTime}} + + + + 过毛重照片 - - - + + + + + - - - + - - - - - + + + 过皮重照片 - - - + + + + + - - - + - - - - - - - 单价(元/KG) - 1.80 - - - - - 金额(元) - 47001.80 - - - - - 订单时间 - 2021年1月20日 21:46:27 - - - - - 订单编号 - XXP123456709978957 - - + + + + + 单价(元/KG) + {{form.settleUnitPrice}} + + + + + 金额(元) + {{form.createTime}} + + + + + 订单时间 + {{form.createTime}} + + + + + 订单编号 + {{form.createTime}} + + + - + 重新过皮重 - 通过审核 + 通过审核 + \ No newline at end of file diff --git a/pages/process/order-list/index.js b/pages/process/order-list/index.js index 3df5463..9208a5d 100644 --- a/pages/process/order-list/index.js +++ b/pages/process/order-list/index.js @@ -1,6 +1,6 @@ // pages/process/order-list/index.js import Dialog from '../../../components/dialog/dialog' -import { getOrderList, cancelOrder, receiptOrder} from "../../api/saas" +import { getFactoryOrderList, cancelOrder } from "../../api/saas" const event = require('../../../utils/event') const util = require('../../../utils/util') const app = getApp() @@ -20,7 +20,8 @@ Page({ form: { status: 0, pageNum: 1 - } + }, + title: '全部' }, /** * 生命周期函数--监听页面加载 @@ -28,10 +29,27 @@ Page({ onLoad: function (options) { if(options.status){ this.data.form.status = Number(options.status) + if(this.data.form.status == 1){ + this.data.title = '定价列表' + } else if(this.data.form.status == 2){ + this.data.title = '过磅审核' + } else if(this.data.form.status == 3){ + this.data.title = '代付款' + } else if(this.data.form.status == 4){ + this.data.title = '已完成' + } else if(this.data.form.status == 5){ + this.data.title = '已关闭' + } } - this.setData({ height: app.globalData.fragmentHeight }) + event.on('OrderMessage', this, this.onEvent) + this.setData({ height: app.globalData.fragmentHeight, title: this.data.title }) this.fetchOrderList() }, + onEvent: function(message){ + if (message.what == 12) { + this.onRefreshList() + } + }, onRefreshList: function () { this.setData({ orderList: [], @@ -50,8 +68,8 @@ Page({ } else { this.setData({ requesting: true }) } - getOrderList(this.data.form).then(result => { - if (result.data.records.length) { + getFactoryOrderList(this.data.form.status, this.data.form).then(result => { + if (result.data && result.data.records.length) { var respList = result.data.records let nowList = `orderList[${this.data.orderList.length}]` var num = this.data.form.pageNum @@ -78,17 +96,28 @@ Page({ this.setData({ finished: true, requesting: false, loading: false }) } }).catch(err => { - //异常回调 this.setData({ requesting: false, loading: false }) util.showToast(err) }) }, cancelOrder: function(e){ Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { + wx.showLoading({ title: '正在获取', mask: true }) + cancelOrder({ id: this.data.form.id }).then(result => { + wx.hideLoading() + util.showToast('订单已经删除') + this.onRefreshList() + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) }) }, priceOrder: function(e){ wx.navigateTo({ url: '/pages/process/order-info/index?id=' }) + }, + onUnload: function(){ + event.remove('OrderMessage', this) } }) \ No newline at end of file diff --git a/pages/process/order-list/index.wxml b/pages/process/order-list/index.wxml index 473bc41..d010588 100644 --- a/pages/process/order-list/index.wxml +++ b/pages/process/order-list/index.wxml @@ -1,6 +1,6 @@ - 定价列表 + {{title}}