diff --git a/api/saas.js b/api/saas.js
index 1a68566..8fb8e5c 100644
--- a/api/saas.js
+++ b/api/saas.js
@@ -3,7 +3,7 @@
*/
import { mGet, mPost } from "./request"
const app = getApp()
-const urls = [`http://47.113.118.47:9000`, `http://47.113.118.47:9000`, `https://api-client-ztb.qniao.cn`]
+const urls = [`https://api-client-ztb-dev.qniao.cn`, `https://api-client-ztb-test.qniao.cn`, `https://api-client-ztb.qniao.cn`]
const sconfig = {
baseUrl: urls[app.release % 3]
@@ -13,12 +13,14 @@ const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product
const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, 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 pricingOrder = (params) => mPost(`/ztb-factory/factory/submit/order-price`, params, sconfig)
+const cancelOrder = (id) => mPost(`/ztb-factory/factory/cancel/order/${id}`, null, sconfig)
+const repeatOrder = (id) => mPost(`/ztb-factory/factory/renew/empty-weight/${id}`, null, sconfig)
+const checkingOrder = (params) => mPost(`/ztb-factory/factory/audit-pass/order`, 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 getFactoryOrderList = (params) => mGet(`/ztb-factory/factory/wechat-applet/get/order-list`, params, sconfig)
const getFactoryOrderInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/order-detail/${id}`, null, sconfig)
+const getPaperList = (params) => mGet(`/ztb-factory/factory/get/all-product`, params, 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)
@@ -45,5 +47,7 @@ export {
getCustomerList,
editCustomer,
deleteCustomer,
- getCustomerInfo
+ getCustomerInfo,
+ getPaperList,
+ repeatOrder
}
\ No newline at end of file
diff --git a/app.json b/app.json
index a3eee2d..83dd1d8 100644
--- a/app.json
+++ b/app.json
@@ -6,7 +6,7 @@
"pages/home/employee/index",
"pages/home/authory/index",
"pages/process/order-list/index",
- "pages/process/order-check/index",
+ "pages/process/order-price/index",
"pages/process/order-info/index",
"pages/htmls/agreement/index",
"pages/message/detail/index"
diff --git a/assets/image/icon_payfor.png b/assets/image/icon_payfor.png
new file mode 100644
index 0000000..42fc62b
Binary files /dev/null and b/assets/image/icon_payfor.png differ
diff --git a/components/button/index.wxml b/components/button/index.wxml
index 9c1f1c6..b4b05d5 100644
--- a/components/button/index.wxml
+++ b/components/button/index.wxml
@@ -6,7 +6,7 @@
open-type="{{ openType }}" business-id="{{ businessId }}" session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}" send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}" show-message-card="{{ showMessageCard }}" app-parameter="{{ appParameter }}"
- aria-label="{{ ariaLabel }}" bindtap="{{ !disabled ? 'onClick' : 'noop' }}"
+ aria-label="{{ ariaLabel }}" catchtap="{{ !disabled ? 'onClick' : 'noop' }}"
bindgetuserinfo="{{ !disabled ? 'bindGetUserInfo' : 'noop' }}" bindcontact="{{ !disabled ? 'bindContact' : 'noop' }}"
bindgetphonenumber="{{ !disabled ? 'bindGetPhoneNumber' : 'noop' }}"
binderror="{{ !disabled ? 'bindError' : 'noop' }}" bindlaunchapp="{{ !disabled ? 'bindLaunchApp' : 'noop' }}"
diff --git a/pages/login/index.js b/pages/login/index.js
index 4a4d0ac..cbc993b 100644
--- a/pages/login/index.js
+++ b/pages/login/index.js
@@ -88,7 +88,7 @@ Page({
},
/************************************** 获取用户信息,进行登录 ********************************************/
fetchUserInfo: function(authorization){
- config.header = { 'Authorization': 'QNT ' + authorization }
+ // config.header = { 'Authorization': 'QNT ' + authorization }
loginToken({loginToken: authorization}).then(result => {
// token 切换流程
sconfig.header = { 'Authorization': 'QNT ' + result.data }
diff --git a/pages/process/order-info/index.js b/pages/process/order-info/index.js
index 219a080..4900056 100644
--- a/pages/process/order-info/index.js
+++ b/pages/process/order-info/index.js
@@ -2,6 +2,7 @@
import Dialog from '../../../components/dialog/dialog'
import { cancelOrder, getFactoryOrderInfo, checkingOrder} from "../../../api/saas"
const event = require('../../../utils/event')
+const math = require('../../../utils/math')
const util = require('../../../utils/util')
const app = getApp()
@@ -11,7 +12,8 @@ Page({
*/
data: {
safeBottom: app.globalData.safeBottom,
- form: null
+ form: null,
+ title: '过磅详情'
},
/**
* 生命周期函数--监听页面加载
@@ -21,9 +23,16 @@ Page({
wx.showLoading({ title: '正在获取', mask: true })
getFactoryOrderInfo(options.id).then(result => {
wx.hideLoading()
- this.setData({ safeBottom: app.globalData.safeBottom, form: result.data })
+ result.data.amount = math.times(math.minus(result.data.netWeight, result.data.deductWeight), result.data.settleUnitPrice)
+ if(result.data.status == 4){
+ this.data.title = '待付款'
+ } else if(result.data.status == 5){
+ this.data.title = '已完成'
+ }
+ this.setData({ safeBottom: app.globalData.safeBottom, form: result.data, title: this.data.title })
}).catch(err => {
wx.hideLoading()
+ this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err)
})
}
@@ -36,9 +45,6 @@ Page({
if(detail && detail.plateNumber){
this.setData({ ['form.plateNumber']: detail.plateNumber })
}
- },
- showCategory: function(){
-
},
bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value
@@ -50,12 +56,12 @@ Page({
paddingOrder: function(){
this.setData({ ['form.checking']: !this.data.form.checking })
},
- cancelOrder: function(e){
- Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
+ repeatOrder: function(e){
+ Dialog.confirm({ title: '温馨提示', message: '确定重新过皮重?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true })
- cancelOrder({ id: this.data.form.id }).then(result => {
+ repeatOrder(this.data.form.id).then(result => {
wx.hideLoading()
- util.showBackToast('订单已经删除')
+ util.showBackToast('订单已经处理')
event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' })
}).catch(err => {
wx.hideLoading()
diff --git a/pages/process/order-info/index.wxml b/pages/process/order-info/index.wxml
index 6a410fd..b4177fe 100644
--- a/pages/process/order-info/index.wxml
+++ b/pages/process/order-info/index.wxml
@@ -1,13 +1,21 @@
- 过磅详情
+ {{title}}
-
+
待过磅审核
+
+
+ 待付款(请前往后台支付)
+
+
+
+ 已完成
+
客户姓名
@@ -23,7 +31,7 @@
废纸品类
- {{form.productId}}
+ {{form.productCategoryName}}
@@ -47,13 +55,13 @@
定价员
- {{form.inspectorName}}
+ {{form.inspectorName || ''}}
定价时间
- {{form.inspectionTime}}
+ {{form.inspectionTime || ''}}
@@ -93,28 +101,28 @@
金额(元)
- {{form.createTime}}
+ {{form.amount}}
订单时间
- {{form.createTime}}
+ {{form.createTime || ''}}
订单编号
- {{form.createTime}}
+ {{form.id}}
-
-
-
-
-
-
-
- 客户名称:刘财顺
- 毛重:2000.00KG
+
+
+
+
+
+
+ 客户名称:{{item.factoryCustomerName}}
+
+
+ 毛重:{{item.totalWeight}}KG
-
+
取消
定价
+
+ 审核
+
+
+ 待付款
+
+
+ 已完成
+
diff --git a/pages/process/order-check/index.js b/pages/process/order-price/index.js
similarity index 63%
rename from pages/process/order-check/index.js
rename to pages/process/order-price/index.js
index 7774ad5..a8626f8 100644
--- a/pages/process/order-check/index.js
+++ b/pages/process/order-price/index.js
@@ -1,6 +1,6 @@
// pages/process/order-check/index.js
import Dialog from '../../../components/dialog/dialog'
-import { pricingOrder, cancelOrder, getFactoryOrderInfo, getPaperPrice} from "../../../api/saas"
+import { pricingOrder, cancelOrder, getFactoryOrderInfo, getPaperList} from "../../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const app = getApp()
@@ -23,10 +23,16 @@ Page({
onLoad: function (options) {
if(options.id){
wx.showLoading({ title: '正在获取', mask: true })
- getPaperPrice().then(result => {
- this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data })
+ getPaperList().then(result => {
+ this.data.paperList = result.data.records
+ this.data.columns = []
+ for (let index = 0; index < this.data.paperList.length; index++) {
+ this.data.columns.push(this.data.paperList[index].name)
+ }
+ this.setData({ safeBottom: app.globalData.safeBottom, columns: this.data.columns })
}).catch(err => {
wx.hideLoading()
+ this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err)
})
getFactoryOrderInfo(options.id).then(result => {
@@ -50,33 +56,30 @@ Page({
showCategory: function(){
this.setData({ visible: true })
},
- onConfirm: function({ picker, value, index }){
- this.setData({ visible: false })
+ onConfirm: function({detail}){
+ this.data.form.productId = this.data.paperList[detail.index].categoryId
+ this.setData({ visible: false, ['form.productCategoryName']: detail.value })
},
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 })
+ if(Number(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 })
+ this.setData({ deductType: e.currentTarget.dataset.type, ['form.deductWeight']: null })
}
},
bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value
},
- onChange: function({ detail }) {
- // 需要手动对 checked 状态进行更新
- this.setData({ ['form.isDefault']: detail ? 1 : 0 })
- },
paddingOrder: function(){
- this.setData({ ['form.weighingType']: !this.data.form.weighingType })
+ this.setData({ ['form.isWithoutTare']: !this.data.form.isWithoutTare })
},
cancelOrder: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '处理中', mask: true })
- cancelOrder({ id: this.data.form.id }).then(result => {
+ cancelOrder(this.data.form.id).then(result => {
wx.hideLoading()
util.showBackToast('订单已经删除')
event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' })
@@ -87,6 +90,22 @@ Page({
})
},
priceOrder: function(){
+ if(util.isEmpty(this.data.form.productId) || Number(this.data.form.productId) <= 0){
+ util.showToast('请选择废纸品类')
+ return
+ }
+ if(util.isEmpty(this.data.form.unitPrice) || Number(this.data.form.unitPrice) <= 0){
+ util.showToast('请输入单价')
+ return
+ }
+ if(this.data.deductType == 1 && (util.isEmpty(this.data.form.deductWeight) || Number(this.data.form.deductWeight) <= 0)){
+ util.showToast('请输入扣重')
+ return
+ }
+ if(this.data.deductType == 2 && (util.isEmpty(this.data.form.deductPercent) || Number(this.data.form.deductPercent) <= 0)){
+ util.showToast('请输入扣点')
+ return
+ }
wx.showLoading({ title: '处理中', mask: true })
pricingOrder(this.data.form).then(result => {
wx.hideLoading()
diff --git a/pages/process/order-check/index.json b/pages/process/order-price/index.json
similarity index 82%
rename from pages/process/order-check/index.json
rename to pages/process/order-price/index.json
index 883bfbf..acef63c 100644
--- a/pages/process/order-check/index.json
+++ b/pages/process/order-price/index.json
@@ -6,6 +6,8 @@
"van-checkbox": "/components/checkbox/index",
"van-loading": "/components/loading/index",
"van-image": "/components/image/index",
+ "van-picker": "/components/picker/index",
+ "van-popup": "/components/popup/index",
"van-dialog": "/components/dialog/index",
"vehicle-keyboard": "/components/vehicle-keyboard/index"
}
diff --git a/pages/process/order-check/index.wxml b/pages/process/order-price/index.wxml
similarity index 82%
rename from pages/process/order-check/index.wxml
rename to pages/process/order-price/index.wxml
index dc19064..a363ac1 100644
--- a/pages/process/order-check/index.wxml
+++ b/pages/process/order-price/index.wxml
@@ -23,7 +23,7 @@
废纸品类
*
- 请选择废纸品类
+ {{form.productCategoryName || '请选择废纸品类'}}
@@ -33,13 +33,13 @@
单价(元/KG)
*
-
+
-
+
扣重(KG)
*
@@ -49,8 +49,8 @@
-
-
+
+
扣点(%)
*
@@ -62,14 +62,14 @@
是否无皮过磅
-
+
毛重(KG)
- 2000.00
+ {{form.totalWeight}}
@@ -87,11 +87,9 @@
-