更换正式环境,测试修改
This commit is contained in:
@@ -43,21 +43,35 @@ export const $invoicingType = [{
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '供应商入库',
|
||||
value: 'purveyor'
|
||||
text: '手动入库',
|
||||
value: 'manual-in'
|
||||
},
|
||||
{
|
||||
text: '供应商退货',
|
||||
value: 'reject'
|
||||
text: '手动出库',
|
||||
value: 'manual-out'
|
||||
},
|
||||
{
|
||||
text: '其他入库',
|
||||
value: 'purchase'
|
||||
text: '盘盈入库',
|
||||
value: 'win-in'
|
||||
},
|
||||
{
|
||||
text: '其他出库',
|
||||
text: '盘亏出库',
|
||||
value: 'loss-out'
|
||||
},
|
||||
{
|
||||
text: '订单退款入库',
|
||||
value: 'other-out'
|
||||
},
|
||||
{
|
||||
text: '订单消费出库',
|
||||
value: 'order-out'
|
||||
},
|
||||
{
|
||||
text: '损耗出库',
|
||||
value: 'damage-out'
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
// 页面常用数据
|
||||
|
||||
19
commons/utils/directive.js
Normal file
19
commons/utils/directive.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
export const directive = {
|
||||
vOnlyNumber : {
|
||||
mounted(el) {
|
||||
// 当元素挂载时设置事件监听器
|
||||
el.addEventListener('input', (event) => {
|
||||
// 使用正则表达式只允许数字通过
|
||||
event.target.value = event.target.value.replace(/[^\d]/g, '');
|
||||
});
|
||||
},
|
||||
// 如果需要处理组件更新后的情况,可以添加 updated 钩子
|
||||
updated(el) {
|
||||
el.addEventListener('input', (event) => {
|
||||
event.target.value = event.target.value.replace(/[^\d]/g, '');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,14 +20,10 @@ export function canTuiKuan(orderInfo, item) {
|
||||
if( item ){
|
||||
return (orderInfo.status == 'done' || orderInfo.status == 'part_refund')
|
||||
&& item.status != 'return' && item.status != 'refund' && item.status != 'refunding'
|
||||
&& (item.returnAmount < item.num*item.unitPrice)
|
||||
&& (item.returnNum < item.num)
|
||||
} else {
|
||||
let goodsList = []
|
||||
let data = false;
|
||||
Object.entries(orderInfo.detailMap).map(([key, value]) => (
|
||||
goodsList = [...goodsList,...value]
|
||||
))
|
||||
goodsList.some((v,i)=>{
|
||||
uni.$utils.objToArrary(orderInfo.detailMap).some((v,i)=>{
|
||||
if( orderInfo.refundAmount < orderInfo.payAmount || (orderInfo.status == 'done' || orderInfo.status == 'part_refund' ) && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' && (v.returnNum+v.refundNum < v.num) ){
|
||||
data = true
|
||||
return data
|
||||
|
||||
@@ -16,10 +16,28 @@ export const utils = {
|
||||
* 限制金额输入格式
|
||||
* @param {Object} e
|
||||
*/
|
||||
isPrice (e) {
|
||||
return e.replace(/[^0-9.]/g, '').replace(/\.{2,}/g, "").replace(/^\./, '')
|
||||
isMoney (e) {
|
||||
return e.toString().replace(/[^0-9.]/g, '').replace(/^\./g, "").replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d{0,2}).*$/, "$1$2.$3")
|
||||
},
|
||||
|
||||
/**
|
||||
* 判断菜品使用价格
|
||||
* @param {Object} e
|
||||
*/
|
||||
isGoodsPrice(item,user) {
|
||||
let isVip = uni.getStorageSync("shopInfo").isMemberPrice&&user.id&&user.isVip
|
||||
|
||||
let memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||
let price = isVip ? memberPrice : item.price;
|
||||
price = item.discountSaleAmount ? item.discountSaleAmount : price
|
||||
return price;
|
||||
},
|
||||
|
||||
inputReg(value,key,regName){
|
||||
//判断regList对象是否存在属性 避免报错
|
||||
// utils.hasOwnProperty.call(utils,regName)&&(form[key]=utils[regName](value))
|
||||
},
|
||||
|
||||
/**
|
||||
* 金额保留两位小数
|
||||
* @param {Object} e
|
||||
@@ -138,6 +156,27 @@ export const utils = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 对象转数组
|
||||
* @param {Object} e
|
||||
*/
|
||||
objToArrary (obj) {
|
||||
|
||||
if (Object.values(obj) && Array.isArray(Object.values(obj)[0])){
|
||||
// 是数组
|
||||
let arr = []
|
||||
Object.values(obj).forEach(item=>{
|
||||
arr = [...arr,...item]
|
||||
})
|
||||
return arr
|
||||
} else {
|
||||
// 不是数组
|
||||
return Object.keys(obj).map(key => obj[key])
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
export const objToArrary = (obj,keyNewName) => {
|
||||
return Object.entries(obj).map(([key, value]) => ({
|
||||
key,
|
||||
[keyNewName]:key,
|
||||
...value,
|
||||
}))
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class WebsocketUtil {
|
||||
}
|
||||
this.heartbeatInterval = setInterval(() => {
|
||||
if (this.isOpen) {
|
||||
this.send(JSON.stringify({"type": "ping_interval"}));
|
||||
this.send(JSON.stringify({"type": "ping_interval","set": "onboc"}));
|
||||
}
|
||||
}, this.time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user