Commit e2adfe3b by 张立顺

feat 功能开发完成

1 parent dbb0c8a0
...@@ -83,6 +83,10 @@ module.exports = { ...@@ -83,6 +83,10 @@ module.exports = {
listByMerchantIdAndIds(data) { listByMerchantIdAndIds(data) {
return api.post('dj.api.smartcarlife.quotationGoods.listByMerchantIdAndIds', data) return api.post('dj.api.smartcarlife.quotationGoods.listByMerchantIdAndIds', data)
}, },
/** 根据商户号商品id获取可选升级商品列表 */
quotationGoodsList(data) {
return api.post('dj.api.smartcarlife.quotationGoods.list', data)
},
/** 待补录订单统计 */ /** 待补录订单统计 */
waitinputorder(data) { waitinputorder(data) {
let params = data || {} let params = data || {}
...@@ -165,5 +169,4 @@ module.exports = { ...@@ -165,5 +169,4 @@ module.exports = {
staffDailyReportMerchantValid(data) { staffDailyReportMerchantValid(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data) return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
} }
} }
...@@ -25,10 +25,9 @@ Component({ ...@@ -25,10 +25,9 @@ Component({
*/ */
methods: { methods: {
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { name } = e.currentTarget.dataset let { name } = e.currentTarget.dataset
console.log(name) // console.log(name)
// this.
this.triggerEvent('btnTap', { name }) this.triggerEvent('btnTap', { name })
} }
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</view> </view>
<view class="text" wx:elif="{{item.type == 'project' }}"> <view class="text" wx:elif="{{item.type == 'project' }}">
<block wx:for="{{orderInfo.quotationGoodsInfoList || orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx"> <block wx:for="{{orderInfo.quotationGoodsInfoList || orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx">
<view class="goodsName">{{subItem.goodsNameAlias||subItem.upgradeGoodsName||subItem.goodsName}} <text class="goodsItem">(包含{{subItem.serviceItems||subItem.position}})</text></view> <view class="goodsName">{{subItem.goodsNameAlias||subItem.upgradeGoodsName||subItem.goodsName}} <text class="goodsItem" wx:if="{{subItem.serviceItems||subItem.position}}">(包含{{subItem.serviceItems||subItem.position}})</text></view>
</block> </block>
</view> </view>
<view class="text" wx:else>{{orderInfo[item.key]||''}}</view> <view class="text" wx:else>{{orderInfo[item.key]||''}}</view>
......
...@@ -122,21 +122,22 @@ Page({ ...@@ -122,21 +122,22 @@ Page({
// return item // return item
// }) // })
// timeBean // timeBean
let dateStaffPop = wx.$storage.get('dateStaffPop') // let dateStaffPop = wx.$storage.get('dateStaffPop')
// 判断 有没有填写日报 // 判断 有没有填写日报
let hasNeedReport = timeBean.weekDayList.find((item, index) => { let hasNeedReport = timeBean.weekDayList.find((item, index) => {
// item.hasDailyValue = // item.hasDailyValue =
return !data.includes(item.date) && !item.disabled return !data.includes(item.date) && !item.disabled
}) })
console.log(hasNeedReport, 'hasNeedReport') console.log(hasNeedReport, 'hasNeedReport')
let nowDate = new Date().format('yyyy-MM-dd')
let num = 0 // let nowDate = new Date().format('yyyy-MM-dd')
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) { // let num = 0
num = dateStaffPop?.num || 0 // if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
num = num + 1 // num = dateStaffPop?.num || 0
} else { // num = num + 1
num = num + 1 // } else {
} // num = num + 1
// }
// num <= 2 // num <= 2
if (hasNeedReport) { if (hasNeedReport) {
...@@ -173,10 +174,10 @@ Page({ ...@@ -173,10 +174,10 @@ Page({
// let num = hasNeedReport ? dateStaffPop?.num + 1 : dateStaffPop?.num // let num = hasNeedReport ? dateStaffPop?.num + 1 : dateStaffPop?.num
console.log(num) console.log(num)
wx.$storage.set('dateStaffPop', { // wx.$storage.set('dateStaffPop', {
date: new Date().format('yyyy-MM-dd'), // date: new Date().format('yyyy-MM-dd'),
num // num
}) // })
console.log(hasNeedReport, 'hasNeedReport') console.log(hasNeedReport, 'hasNeedReport')
this.setData({ this.setData({
// weeklyList: data // weeklyList: data
......
...@@ -48,7 +48,9 @@ Component({ ...@@ -48,7 +48,9 @@ Component({
}, },
observers: { observers: {
'orderInfo.mode': function (value) { 'orderInfo.mode': function (value) {
this.getYqStoreConfig() // 先注释掉
// this.getYqStoreConfig()
// if (n.mode) { // if (n.mode) {
console.log(value, data, data.firstObjSimple, 'mode') console.log(value, data, data.firstObjSimple, 'mode')
console.log({ console.log({
...@@ -181,7 +183,7 @@ Component({ ...@@ -181,7 +183,7 @@ Component({
// }, // },
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { let {
name name
} = e.detail } = e.detail
......
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
console.log(n, 'show');
if (n) {
// this.getOrderBaseGoodsList(n)
let thisPage = wx.$router.getPageInstance()
thisPage.getQuotationInfo()
}
}
},
goodsData: {
type: Array,
observer: function (n) {
if (n.length > 0) {
this.getOrderBaseGoodsList(n)
}
}
},
chooseGoodsList: {
type: Array,
observer: function (n) {
console.log(n, 'chooseGoodsList');
this.setGoodsActive()
}
},
minPrice: {
type: Number
}
},
/**
* 组件的初始数据
*/
data: {
goodsList: [],
recordList: [],
// totalGoodsList:[],
},
/**
* 组件的方法列表
*/
methods: {
cancel() {
let {
goodsData
} = this.data
this.setData({
goodsList: goodsData,
})
this.setGoodsActive()
},
setGoodsActive() {
let {
chooseGoodsList,
goodsList,
recordList
} = this.data
if (chooseGoodsList.length == 0) {
goodsList.forEach(e => {
e.active = false
})
recordList.forEach(e => {
e.active = false
})
} else {
// let indexList = []
goodsList.map((e, index) => {
e.active = false
chooseGoodsList.map(s => {
if (s.goods && e.goods) {
// console.log(e);
if (s.goods.goodsId == e.goods.goodsId) {
e.active = true
}
}
if (s.packageGoods && e.packageGoods) {
if (s.packageGoods.packageCode == e.packageGoods.packageCode) {
e.active = true
}
}
})
})
recordList.map((e, index) => {
e.active = false
chooseGoodsList.map(s => {
// if (s.goodsId == e.id) {
// e.active = true
// }
if (s.goods && e.goods) {
if (s.goods.goodsId == e.goods.goodsId) {
e.active = true
}
}
if (s.packageGoods && e.packageGoods) {
if (s.packageGoods.packageCode == e.packageGoods.packageCode) {
e.active = true
}
}
})
})
}
this.setData({
goodsList,
recordList
})
},
getOrderBaseGoodsList(data) {
this.setData({
keyWord: '',
goodsList: data,
recordList: data
})
},
getChooseList() {
let {
recordList,
chooseGoodsList
} = this.data
let chooseList = []
recordList.map(c => {
// e.upgradeGoodsList.map(c => {
if (c.active) {
if (c.goods) {
if (!c.count) c.count = 1
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.goods.goodsId == c.goods.goodsId) {
console.log(x)
c.goods.price = x.goods.price || 0
}
})
} else {
c.goods.price = c.goods.sellPrice || 0
}
// if (!c.price) c.goods.price = c.sellPrice
// c.goodsId = c.id
chooseList.push(c)
}
if (c.packageGoods) {
if (!c.count) c.count = 1
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.packageGoods && x.packageGoods.packageCode == c.packageGoods.packageCode) {
c.packageGoods.goodsList = c.packageGoods.goodsList.map(item => {
c.packageGoods.goodsList.map(ele => {
if (item.goodsId == ele.goodsId) {
item.price = ele.price || 0
}
})
return item
})
}
// if (x.goods.goodsId == c.goods.goodsId) {
// console.log(x)
// c.goods.price = x.goods.price || 0
// }
})
} else {
// c.goods.price = c.goods.sellPrice || 0
c.packageGoods.goodsList = c.packageGoods.goodsList.map(ele => {
ele.price = ele.sellPrice || 0
return ele
})
}
c.price = c.packageGoods.goodsList.reduce((total, item) => {
total = total + item.price
return total
}, 0)
chooseList.push(c)
}
}
// })
})
return chooseList
},
choose(e) {
let {
item,
index,
ind
} = e.currentTarget.dataset
let {
active
} = item
let {
minPrice,
recordList
} = this.data
// console.log(item, 'item');
// console.log(item.goodsInfo.shopMinPrice)
// console.log(minPrice && minPrice < item.shopMinPrice)
// 如果有设置订单价格 那就不能选单个成本价比总价还高的
if (minPrice && minPrice / 100 < item.shopMinPrice) return false
let goodsType = item.goods ? 'goods' : 'packageGoods'
let target = `goodsList[${ind}].active`
let recordIndex = recordList.findIndex(el => {
if (item.goods && el.goods) {
return el[goodsType].goodsId == item[goodsType].goodsId
}
if (item.packageGoods && el.packageGoods) {
// console.log(el[goodsType], 'el[goodsType]');
return el[goodsType].packageGoods == item[goodsType].packageGoods
}
})
// console.log(recordIndex, 'recordIndex');
this.setData({
[`recordList[${recordIndex}].active`]: !active,
[target]: !active
})
},
addCount(e) {
let {
index,
count,
item,
ind
} = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
if (!item.count) item.count = 1
item.count += count
if (item.count < 1) item.count = 1
if (item.count > 999) item.count = 999
this.setData({
[target]: item.count
})
},
input(e) {
let {
index,
ind
} = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
let {
value
} = e.detail
if (value < 1) value = 1
if (value > 999) value = 999
this.setData({
[target]: Number(value)
})
},
searchGoods(e) {
let {
goodsData,
recordList
} = this.data
let {
value
} = e.detail
if (!value) {
this.getOrderBaseGoodsList(recordList)
return
}
let _DATA_ = JSON.parse(JSON.stringify(recordList))
let arr = []
_DATA_.map(c => {
let name = c.upgradeGoodsAlias || c.upgradeGoodsName || c.goodsInfo.goodsName
if (name.indexOf(value) != -1) {
arr.push(c)
}
})
console.log(arr)
this.setData({
goodsList: arr
})
},
confirm() {
let chooseList = this.getChooseList()
console.log(chooseList, 'chooseList');
let {
goodsList
} = this.data
if (goodsList.length < 1) return
if (!chooseList.length) return wx.$util.showToast('请勾选商品')
this.triggerEvent('confirm', chooseList)
let thisPage = wx.$router.getPageInstance()
// let total = 0
// chooseList.map(i => (total += i.count * i.price))
thisPage.setData({
['orderInfo.vdQuotationGoodsList']: chooseList,
// ['orderInfo.total']: wx.$util.decimal(total, 2)
}, () => {
// console.log(thisPage);
thisPage.totalFee()
})
this.setData({
show: false
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<wxs src="index.wxs" module="filter" />
<popup show="{{show}}" title="选择商品" bindconfirm="confirm" bindcancel="cancel">
<view class="coupon-box">
<search-input value="{{keyWord}}" bindsearch="searchGoods" />
<scroll-view class="coupon" scroll-y>
<block wx:if="{{goodsList.length > 0}}">
<!-- <block wx:for="{{goodsList}}" wx:key="index"> -->
<!-- <view class="title">
{{item.goodsTypeName}}
<text class="tips">|建议价</text>
</view> -->
<view class="box">
<block wx:for="{{goodsList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item {{minPrice?(minPrice/100)>= i.shopMinPrice ?'':'disableSelect':'' }}">
<view class="value " catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.goods}}">
<view class="name text-hide ">
<view>{{filter.replaceItemText(i.goods.upgradeGoodsAlias) ||filter.replaceItemText(i.goods.upgradeGoodsName) || filter.replaceItemText(i.goods.goodsInfo.goodsName)}}</view>
<!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> -->
<view class="serveName">(包含{{i.goods.serveName}})</view>
<!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> -->
</view>
<view class="last">
<text class="price">¥{{i.goods.sellPrice}}</text>
</view>
</block>
<block wx:if="{{i.packageGoods}}">
<view class="childbox">
<view class="item">
<view class="name text-hide ">
<view>{{i.packageGoods.packageName}}</view>
</view>
<view class="last">
<text class="price">¥{{i.packageGoods.sellPrice}}</text>
</view>
</view>
<view class="goodsItem">
<block wx:for="{{i.packageGoods.goodsList}}" wx:key="childind" wx:for-index="childind" wx:for-item="child">
<view class="goodsListName">{{filter.replaceItemText(child.goodsAlias) ||filter.replaceItemText(child.upgradeGoodsName) || filter.replaceItemText(child.goodsInfo.goodsName)}}</view>
<view class="goodsListPrice">¥{{child.sellPrice}}</view>
</block>
</view>
</view>
</block>
</view>
<view class="icon" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.active}}">
<image src="./images/radio.png" />
</block>
<block wx:else>
<view class="arc" />
</block>
</view>
</view>
</block>
</view>
<!-- </block> -->
</block>
<block wx:else>
<view class="nothing">暂无数据</view>
</block>
</scroll-view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
/* components/Goods/Goods.wxss */
/* @import '../Coupon/Coupon.wxss'; */
.coupon-box {
width: calc(100% + 64rpx);
height: 100%;
margin-left: -32rpx;
}
.coupon {
height: calc(100% - 104rpx);
}
.box {
border-bottom: 2rpx solid #EBEDF0;
padding-left: 72rpx;
}
.title {
padding: 18rpx 0 0 32rpx;
font-size: 32rpx;
color: #333333;
height: 88rpx;
box-sizing: border-box;
}
.text-center {
text-align: center;
}
.item {
box-sizing: border-box;
padding: 23rpx 0;
border-top: 2rpx solid #EBEDF0;
/* height: 84rpx; */
display: flex;
/* align-items: center; */
align-items: start;
font-size: 28rpx;
color: #888888;
position: relative;
}
.item.disabled {
color: #ccc;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.serveName {
width: 100%;
white-space: pre-wrap;
word-wrap: break-word;
overflow-wrap: break-word;
}
.item .icon {
display: none;
width: 32rpx;
height: 32rpx;
position: absolute;
top: 28rpx;
left: -52rpx;
/* transform: translateY(-50%); */
}
.item.active {
color: #347BFF;
}
.item.active .icon {
display: block;
}
.nothing {
padding: 100rpx;
text-align: center;
color: #999;
}
.item {
justify-content: space-between;
padding-right: 32rpx;
}
.title .tips {
font-size: 24rpx;
color: #999999;
}
.item .value {
/* width: calc(100% - 180rpx); */
width: 100%;
display: flex;
/* flex-direction: ; */
justify-content: space-between;
}
.item .labelWidth {
width: calc(100% - 180rpx);
/* display: flex; */
}
.item .value .name {
max-width: 85%;
}
.item .value .name .warning_text {
color: #F24724;
margin-left: 10rpx;
font-size: 22rpx;
}
.item .value .textWidth {
max-width: 100%;
}
.item .value .last {
max-width: 15%;
}
.item .value .price {
/* color: #347BFF; */
font-weight: 500;
font-size: 28rpx;
color: #EB4E4E;
}
.item .control {
display: flex;
align-items: center;
}
.item .control .minus,
.item .control .add {
width: 44rpx;
height: 44rpx;
color: #347BFF;
background: #F7F7F7;
border-radius: 6rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
font-weight: 700;
}
.item .control .input {
width: 72rpx;
height: 40rpx;
text-align: center;
font-size: 28rpx;
color: #333333;
margin: 0 5rpx;
}
.disableSelect {
opacity: 0.4;
}
.item .icon {
display: block;
}
.item .icon .arc {
width: 100%;
height: 100%;
border: 2rpx solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.nothing {
padding: 100rpx;
text-align: center;
color: #999;
}
.childbox {
width: 100%;
display: flex;
flex-direction: column;
}
.childbox .item {
border-top: none;
padding-top: 0;
padding-right: 0;
}
.goodsItem {
box-sizing: border-box;
padding: 24rpx 24rpx 24rpx 48rpx;
/* width: 558rpx; */
width: 100%;
/* height: 208rpx; */
background: #F7F7F7;
border-radius: 4rpx;
display: flex;
/* flex-direction: column; */
justify-content: space-between;
}
.goodsItem .goodsListName {
position: relative;
}
.goodsItem .goodsListName::before {
content: '';
position: absolute;
left: -24rpx;
top: 50%;
transform: (0, -50%);
border-radius: 6rpx;
width: 12rpx;
height: 12rpx;
background: #347BFF;
}
\ No newline at end of file \ No newline at end of file
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item?item.replace(reg, ' '):''
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText
}
...@@ -306,7 +306,7 @@ Component({ ...@@ -306,7 +306,7 @@ Component({
}) })
}, },
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { name } = e.detail let { name } = e.detail
// let { attrtype, attrname, typename } = this.data.tableObj // let { attrtype, attrname, typename } = this.data.tableObj
let { showError, insuranceCheck, orderInfo } = this.data let { showError, insuranceCheck, orderInfo } = this.data
......
...@@ -20,16 +20,16 @@ Component({ ...@@ -20,16 +20,16 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
pageLifetimes: { pageLifetimes: {
show: function () {}, show: function () { },
attached: function () { attached: function () {
// 在组件实例进入页面节点树时执行 // 在组件实例进入页面节点树时执行
}, },
hide: function () {} hide: function () { }
}, },
properties: { properties: {
serviceInfo: { serviceInfo: {
type: Object, type: Object,
value: () => {} value: () => { }
}, },
orderInfo: { orderInfo: {
type: Object, type: Object,
...@@ -49,7 +49,7 @@ Component({ ...@@ -49,7 +49,7 @@ Component({
}, },
quotationGoodsList: { quotationGoodsList: {
type: Array, type: Array,
value: () => {} value: () => { }
} }
}, },
observers: { observers: {
...@@ -142,7 +142,7 @@ Component({ ...@@ -142,7 +142,7 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log(item, 'item'); console.log(item, 'item');
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
let target = `orderInfo.vdQuotationGoodsList[${index}].price` let target = `orderInfo.vdQuotationGoodsList[${index}].goods.price`
// let [number, decimal] = value.split('.') // let [number, decimal] = value.split('.')
// if (decimal != undefined) { // if (decimal != undefined) {
...@@ -159,6 +159,45 @@ Component({ ...@@ -159,6 +159,45 @@ Component({
}) })
this.setGoodsListTotal() this.setGoodsListTotal()
}, },
changePricePackage(e) {
let {
value
} = e.detail
let {
index,
item,
childind
} = e.currentTarget.dataset
console.log(item, 'item');
let thisPage = wx.$router.getPageInstance()
let { orderInfo: { vdQuotationGoodsList } } = thisPage.data
console.log(childind, 'childind');
console.log(thisPage.data.orderInfo.vdQuotationGoodsList[index].packageGoods.goodsList[childind], 'orderInfo.vdQuotationGoodsList[${index}].packageGoods[${childind}]');
let target = `orderInfo.vdQuotationGoodsList[${index}].packageGoods.goodsList[${childind}].price`
let packagePriceStr = `orderInfo.vdQuotationGoodsList[${index}].price`
// let [number, decimal] = value.split('.')
// if (decimal != undefined) {
// decimal = decimal.substring(0, 2)
// number += `.${decimal}`
// }
// console.log(item.shopMinPrice||0,'item?.shopMinPrice||0');
// if ((item.shopMinPrice||0) > value) {
// wx.$util.showToast('单价不可低于商品最低价')
// }
let number = wx.$util.removeLeadingZerosAndEnsureNonNegative(value)
vdQuotationGoodsList[index].packageGoods.goodsList[childind].price = number
const packagePrice = vdQuotationGoodsList[index].packageGoods.goodsList.reduce((num, item) => {
num = num + parseFloat(item.price || 0)
return num
}, 0)
console.log(packagePrice);
thisPage.setData({
[target]: number,
[packagePriceStr]: packagePrice
})
this.setGoodsListTotal()
},
delGoodsList(e) { delGoodsList(e) {
let { let {
index index
...@@ -182,8 +221,19 @@ Component({ ...@@ -182,8 +221,19 @@ Component({
} = thisPage.data } = thisPage.data
// console.log(orderInfo,'orderInfo'); // console.log(orderInfo,'orderInfo');
let total = 0 let total = 0
orderInfo.vdQuotationGoodsList.map(i => (total += parseFloat(i.count || 1) * parseFloat(i.price))) orderInfo.vdQuotationGoodsList.map(i => {
// console.log(total,'total'); if (i.goods) {
total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price)
}
if (i.packageGoods) {
console.log(i.packageGoods, 'i.packageGoods');
i.packageGoods.goodsList.map(ele => {
total += parseFloat(ele.count || 1) * parseFloat(ele.price)
})
}
})
console.log(total, 'total');
thisPage.setData({ thisPage.setData({
['orderInfo.total']: wx.$util.decimal(total, 2) ['orderInfo.total']: wx.$util.decimal(total, 2)
}) })
...@@ -306,7 +356,7 @@ Component({ ...@@ -306,7 +356,7 @@ Component({
}) })
} }
}) })
.catch(err => {}) .catch(err => { })
}, },
//--------自定义方法---------- //--------自定义方法----------
// 选择年份的区域,弹出弹窗框 // 选择年份的区域,弹出弹窗框
...@@ -429,7 +479,7 @@ Component({ ...@@ -429,7 +479,7 @@ Component({
}) })
}, },
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { let {
name name
} = e.detail } = e.detail
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
"van-collapse-item": "@vant/weapp/collapse-item/index", "van-collapse-item": "@vant/weapp/collapse-item/index",
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput", "popup-input": "../PopupInput/PopupInput",
"goods": "../Goods/Goods" "goods": "../GoodsPackage/Goods"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -101,9 +101,9 @@ ...@@ -101,9 +101,9 @@
font-size: 28rpx; font-size: 28rpx;
} }
.remarkTitle{ .remarkTitle {
margin-top: 20rpx; margin-top: 20rpx;
} }
.box { .box {
box-sizing: border-box; box-sizing: border-box;
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
border-bottom: 2rpx solid rgba(195, 195, 195, .3); border-bottom: 2rpx solid rgba(195, 195, 195, .3);
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 28rpx 0 90rpx; padding: 0 28rpx 0 50rpx;
justify-content: space-between; justify-content: space-between;
font-size: 28rpx; font-size: 28rpx;
position: relative; position: relative;
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
.goods .icon { .goods .icon {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 40rpx; left: 0rpx;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
transform: translateY(-50%); transform: translateY(-50%);
...@@ -383,16 +383,18 @@ ...@@ -383,16 +383,18 @@
color: #fff; color: #fff;
} }
.pay-type, .goodsCom { .pay-type,
.cell { .goodsCom {
padding-left: 20rpx!important; .cell {
padding-left: 20rpx !important;
} }
} }
.van-cell:after { .van-cell:after {
border: none!important; border: none !important;
} }
.only-select-text{
.only-select-text {
width: 300rpx; width: 300rpx;
height: 60rpx; height: 60rpx;
display: flex; display: flex;
...@@ -402,4 +404,49 @@ ...@@ -402,4 +404,49 @@
margin-left: auto; margin-left: auto;
margin-right: -30rpx; margin-right: -30rpx;
position: relative; position: relative;
}
.deleteicon {
// position: absolute;
// top: 50%;
// left: 40rpx;
// transform: translateY(-50%);
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
.goods-box .packageList {
height: auto;
display: flex;
flex-direction: column;
padding: 0;
.package {
width: 100%;
display: flex;
align-items: center;
height: 104rpx;
.price-box {
margin-left: auto;
}
}
}
.packageBox {
box-sizing: border-box;
width: 630rpx;
// height: 104rpx;
background: #F5F5F7;
.itemSty {
display: flex;
justify-content: space-between;
padding: 20rpx 40rpx;
}
.itemSty:nth-child(n+2) {
border-top: 2rpx solid #C3C3C3;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,22 +18,50 @@ ...@@ -18,22 +18,50 @@
<block wx:if="{{ orderInfo.vdQuotationGoodsList.length > 0 }}"> <block wx:if="{{ orderInfo.vdQuotationGoodsList.length > 0 }}">
<view class="goods-box"> <view class="goods-box">
<block wx:for="{{ orderInfo.vdQuotationGoodsList }}" wx:key="index"> <block wx:for="{{ orderInfo.vdQuotationGoodsList }}" wx:key="index">
<view class="goods"> <view class="goods" wx:if="{{item.goods}}">
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}"> <view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="./images/del.png" /> <image src="./images/del.png" />
</view> </view>
<view class="name text-hide"> <view class="name text-hide">
{{item.goodsName}} {{item.goods.goodsAlias || item.goods.upgradeGoodsName || item.goods.goodsName }}
<!-- {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} --> <!-- {{filter.replaceItemText(item.goods.goodsAlias) ||filter.replaceItemText(item.goods.upgradeGoodsName) || filter.replaceItemText(item.goods.goodsName)}} -->
</view> </view>
<view class="price-box"> <view class="price-box">
¥ ¥
<view class="price"> <view class="price">
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.price < 0 ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed /> <input type="digit" value="{{ item.goods.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.price < 0 ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view> </view>
</view> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
</view> </view>
<!-- {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} -->
<view class="goods packageList" wx:if="{{item.packageGoods}}">
<view class="package">
<view class="deleteicon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="./images/del.png" />
</view>
<view class="name text-hide">
{{item.packageGoods.packageName}}
</view>
<view class="price-box">
¥{{item.price}}
</view>
<!-- <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> -->
</view>
<view class="packageBox">
<view class="itemSty" wx:for="{{item.packageGoods.goodsList}}" wx:key="childind" wx:for-index="childind" wx:for-item="child">
<view class="name text-hide">{{child.goodsAlias || child.upgradeGoodsName ||child.goodsName }}</view>
<view class="price-box">
¥
<view class="price">
<input type="digit" value="{{ child.price }}" bindinput="changePricePackage" disabled="{{ orderObj.selectPayType ==0 }}" data-childind="{{childind}}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.price < 0 ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{child.count||1}}</view>
</view>
</view>
</view>
</block> </block>
<view class="goods total-box"> <view class="goods total-box">
<view>总价</view> <view>总价</view>
...@@ -52,13 +80,13 @@ ...@@ -52,13 +80,13 @@
</view> </view>
</view> </view>
<gl-cell wx:if="{{!orderInfo.outTradeNo || orderInfo.resetOrder}}" border class="pay-type" label="支付方式" valueAlign="right" labelWidth="140rpx"> <gl-cell wx:if="{{!orderInfo.outTradeNo || orderInfo.resetOrder}}" border class="pay-type" label="支付方式" valueAlign="right" labelWidth="140rpx">
<view class="only-select-text" wx:if="{{orderInfo.resetOrder}}">门店收款</view> <view class="only-select-text" wx:if="{{orderInfo.resetOrder}}">门店收款</view>
<view wx:else class="switch-box"> <view wx:else class="switch-box">
<view class="block text-center {{ orderInfo.payType==1?'':'right' }}" /> <view class="block text-center {{ orderInfo.payType==1?'':'right' }}" />
<view class="left text-center {{ orderInfo.payType == 1?'active':'' }}" bindtap="changePayType" data-payType="1">线上支付</view> <view class="left text-center {{ orderInfo.payType == 1?'active':'' }}" bindtap="changePayType" data-payType="1">线上支付</view>
<view class="right text-center {{ orderInfo.payType == 2?'active':'' }}" bindtap="changePayType" data-payType="2">门店收款</view> <view class="right text-center {{ orderInfo.payType == 2?'active':'' }}" bindtap="changePayType" data-payType="2">门店收款</view>
</view> </view>
</gl-cell> </gl-cell>
<view class="box"> <view class="box">
<view class="title remarkTitle">备注</view> <view class="title remarkTitle">备注</view>
<van-field type="textarea" maxlength="30" autosize class="inputBox" border="{{ false }}" data-hold-keyboard value="{{ orderInfo.notes }}" data-attrName="notes" placeholder="请输入(30字以内)" data-attrType="" bindinput="handleInput"> <van-field type="textarea" maxlength="30" autosize class="inputBox" border="{{ false }}" data-hold-keyboard value="{{ orderInfo.notes }}" data-attrName="notes" placeholder="请输入(30字以内)" data-attrType="" bindinput="handleInput">
......
...@@ -44,17 +44,21 @@ module.exports = { ...@@ -44,17 +44,21 @@ module.exports = {
goodsOrderOutputValueBelong(data) { goodsOrderOutputValueBelong(data) {
return api.post('dj.api.smartcarlife.goodsOrderOutputValueBelong.listOutputValue', data) return api.post('dj.api.smartcarlife.goodsOrderOutputValueBelong.listOutputValue', data)
}, },
/** 首页统计数据 */ /** 首页统计数据 */
userStat(data) { userStat(data) {
return api.post('dj.api.smartcarlife.user.stat', data) return api.post('dj.api.smartcarlife.user.stat', data)
}, },
/** 查询当周员工日报是否填写列表 */ /** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) { staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data) return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data)
}, },
/** 查询该店员工日报是否开启 */ /** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) { staffDailyReportMerchantValid(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data) return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
} },
/** 员工是否需要推送开单预警 */
orderStaffValid(data) {
return api.post('dj.api.smartcarlife.order.staff.valid', data)
}
} }
...@@ -577,6 +577,63 @@ Page({ ...@@ -577,6 +577,63 @@ Page({
} }
} }
}, },
checkStaffOrderStatus() {
let dateStaffPop = wx.$storage.get('dateStaffPop')
let nowDate = new Date().format('yyyy-MM-dd')
// let num = 0
// 当天已查询过
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// num = dateStaffPop?.num || 0
// num = num + 1
// num = 1
return
}
console.log(api, 'checkStaffOrderStatus');
api.orderStaffValid({}).then((result) => {
console.log(result);
if (result.data) {
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: '开单预警',
content: '您已超过三天未开单',
showCancel: false,
// cancelText: '取消', // '取消
cancelColor: '#292D33',
confirmText: '确定',
confirmColor: '#347BFF',
success(res) {
// if (res.confirm) {
// wx.$router.go('tabWorkOrder.staffDaily', {
// reportDate: hasNeedReport.date
// })
// }
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
}
wx.$storage.set('dateStaffPop', {
date: new Date().format('yyyy-MM-dd'),
// num
})
// else {
// num = num + 1
// }
// if (result) {
// }
}).catch((err) => {
});
},
checkDailyRecport() { checkDailyRecport() {
let { tabIndex } = this.data let { tabIndex } = this.data
const isStaff = app.globalData.isStaff const isStaff = app.globalData.isStaff
...@@ -596,6 +653,7 @@ Page({ ...@@ -596,6 +653,7 @@ Page({
}) })
} }
this.checkDailyRecport() this.checkDailyRecport()
this.checkStaffOrderStatus()
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -723,7 +781,7 @@ Page({ ...@@ -723,7 +781,7 @@ Page({
// return item // return item
// }) // })
// timeBean // timeBean
let dateStaffPop = wx.$storage.get('dateStaffPop') // let dateStaffPop = wx.$storage.get('dateStaffPop')
// 判断 有没有填写日报 // 判断 有没有填写日报
let hasNeedReport = timeBean.weekDayList.find((item, index) => { let hasNeedReport = timeBean.weekDayList.find((item, index) => {
// item.hasDailyValue = // item.hasDailyValue =
...@@ -731,13 +789,13 @@ Page({ ...@@ -731,13 +789,13 @@ Page({
}) })
console.log(hasNeedReport, 'hasNeedReport') console.log(hasNeedReport, 'hasNeedReport')
let nowDate = new Date().format('yyyy-MM-dd') let nowDate = new Date().format('yyyy-MM-dd')
let num = 0 // let num = 0
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) { // if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
num = dateStaffPop?.num || 0 // num = dateStaffPop?.num || 0
num = num + 1 // num = num + 1
} else { // } else {
num = num + 1 // num = num + 1
} // }
// num <= 2 // num <= 2
if (hasNeedReport && isStaff) { if (hasNeedReport && isStaff) {
// if (num <= 2) { // if (num <= 2) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!