Commit 13be0965 by zhangxw

施工单改造

1 parent 11c17b93
...@@ -561,4 +561,12 @@ module.exports = { ...@@ -561,4 +561,12 @@ module.exports = {
{ bucketName: bucketName, systemSource: systemSource } { bucketName: bucketName, systemSource: systemSource }
); );
}, },
// 获取园区店施工单出库支持的方式
getQueryScanConfigByYq(data) {
return api.post("dj.api.scenemerchantref.queryScanConfigByYq", data);
},
// 扫码出库查询结果
getScanRecognizeReduce(data) {
return api.post("dj.api.smartcarlife.scan.recognize.reduce", data)
}
}; };
...@@ -101,6 +101,8 @@ ...@@ -101,6 +101,8 @@
"name": "tabRepairOrder", "name": "tabRepairOrder",
"pages": [ "pages": [
"pages/confirmWorkOrder/confirmWorkOrder", "pages/confirmWorkOrder/confirmWorkOrder",
"pages/constructionComplete/constructionComplete",
"pages/goodsOutbound/goodsOutbound",
"pages/repairOrderDetail/repairOrderDetail" "pages/repairOrderDetail/repairOrderDetail"
] ]
}, },
......
<!-- components/InventoryInfo/InventoryInfo.wxml --> <!-- components/InventoryInfo/InventoryInfo.wxml -->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="inventory-info-container" wx:if="{{isShowing}}"> <view class="inventory-info-container" wx:if="{{isShowing}}">
<view class="overlay" bindtap="onClose"></view> <view class="overlay" bindtap="onClose"></view>
<view class="popup"> <view class="popup">
......
...@@ -59,16 +59,6 @@ ...@@ -59,16 +59,6 @@
</block> </block>
</view> </view>
</view> </view>
<view class="box ">
<view class="title">
施工状态
</view>
<view class="list-box endbox">
<block wx:for="{{form.statusList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}} {{item.disabled ?'disabled':''}}" bindtap="choose" data-list-name="statusList" data-index="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
</view> </view>
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn clear text-center" bindtap="reset">清除</view> <view class="btn clear text-center" bindtap="reset">清除</view>
......
...@@ -12,10 +12,34 @@ Page({ ...@@ -12,10 +12,34 @@ Page({
0: '待领单', 0: '待领单',
1: '待出库', 1: '待出库',
2: '待完工', 2: '待完工',
3: '已完工' 3: '已完工',
4: '部分出库',
5: '部分完工',
6: '已返工'
}, },
tabList: ['全部', '已施工', '待施工'], constructionInnerColor: {
tabListTemplate: ['全部', '已施工', '待施工'], 0: '#FF9D0A',
1: '#FF9D0A',
2: '#FF9D0A',
3: '#35C376',
4: '#347BFF',
5: '#5842EB',
6: '#F24724'
},
constructionStatus: {
0: '待施工',
1: '已施工',
2: '客户返工',
4: '部分施工'
},
constructionStatusColor: {
0: '#FF9D0A',
1: '#35C376',
2: '#F24724',
4: '#347BFF'
},
tabList: ['全部', '待施工', '部分施工', '已施工', '客户返工'],
tabListTemplate: ['全部', '待施工', '部分施工', '已施工', '客户返工'],
show_confirm: false, // 筛选弹窗页面 show_confirm: false, // 筛选弹窗页面
showRendering: false, /// 筛选页面日期选择组件加载缓慢 进入页面先不做筛选页加载 showRendering: false, /// 筛选页面日期选择组件加载缓慢 进入页面先不做筛选页加载
searchObj: {}, searchObj: {},
...@@ -24,35 +48,7 @@ Page({ ...@@ -24,35 +48,7 @@ Page({
searchKey: '', searchKey: '',
list: [], list: [],
userInfo: null, userInfo: null,
orderObj: [ orderObj: []
{
label: '技师姓名',
key: 'technicianName',
arr: [
'mainTechnicianName',
'subTechnicianName_1',
'subTechnicianName_2'
],
arrSplit: '/'
},
{
label: '施工时间',
key: 'startTime'
},
{
label: '转化人员',
arr: ['sellerMerchantName', 'sellerName'],
arrSplit: '|'
},
{
label: '客户姓名',
key: 'customerName'
},
{
label: '支付时间',
key: 'successTime'
}
]
}, },
syncUserContext(done) { syncUserContext(done) {
...@@ -111,7 +107,7 @@ Page({ ...@@ -111,7 +107,7 @@ Page({
searchObj.statusList = e.detail || '' searchObj.statusList = e.detail || ''
this.setData( this.setData(
{ {
tabIndex: tabIndex > 2 ? 0 : tabIndex, tabIndex,
searchObj searchObj
}, },
() => { () => {
...@@ -171,9 +167,10 @@ Page({ ...@@ -171,9 +167,10 @@ Page({
const statusObj = { const statusObj = {
// 施工状态映射关系 0-待施工,1-已施工,2-客户返工 // 施工状态映射关系 0-待施工,1-已施工,2-客户返工
'': '', '': '',
1: 1, 1: 0,
2: 0, 2: 4,
3: 2 3: 1,
4: 2
} }
let { searchObj, searchKey, userInfo } = this.data let { searchObj, searchKey, userInfo } = this.data
let obj = { let obj = {
...@@ -191,7 +188,7 @@ Page({ ...@@ -191,7 +188,7 @@ Page({
}, },
getWorkList() { getWorkList() {
// this.showLoading && this.showLoading("加载中..."); // this.showLoading && this.showLoading("加载中...");
let { pageNum, constructionInnerStatus } = this.data let { pageNum, constructionInnerStatus, constructionStatusColor, constructionStatus, constructionInnerColor } = this.data
const obj = this.getParams() const obj = this.getParams()
api.getRepairOrderList({ ...obj, pageNum }).then(res => { api.getRepairOrderList({ ...obj, pageNum }).then(res => {
wx.$util.hideLoading() wx.$util.hideLoading()
...@@ -204,31 +201,14 @@ Page({ ...@@ -204,31 +201,14 @@ Page({
val.startTime = new Date(val.startTime).format( val.startTime = new Date(val.startTime).format(
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
if (val.successTime) if (val.createdDate)
val.successTime = new Date(val.successTime).format( val.createdDate = new Date(val.createdDate).format(
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
val.statuscolor = val.constructionStatusColor = constructionStatusColor[val.constructionStatus]
val.constructionStatus == 1 || val.constructionStatus == 2 val.constructionStatusText = constructionStatus[val.constructionStatus]
? '#347BFF'
: val.constructionStatus == 0
? '#FF9D0A'
: ''
val.statusbackground =
val.constructionStatus == 1 || val.constructionStatus == 2
? '#EAF1FF'
: val.constructionStatus == 0
? '#FFF5E6'
: ''
val.statusText =
val.constructionStatus == 1
? '已施工'
: val.constructionStatus == 0
? '待施工'
: val.constructionStatus == 2
? '客户返工'
: ''
val.customerName = val.customer?.customerName val.customerName = val.customer?.customerName
val.standNo = val.standNo
val.mainTechnicianName = val.mainTechnicianList?.find( val.mainTechnicianName = val.mainTechnicianList?.find(
v => v.technicianType == 0 v => v.technicianType == 0
)?.technicianName // 主技师 )?.technicianName // 主技师
...@@ -240,6 +220,9 @@ Page({ ...@@ -240,6 +220,9 @@ Page({
val.subTechnicianName_2 = subTechnicianName_2 val.subTechnicianName_2 = subTechnicianName_2
val.constructionInnerStatusText = val.constructionInnerStatusText =
constructionInnerStatus[val.constructionInnerStatus] constructionInnerStatus[val.constructionInnerStatus]
val.constructionInnerColor = constructionInnerColor[val.constructionInnerStatus]
val.goodsCount = Array.isArray(val.subOrderList) ? val.subOrderList.length : 0
val.serviceCount = Array.isArray(val.serviceItemsDetailList) ? val.serviceItemsDetailList.length : 0
}) })
list = data.list list = data.list
total = data.total total = data.total
...@@ -262,15 +245,15 @@ Page({ ...@@ -262,15 +245,15 @@ Page({
let { tabList, tabListTemplate } = this.data let { tabList, tabListTemplate } = this.data
const obj = this.getParams() const obj = this.getParams()
// 切换tab或状态值在tabList中,无需传参施工状态 // 切换tab或状态值在tabList中,无需传参施工状态
if (obj.constructionStatus != 2) { // if (obj.constructionStatus != 2) {
delete obj.constructionStatus // delete obj.constructionStatus
} // }
api api
.statByStatus(obj) .statByStatus({...obj, constructionStatus: undefined})
.then(result => { .then(result => {
let { data, code } = result let { data, code } = result
if (code == 0) { if (code == 0) {
const labelList = ['allTotal', 'completeTotal', 'incompleteTotal'] const labelList = ['allTotal', 'incompleteTotal', 'partialTotal', 'completeTotal', 'reworkTotal']
labelList.map((item, index) => { labelList.map((item, index) => {
tabList[index] = { tabList[index] = {
text: tabListTemplate[index], text: tabListTemplate[index],
...@@ -289,7 +272,7 @@ Page({ ...@@ -289,7 +272,7 @@ Page({
jump(e) { jump(e) {
let { target } = e.currentTarget.dataset let { target } = e.currentTarget.dataset
let jumpUrl = let jumpUrl =
target?.electronicFlag == 1 ? 'repairOrderDetail' : 'confirmWorkOrder' target?.constructionInnerStatus == 0 ? 'confirmWorkOrder' : 'repairOrderDetail'
// navigateTo 时本页 onHide 可能早于子页入栈,不能用页面栈判断是否在打开详情 // navigateTo 时本页 onHide 可能早于子页入栈,不能用页面栈判断是否在打开详情
this._openingRepairSubPage = true this._openingRepairSubPage = true
wx.$router.go(`tabRepairOrder.${jumpUrl}`, { wx.$router.go(`tabRepairOrder.${jumpUrl}`, {
......
...@@ -96,40 +96,101 @@ page { ...@@ -96,40 +96,101 @@ page {
padding: var(--fontSize32); padding: var(--fontSize32);
position: relative; position: relative;
.car-name { .card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--fontSize16);
}
.card-title {
flex: 1 1 auto;
min-width: 0;
color: #292D33; color: #292D33;
font-weight: 500; font-weight: 600;
font-size: var(--fontSize32); font-size: var(--fontSize32);
}
.card-status {
flex: 0 0 auto;
display: flex; display: flex;
align-items: center; align-items: center;
max-width: var(--fontSize512); }
.pay-status { .card-status__pill {
margin-left: var(--fontSize16); display: flex;
height: var(--fontSize26); align-items: center;
font-size: var(--fontSize18); justify-content: center;
border: var(--fontSize2) solid #F24724; height: var(--fontSize44);
border-radius: var(--fontSize4); line-height: var(--fontSize44);
padding: 0 var(--fontSize4); padding: 0 var(--fontSize16);
color: #F24724; border-radius: var(--fontSize8);
font-size: var(--fontSize24);
font-weight: 500;
white-space: nowrap;
box-sizing: border-box;
} }
.payed { .card-status__split {
color: #35C376; width: 2rpx;
border: var(--fontSize2) solid #35C376; height: 28rpx;
background: #292d331a;
} }
.card-body {
margin-top: var(--fontSize20);
} }
.status { .row {
position: absolute; display: flex;
font-size: var(--fontSize24); align-items: center;
font-weight: 500; font-size: var(--fontSize28);
top: var(--fontSize32); margin-bottom: var(--fontSize16);
right: var(--fontSize32);
height: var(--fontSize44); &:last-child {
background: #F0F0F0; margin-bottom: 0;
border-radius: var(--fontSize4); }
padding: 0 var(--fontSize8); }
.row-label {
flex: 0 0 var(--fontSize144);
color: #999EA8;
}
.row-value {
flex: 1 1 auto;
min-width: 0;
color: #292D33;
}
.card-footer {
margin-top: var(--fontSize28);
display: flex;
align-items: center;
gap: var(--fontSize40);
font-size: var(--fontSize28);
color: #999EA8;
}
.footer-item {
flex: 1 1 0;
min-width: 0;
display: flex;
align-items: baseline;
gap: var(--fontSize16);
}
.footer-label {
flex-shrink: 0;
}
.footer-value {
color: #292D33;
font-weight: 600;
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.order-list { .order-list {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<image src="/images/search.png" class="search-icon" /> <image src="/images/search.png" class="search-icon" />
<input <input
type="text" type="text"
placeholder="客户姓名/转化人员/技师姓名/服务项目名称/车型/商品名称" placeholder="客户姓名/技师姓名/转化人员姓名/车架号/施工单号"
class="input" class="input"
value="{{ searchKey }}" value="{{ searchKey }}"
placeholder-class="input-placeholder" placeholder-class="input-placeholder"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</view> </view>
</view> </view>
</view> </view>
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{ tabIndex }}" /> <tab-bar tabList="{{ tabList }}" scroll bindclick="tabClick" activeIndex="{{ tabIndex }}" />
</view> </view>
<block wx:if="{{ flag }}"> <block wx:if="{{ flag }}">
<scroll-view <scroll-view
...@@ -46,97 +46,56 @@ ...@@ -46,97 +46,56 @@
<block wx:for="{{ list }}" wx:key="index"> <block wx:for="{{ list }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind"> <block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view class="item content" catchtap="jump" data-target="{{ li }}"> <view class="item content" catchtap="jump" data-target="{{ li }}">
<view class="status text-center" style="color:{{ li.statuscolor }};background-color:{{li.statusbackground }};">{{li.statusText }}</view> <view class="card-header">
<view class="car-name text-hide"> <view class="card-title text-hide">
<view class="name-text text-hide">{{li.customer.carSeriesName || '无车型客户'}}</view> {{li.customer.carSeriesName || '无车型客户'}}
<view class="pay-status {{ li.orderStatus != 2 ? 'payed' : '' }}">{{li.orderStatus == 2 ? '战败' : '已支付'}}</view>
</view>
<view class="order-list">
<block wx:for="{{ orderObj }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order">
<view class="order-label">{{i.label}}</view>
<view class="order-value">
<block wx:if="{{ i.arr }}">
<block wx:for="{{ i.arr }}" wx:key="sindex" wx:for-index="arr_index" wx:for-item="k">
<view
class="order-value-item text-hide"
style="max-width: {{ li['subTechnicianName_2'] ? '33%' : li['subTechnicianName_1'] ? '50%' : '100%' }};"
wx:if="{{ li[k] }}"
>
<block wx:if="{{ arr_index < i.arr.length && arr_index > 0 }}">
<text class="split">{{i.arrSplit}}</text>
</block>
{{li[k]}}
</view> </view>
</block> <view class="card-status">
</block> <view class="card-status__pill" style="color:{{ li.constructionStatusColor }};">
<block wx:else>{{li[i.key] || ''}}</block> <text>{{li.constructionStatusText}}</text>
</view> </view>
<view class="card-status__split"></view>
<view class="card-status__pill" style="color:{{ li.constructionInnerColor }};">
<text>{{li.constructionInnerStatusText}}</text>
</view> </view>
</block>
</view> </view>
<view class="goods-list">
<block wx:if="{{ li.subOrderList.length }}">
<view class="goods-tag">商品</view>
<view style="flex: 1;width: calc(100% - var(--fontSize76));">
<block wx:for="{{ li.subOrderList }}" wx:key="sindex" wx:for-item="i" wx:for-index="sindex">
<view class="goods" hidden="{{ li.showAllGoodsListFlag ? false : sindex > 2 }}">
<view class="goods-name">
{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || i.packageName||''}}
</view> </view>
<view class="right"> <view class="card-body">
<view wx:if="{{ i.materialsUsed }}">{{i.materialsUsed}}米/件</view> <view class="row">
<view class="count" wx:if="{{ i.number }}">x{{i.number}}</view> <view class="row-label">施工单号</view>
<view class="row-value text-hide">{{li.constructionCode}}</view>
</view> </view>
<view class="row">
<view class="row-label">技师姓名</view>
<view class="row-value text-hide">
{{li.mainTechnicianName}}{{li.subTechnicianName_1 ? '/' + li.subTechnicianName_1 : ''}}{{li.subTechnicianName_2 ? '/' + li.subTechnicianName_2 : ''}}
</view> </view>
</block>
<block wx:if="{{ li.subOrderList.length > 3 }}">
<view class="more-btn">
<text catch:tap="showAllList" data-item="{{ li }}" data-type="goods">{{li.showAllGoodsListFlag ? '收起' : '查看全部'}}</text>
(共{{li.subOrderList.length}}件)
</view> </view>
</block> <view class="row">
<view class="row-label">客户姓名</view>
<view class="row-value text-hide">{{li.customerName}}</view>
</view> </view>
</block> <view class="row">
<view class="row-label">车架号</view>
<view class="row-value text-hide">{{li.standNo || '-'}}</view>
</view> </view>
<view class="service-list {{ !li.serviceItemsDetailList.length ? 'empty-list' : '' }}"> <view class="row">
<block wx:if="{{ li.serviceItemsDetailList.length }}"> <view class="row-label">派单时间</view>
<view class="service-tag">服务</view> <view class="row-value text-hide">{{li.createdDate}}</view>
<view style="width: calc(100% - var(--fontSize80));">
<block wx:for="{{ li.serviceItemsDetailList }}" wx:key="sindex" wx:for-item="i" wx:for-index="sindex">
<view class="services" wx:if="{{ li.showAllServiceListFlag || sindex <= 2 }}">
<view class="services-name text-hide">{{i.itemsConfigName}}-{{i.serviceItemsName}}</view>
<view class="counr" wx:if="{{ i.useNum }}">x{{i.useNum}}</view>
</view> </view>
</block>
<block wx:if="{{ li.serviceItemsDetailList.length > 3 }}">
<view class="more-btn">
<text catch:tap="showAllList" data-item="{{ li }}" data-type="service">{{li.showAllServiceListFlag ? '收起' : '查看全部'}}</text>
(共{{li.serviceItemsDetailList.length}}个服务)
</view> </view>
</block> <view class="card-footer">
<view class="footer-item">
<view class="footer-label">商品</view>
<view class="footer-value">{{li.goodsCount}}</view>
</view> </view>
</block> <view class="footer-item">
<block wx:else> <view class="footer-label">服务项目</view>
<image src="{{ IMG_URL }}repair-order/repair-order-empty.png" mode="" /> <view class="footer-value">{{li.serviceCount}}</view>
暂无数据
</block>
</view> </view>
<view class="duration"> <view class="footer-item">
<text class="label">总施工时长</text> <view class="footer-label">驻店</view>
<block> <view class="footer-value text-hide">{{li.sellerName || '-'}}</view>
{{li.constructionDuration !== null && li.constructionDuration !== undefined ? li.constructionDuration : '-'}}
<text class="unit">分钟</text>
</block>
<view class="constructionInnerStatus {{ li.constructionInnerStatus == 3 ? 'flagged' : '' }}">
<image class="flag" wx:if="{{ li.constructionInnerStatus == 3 }}" src="{{ IMG_URL }}miniProgram/constructionFlaged.png" mode="" />
<image
class="flag"
wx:if="{{ li.constructionInnerStatus != 3 }}"
src="{{ IMG_URL }}miniProgram/constructionFlaging.png"
mode=""
/>
{{li.constructionInnerStatusText}}
</view> </view>
</view> </view>
</view> </view>
......
...@@ -1051,31 +1051,31 @@ Page({ ...@@ -1051,31 +1051,31 @@ Page({
// 弹窗 // 弹窗
const noticeItem = data.list[0]; const noticeItem = data.list[0];
// 根据类型取到对应的值 // 根据类型取到对应的值
const { message, ...dialogParams } = dialogOptions[serviceCenterEnum][noticeItem.reminderType || 1]; // const { message, ...dialogParams } = dialogOptions[serviceCenterEnum][noticeItem.reminderType || 1];
this.addModalToQueue(dialogParams.title, message(noticeItem.msgTitle), dialogParams.confirmButtonText, false, 10, async (res) => { // this.addModalToQueue(dialogParams.title, message(noticeItem.msgTitle), dialogParams.confirmButtonText, false, 10, async (res) => {
wx.$util.showLoading(); // wx.$util.showLoading();
try { // try {
if (dialogParams.type === ServerCenterEnum.longCourse) { // if (dialogParams.type === ServerCenterEnum.longCourse) {
const { data } = await getCompanyNoticeDetail({ id: noticeItem.id }); // const { data } = await getCompanyNoticeDetail({ id: noticeItem.id });
wx.navigateTo({ // wx.navigateTo({
url: `/packageStudyCenter/pages/taskDetail/longCourse/longCourse?row=${encodeURIComponent(JSON.stringify(data.msgDetail))}&form=serviceCenter`, // url: `/packageStudyCenter/pages/taskDetail/longCourse/longCourse?row=${encodeURIComponent(JSON.stringify(data.msgDetail))}&form=serviceCenter`,
fail: (err) => { // fail: (err) => {
console.error("页面跳转失败:", err); // console.error("页面跳转失败:", err);
}, // },
}); // });
} // }
if (dialogParams.type === ServerCenterEnum.case) { // if (dialogParams.type === ServerCenterEnum.case) {
wx.$router.go("tabWorkOrder.caseDetail", { caseId: noticeItem.id }); // wx.$router.go("tabWorkOrder.caseDetail", { caseId: noticeItem.id });
} // }
if (dialogParams.type === ServerCenterEnum.companyNotice) { // if (dialogParams.type === ServerCenterEnum.companyNotice) {
wx.$router.go("tabWorkOrder.companyNoticeDetail", { id: noticeItem.id }); // wx.$router.go("tabWorkOrder.companyNoticeDetail", { id: noticeItem.id });
} // }
} finally { // } finally {
wx.$util.hideLoading(); // wx.$util.hideLoading();
} // }
}); // });
break; break;
} }
} }
......
...@@ -302,9 +302,18 @@ Component({ ...@@ -302,9 +302,18 @@ Component({
errorMsg: '' errorMsg: ''
}) })
const today = new Date() const today = new Date()
const defaultTime = this.parseDefaultTime()
const todayEnd = new Date(today.getFullYear(), today.getMonth(), today.getDate())
let endDay = todayEnd
if (defaultTime?.year && defaultTime?.month && defaultTime?.day) {
const defaultEnd = new Date(defaultTime.year, defaultTime.month - 1, defaultTime.day)
if (!isNaN(defaultEnd.getTime()) && defaultEnd.getTime() > todayEnd.getTime()) {
endDay = defaultEnd
}
}
this.getDateList( this.getDateList(
'2019/01/01', '2019/01/01',
new Date(today.getFullYear(), today.getMonth(), today.getDate()) endDay
) )
}, },
......
...@@ -39,6 +39,8 @@ var activeNum = function (array, subKey) { ...@@ -39,6 +39,8 @@ var activeNum = function (array, subKey) {
if (item.active) { if (item.active) {
if (item.useNum) { if (item.useNum) {
count = count + Number(item.useNum) count = count + Number(item.useNum)
} else {
count = count + 1
} }
} }
} }
......
...@@ -18,21 +18,48 @@ Page({ ...@@ -18,21 +18,48 @@ Page({
stock: '' stock: ''
}, },
IMG_URL, IMG_URL,
confirmInfo: {}, confirmInfo: {
goodsObj: [ customer: {},
subOrderList: [],
serviceItemsList: []
},
currentTab: 'goods',
serviceCount: 0,
canEditTechnician: false,
baseInfoObj: [
{ {
label: '工单编号', label: '施工单号',
key: 'orderCode' key: 'constructionCode',
copy: true
},
{
label: '关联主订单',
key: 'orderCode',
copy: true
}, },
{ {
label: '客户姓名', label: '客户姓名',
key: 'customerName', key: 'customerName',
subObj: 'customer' subObj: 'customer',
copy: true
}, },
{ {
label: '客户车型', label: '客户车型',
key: 'customerCarName', key: 'customerCarName',
subObj: 'customer' subObj: 'customer'
},
{
label: '车架号',
key: 'standNo',
copy: true
},
{
label: '驻店',
key: 'sellerName'
},
{
label: '派单时间',
key: 'createdDate'
} }
], ],
positionTypeList: [], positionTypeList: [],
...@@ -127,8 +154,8 @@ Page({ ...@@ -127,8 +154,8 @@ Page({
console.log(res) console.log(res)
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
this.setData({ this.setData({ userPermissions: data || [] }, () => {
userPermissions: data || [] this.updateTechnicianEditable()
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
...@@ -148,6 +175,10 @@ Page({ ...@@ -148,6 +175,10 @@ Page({
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
let { code, data, message } = res let { code, data, message } = res
data = data || {}
data.customer = data.customer || {}
data.subOrderList = Array.isArray(data.subOrderList) ? data.subOrderList : []
data.serviceItemsList = Array.isArray(data.serviceItemsList) ? data.serviceItemsList : []
const mainSelected = data?.mainTechnicianList const mainSelected = data?.mainTechnicianList
?.filter(val => val.technicianType == 0) ?.filter(val => val.technicianType == 0)
?.map(it => { ?.map(it => {
...@@ -183,23 +214,78 @@ Page({ ...@@ -183,23 +214,78 @@ Page({
data.customer.customerCarName = data.customer.carSeriesName data.customer.customerCarName = data.customer.carSeriesName
? `${data.customer.carBrand}-${data.customer.carChildsBrandName}-${data.customer.carSeriesName}` ? `${data.customer.carBrand}-${data.customer.carChildsBrandName}-${data.customer.carSeriesName}`
: '' : ''
if (data.startTime) data.customer.vinStr =
data.startTime = new Date(data.startTime).format( data.customer.vin ||
'yyyy-MM-dd hh:mm:ss' data.customer.frameNo ||
) data.customer.carVin ||
if (data.endTime) data.customer.vinCode ||
data.endTime = new Date(data.endTime).format('yyyy-MM-dd hh:mm:ss') ''
data.storeName =
data.merchantName ||
data.shopMerchantName ||
data.customer.merchantName ||
data.customer.shopMerchantName ||
''
const serviceCount = this._calcServiceCount(data.serviceItemsList || [])
if (data.createdDate) {
data.createdDate = new Date(data.createdDate).format('yyyy-MM-dd hh:mm:ss')
}
data?.subOrderList?.forEach(val => {
})
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
mainSelected, mainSelected,
deputySelected, deputySelected,
confirmInfo: data || {} confirmInfo: data || {},
serviceCount
}, () => {
this.updateTechnicianEditable()
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
}) })
}, },
hasPermission(key) {
const list = this.data.userPermissions || []
return Array.isArray(list) && list.some(v => v && v.code == key)
},
updateTechnicianEditable() {
const status = this.data.confirmInfo?.constructionStatus
const statusOk = status === 0 || status === '0' || status === null || status === undefined
const can = statusOk && this.hasPermission('SHIGONGQUEREN')
if (can === this.data.canEditTechnician) return
this.setData({ canEditTechnician: can })
},
_calcServiceCount(serviceItemsList) {
return (serviceItemsList || []).reduce((acc, group) => {
const count = Array.isArray(group?.detailList) ? group.detailList.length : 0
return acc + count
}, 0)
},
switchTab(e) {
const { tab } = e.currentTarget.dataset
if (!tab) return
this.setData({
currentTab: tab
})
},
setCopyData(e) {
const { content } = e.currentTarget.dataset
if (!content) return
wx.setClipboardData({
data: String(content),
success: () => {
wx.$util.showToast('已复制')
}
})
},
handleCancel() {
wx.switchTab({
url: '/pages/tabRepairOrder/pages/index/index'
})
},
// 获取技师数据 // 获取技师数据
getTechnicianList() { getTechnicianList() {
let { userInfo } = this.data let { userInfo } = this.data
...@@ -296,6 +382,7 @@ Page({ ...@@ -296,6 +382,7 @@ Page({
}, },
showPopup(e) { showPopup(e) {
if (!this.data.canEditTechnician) return
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
this.setData({ this.setData({
technicianMultiple: type == 'deputy', technicianMultiple: type == 'deputy',
...@@ -405,7 +492,8 @@ Page({ ...@@ -405,7 +492,8 @@ Page({
// 将修改后的商品数据赋值给confirmInfo // 将修改后的商品数据赋值给confirmInfo
this.setData({ this.setData({
['confirmInfo.serviceItemsList']: editServicesList, ['confirmInfo.serviceItemsList']: editServicesList,
editServiceFlag: false editServiceFlag: false,
serviceCount: this._calcServiceCount(editServicesList)
}) })
}, },
// 选择服务项目弹窗 // 选择服务项目弹窗
...@@ -415,7 +503,8 @@ Page({ ...@@ -415,7 +503,8 @@ Page({
// 选择服务项目弹窗确定 // 选择服务项目弹窗确定
handleSelectServiceConfirm(e) { handleSelectServiceConfirm(e) {
this.setData({ this.setData({
editServicesList: e.detail editServicesList: e.detail,
serviceCount: this._calcServiceCount(e.detail)
}) })
this.handleSelectServiceCancel() this.handleSelectServiceCancel()
}, },
...@@ -477,15 +566,15 @@ Page({ ...@@ -477,15 +566,15 @@ Page({
return return
// return // return
wx.showModal({ // wx.showModal({
title: '是否确认生成电子施工单', // title: '是否确认生成电子施工单',
content: // content:
'请确认客户商品有无增减,服务项目是否完整。提交后不可修改客户商品、技师、服务项目', // '请确认客户商品有无增减,服务项目是否完整。提交后不可修改客户商品、技师、服务项目',
confirmText: '确认提交', // confirmText: '确认提交',
confirmColor: '#347BFF', // confirmColor: '#347BFF',
cancelText: '返回', // cancelText: '返回',
complete: res => { // complete: res => {
if (res.confirm) { // if (res.confirm) {
const subOrderList = confirmInfo?.subOrderList?.map(val => { const subOrderList = confirmInfo?.subOrderList?.map(val => {
return { return {
subOrderCode: val.subOrderCode subOrderCode: val.subOrderCode
...@@ -580,9 +669,9 @@ Page({ ...@@ -580,9 +669,9 @@ Page({
}) })
}, 1000) }, 1000)
}) })
} // }
} // }
}) // })
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
"technician-select-popup" : "/components/TechnicianSelectPopup/TechnicianSelectPopup", "technician-select-popup" : "/components/TechnicianSelectPopup/TechnicianSelectPopup",
"select-service-popup": "../../components/servicePopup/index" "select-service-popup": "../../components/servicePopup/index"
}, },
"navigationBarTitleText": "施工单确认" "navigationBarTitleText": "领取施工单"
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,61 +14,268 @@ page { ...@@ -14,61 +14,268 @@ page {
padding: var(--fontSize32) 0; padding: var(--fontSize32) 0;
overflow: hidden; overflow: hidden;
.title { .box {
.box-item {
display: flex;
align-items: center;
justify-content: flex-start;
padding: 0 var(--fontSize40);
font-size: var(--fontSize28);
box-sizing: border-box;
margin-bottom: 16rpx;
&:last-child{
margin-bottom: 0;
}
.label {
flex-shrink: 0;
width: var(--fontSize140);
color: #999EA8;
margin-right: 32rpx;
}
.value {
flex: 1 1 auto;
min-width: 0;
text-align: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #292D33;
}
.copy {
flex-shrink: 0;
margin-left: var(--fontSize16);
width: var(--fontSize48);
display: flex;
align-items: center;
justify-content: flex-end;
.copy-icon {
width: var(--fontSize32);
height: var(--fontSize32);
display: block;
}
}
}
}
.btn-box {
margin: var(--fontSize32) var(--fontSize44) 0;
display: flex;
align-items: center;
justify-content: center;
color: #347BFF;
font-weight: 500;
border: var(--fontSize2) solid #347BFF;
border-radius: var(--fontSize12);
padding: var(--fontSize22);
font-size: var(--fontSize32);
image {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize8);
flex-shrink: 0;
}
}
.techic-value {
display: flex;
align-items: center;
justify-content: flex-end;
flex-wrap: wrap;
}
}
.order {
padding-bottom: 0;
}
}
.card-title,
.section-title {
padding: 0 var(--fontSize32);
font-size: var(--fontSize32);
font-weight: 500;
color: #222222;
}
.base-info {
padding-bottom: 0;
.card-title {
padding-bottom: var(--fontSize12);
}
}
.staff-card {
.staff-header {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 var(--fontSize32); padding: 0 var(--fontSize32);
}
.staff-title {
font-size: var(--fontSize32); font-size: var(--fontSize32);
font-weight: 500; font-weight: 500;
color: #222222; color: #222222;
display: flex;
align-items: baseline;
gap: var(--fontSize12);
}
.edit-btn { .staff-subtitle {
font-size: var(--fontSize26); font-size: var(--fontSize24);
color: #347BFF; color: #999EA8;
font-weight: 400;
}
.staff-edit {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: var(--fontSize26);
color: #347BFF;
image { image {
width: var(--fontSize28); width: var(--fontSize28);
height: var(--fontSize28); height: var(--fontSize28);
margin-right: var(--fontSize8); margin-right: var(--fontSize8);
} }
.cancel {
margin-right: var(--fontSize24);
}
} }
.staff-list {
margin-top: var(--fontSize24);
} }
.box { .staff-row {
.box-item {
height: var(--fontSize116);
border-bottom: var(--fontSize1) solid #EFF0F2;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
padding: 0 var(--fontSize40); padding: 0 var(--fontSize40);
font-size: var(--fontSize28); font-size: var(--fontSize28);
box-sizing: border-box;
margin-bottom: 16rpx;
&:last-child{
margin-bottom: 0;
}
}
.label { .staff-label {
flex-shrink: 0; flex: 0 0 var(--fontSize144);
width: var(--fontSize140); color: #999EA8;
margin-right: 32rpx;
}
.staff-name {
max-width: 320rpx;
min-width: 0;
color: #292D33; color: #292D33;
text-align: right;
} }
.value { .staff-name.is-placeholder {
color: #BEC1C7;
}
.staff-rate {
flex: 0 0 auto;
color: #347BFF;
font-weight: 400;
min-width: 80rpx;
text-align: right; text-align: right;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
} }
.staff-arrow {
width: 28rpx;
height: 28rpx;
margin-left: 12rpx;
flex-shrink: 0;
opacity: 0.7;
}
.staff-row.editable {
padding-right: var(--fontSize32);
}
.staff-right {
flex: 1 1 auto;
min-width: 0;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8rpx;
}
}
.tabs {
margin: 0 var(--fontSize20);
display: flex;
align-items: center;
gap: var(--fontSize40);
padding: var(--fontSize20) var(--fontSize20) 0;
}
.tab-item {
position: relative;
padding-bottom: var(--fontSize16);
font-size: var(--fontSize28);
color: #5A5E66;
}
.tab-item.active {
color: #347BFF;
font-weight: 600;
}
.tab-item.active::after {
content: '';
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: var(--fontSize60);
height: var(--fontSize6);
background: #347BFF;
border-radius: var(--fontSize4);
}
.tab-content {
padding-top: var(--fontSize20);
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--fontSize32);
margin-top: 0;
}
.section-title {
padding: 0;
}
.edit-btn {
font-size: var(--fontSize26);
color: #347BFF;
display: flex;
align-items: center;
image {
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize8);
}
.cancel {
margin-right: var(--fontSize24);
} }
}
.order-goods { .order-goods {
font-size: var(--fontSize28); font-size: var(--fontSize28);
.label { .label {
...@@ -77,23 +284,21 @@ page { ...@@ -77,23 +284,21 @@ page {
} }
.goods-box { .goods-box {
margin: 0 var(--fontSize8); margin: 0 var(--fontSize32);
padding: 0;
padding: var(--fontSize24);
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #292D33; color: #292D33;
.goods-item { .goods-item {
border-radius: var(--fontSize12); margin-top: 16rpx;
padding: 24rpx 24rpx 24rpx 42rpx; border-radius: 0;
padding: 24rpx 24rpx 24rpx 52rpx;
background: #F7F8FA; background: #F7F8FA;
margin-bottom: var(--fontSize16); margin-bottom: 0;
position: relative; position: relative;
// padding-left: var(--fontSize32);
display: flex; display: flex;
// align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1rpx solid #EFF0F2;
.inventory { .inventory {
font-size: 24rpx; font-size: 24rpx;
...@@ -101,7 +306,7 @@ page { ...@@ -101,7 +306,7 @@ page {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-top: 12rpx; margin-top: 8rpx;
} }
&::after { &::after {
...@@ -109,7 +314,7 @@ page { ...@@ -109,7 +314,7 @@ page {
width: var(--fontSize12); width: var(--fontSize12);
height: var(--fontSize12); height: var(--fontSize12);
top: 44rpx; top: 44rpx;
left: 15rpx; left: 24rpx;
transform: translateY(-50%); transform: translateY(-50%);
content: ''; content: '';
background: #347BFF; background: #347BFF;
...@@ -117,7 +322,7 @@ page { ...@@ -117,7 +322,7 @@ page {
} }
&:last-child { &:last-child {
margin-bottom: 0; border-bottom: none;
} }
.count { .count {
...@@ -139,7 +344,7 @@ page { ...@@ -139,7 +344,7 @@ page {
padding: var(--fontSize24); padding: var(--fontSize24);
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #292D33; color: #292D33;
margin-bottom: var(--fontSize16); margin-top: var(--fontSize16);
image { image {
width: var(--fontSize32); width: var(--fontSize32);
...@@ -152,10 +357,9 @@ page { ...@@ -152,10 +357,9 @@ page {
width: calc(100% - var(--fontSize52)); width: calc(100% - var(--fontSize52));
} }
} }
} }
}
.service-box { .service-box {
.title { .title {
padding: var(--fontSize24) var(--fontSize40) var(--fontSize8); padding: var(--fontSize24) var(--fontSize40) var(--fontSize8);
font-size: var(--fontSize28); font-size: var(--fontSize28);
...@@ -247,45 +451,14 @@ page { ...@@ -247,45 +451,14 @@ page {
text-align: right; text-align: right;
} }
} }
}
.btn-box {
margin: var(--fontSize32) var(--fontSize44) 0;
display: flex;
align-items: center;
justify-content: center;
color: #347BFF;
font-weight: 500;
border: var(--fontSize2) solid #347BFF;
border-radius: var(--fontSize12);
padding: var(--fontSize22);
font-size: var(--fontSize32);
image {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize8);
flex-shrink: 0;
}
}
.techic-value {
display: flex;
align-items: center;
justify-content: flex-end;
}
}
.order {
padding-bottom: 0;
}
} }
.isFullSucreen-btn { .isFullSucreen-btn {
padding-bottom: 34px !important; padding-bottom: 34px !important;
} }
.btns { .bottom-bar {
position: fixed; position: fixed;
left: 0; left: 0;
width: 100%; width: 100%;
...@@ -301,18 +474,32 @@ page { ...@@ -301,18 +474,32 @@ page {
z-index: 99; z-index: 99;
flex-direction: column; flex-direction: column;
.btns-con { .bottom-bar__con {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
gap: var(--fontSize24);
padding: var(--fontSize10) 0; padding: var(--fontSize10) 0;
width: calc(100% - var(--fontSize80)); width: calc(100% - var(--fontSize80));
.confirm { .btn {
width: 100%;
border: var(--fontSize2) solid #0075F9;
border-radius: var(--fontSize12); border-radius: var(--fontSize12);
height: var(--fontSize80); height: var(--fontSize80);
box-sizing: border-box; box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.btn.cancel {
width: 186rpx;
border: var(--fontSize2) solid #D7DAE0;
color: #292D33;
background: #FFFFFF;
}
.btn.primary {
flex: 1;
border: var(--fontSize2) solid #0075F9;
color: #fff; color: #fff;
background-color: #347BFF; background-color: #347BFF;
} }
......
const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import api from '../../api'
Page({
data: {
IMG_URL,
isReworkOrder: false,
backParams: null,
reworkVisible: false,
reworkReturnNum: '',
reworkReason: '',
maxReturnText: '-',
reworkSubmitting: false,
rawInfo: null,
reworkConstructionCode: '-',
reworkReturnNumDisplay: '-',
reworkTime: '-',
reworkReasonDisplay: '-'
},
onLoad(options) {
this.setData(
{
queryOptions: options || {}
},
() => {
this.getDetail()
}
)
},
getDetail() {
const queryOptions = this.data.queryOptions || {}
if (!queryOptions.id || !queryOptions.constructionCode) return
wx.showLoading({ title: '加载中' })
api
.getConstructionDetail({
id: queryOptions.id,
constructionCode: queryOptions.constructionCode,
subOrderCode: queryOptions.subOrderCode
})
.then((res) => {
wx.hideLoading()
const { code, data, message } = res || {}
if (code != 0) {
wx.$util.showToast(message || '详情获取失败')
return
}
let firstSub =
(data?.subOrderList && data.subOrderList[0]) ||
(data?.suborderList && data.suborderList[0]) ||
{}
if (firstSub.startTime) firstSub.startTime = new Date(firstSub.startTime).format('yyyy-MM-dd hh:mm:ss')
if (firstSub.endTime) firstSub.endTime = new Date(firstSub.endTime).format('yyyy-MM-dd hh:mm:ss')
if (firstSub.completedTime) firstSub.completedTime = new Date(firstSub.completedTime).format('yyyy-MM-dd hh:mm:ss')
if (firstSub.reworkTime) firstSub.reworkTime = new Date(firstSub.reworkTime).format('yyyy-MM-dd hh:mm:ss')
this.setData({
goodsInfo: firstSub,
orderInfo: data,
isReworkOrder: !((firstSub.reworkConstructionCode ?? '') === '')
})
})
.catch(() => {
wx.hideLoading()
})
},
onPreviewImg(e) {
const { index } = e.currentTarget.dataset
let { goodsInfo } = this.data
const list = goodsInfo.subItemPictures?.map(val => val.pictureUrl) || []
console.log(list)
if (!list.length) return
wx.previewImage({
urls: list,
current: list[index] || list[0]
})
},
onBackDetail() {
const pages = getCurrentPages ? getCurrentPages() : []
const prev = pages.length >= 2 ? pages[pages.length - 2] : null
const prevRoute = prev?.route || ''
const fromOutbound = /tabRepairOrder\/pages\/goodsOutbound\/goodsOutbound/i.test(prevRoute)
const delta = fromOutbound ? 2 : 1
if (pages.length > delta) {
wx.navigateBack({ delta })
return
}
wx.navigateBack({ delta: 1 })
},
onRework() {
if (this.data.isReworkOrder) return
this.setData({
reworkVisible: true,
reworkReturnNum: '',
reworkReason: ''
})
},
onReworkCancel() {
this.setData({
reworkVisible: false
})
},
normalizeNumberString(value, precision) {
const raw = value === null || value === undefined ? '' : String(value)
const cleaned = raw.replace(/[^\d.]/g, '')
if (!cleaned) return ''
const parts = cleaned.split('.')
let intPart = parts[0] || '0'
let decimalPart = parts.slice(1).join('')
if (intPart.length > 1) intPart = intPart.replace(/^0+/, '') || '0'
if (precision <= 0) return intPart
if (decimalPart) decimalPart = decimalPart.slice(0, precision)
if (decimalPart) return `${intPart}.${decimalPart}`
if (cleaned.includes('.') && raw.endsWith('.')) return `${intPart}.`
return intPart
},
clampNumberString(value, max, precision) {
if (value === '') return ''
const num = Number(value)
if (Number.isNaN(num)) return ''
if (num < 0) return '0'
if (num > max) return this.normalizeNumberString(String(max), precision)
return value
},
onReworkReturnInput(e) {
const rawMax = Number(this.data.goodsInfo?.materialsUsed || 0)
const precision = 2
const normalized = this.normalizeNumberString(e.detail?.value, precision)
const max = Number.isFinite(rawMax) ? rawMax : 0
const clamped = this.clampNumberString(normalized, max, precision)
this.setData({
reworkReturnNum: clamped
})
},
onReworkReasonInput(e) {
this.setData({
reworkReason: e.detail?.value || ''
})
},
onReworkConfirm() {
let { orderInfo } = this.data
if (this.data.reworkSubmitting) return
const reworkReturnNum = String(this.data.reworkReturnNum || '').trim()
const reworkReason = String(this.data.reworkReason || '').trim()
if (reworkReturnNum === '') return wx.$util.showToast('退料入库数量不能为空')
const num = Number(reworkReturnNum)
if (Number.isNaN(num)) return wx.$util.showToast('请输入正确的退料入库数量')
if (num < 0) return wx.$util.showToast('退料入库数量不能小于0')
const rawMax = Number(this.data.goodsInfo?.materialsUsed || 0)
const max = Number.isFinite(rawMax) ? rawMax : 0
if (num > max) return wx.$util.showToast('退料入库数量不能超过最大可退数')
if (!reworkReason) return wx.$util.showToast('请输入返工原因')
const subOrders = orderInfo?.subOrderList?.map(val => {
return {
id: val.id,
subOrderCode: val.subOrderCode,
upgradeGoodsId: val.upgradeGoodsId,
materialsUsed: this.data.reworkReturnNum,
rollNumber: val.rollNumber,
uniqueCodeList: val.uniqueCodeList
}
})
const params = {
id: orderInfo.id,
constructionCode: orderInfo.constructionCode,
subOrderList: subOrders,
remark: this.data.reworkReason,
}
this.setData({
reworkSubmitting: true
})
api.reworkAPI(params).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
wx.$util.showToast('返工成功')
wx.$router.redirectTo('confirmWorkOrder', {
id: data
})
} else {
wx.$util.showToast(message || '返工失败')
}
}).finally(() => {
setTimeout(() => {
this.setData({
reworkSubmitting: false
})
}, 500)
})
}
})
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index"
},
"navigationBarTitleText": "商品出库"
}
/* tabRepairOrder/pages/constructionComplete/index.wxss */
page {
background: #F7F8FA;
}
.page {
padding: var(--fontSize20);
padding-bottom: calc(var(--fontSize160) + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.result-head {
display: flex;
flex-direction: column;
align-items: center;
padding: var(--fontSize20) 0 var(--fontSize12);
.icon-wrap {
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
background: #EAF7EE;
display: flex;
align-items: center;
justify-content: center;
}
.icon {
width: 128rpx;
height: 128rpx;
}
.title {
margin-top: var(--fontSize16);
font-size: 40rpx;
font-weight: 600;
color: #292D33;
}
.sub {
margin-top: var(--fontSize8);
font-size: var(--fontSize28);
color: #5A5E66;
max-width: 600rpx;
}
}
.card {
background: #FFFFFF;
border-radius: var(--fontSize16);
box-shadow: 0 var(--fontSize6) var(--fontSize16) 0 #cdcdd159;
padding: var(--fontSize24) 0;
margin-top: var(--fontSize20);
overflow: hidden;
}
.card-title {
padding: 0 var(--fontSize32) var(--fontSize16);
font-size: var(--fontSize32);
font-weight: 600;
color: #292D33;
}
.info-list {
padding: 0 var(--fontSize32);
.info-row {
display: flex;
align-items: center;
font-size: var(--fontSize28);
box-sizing: border-box;
margin-bottom: 16rpx;
&.align-top {
align-items: flex-start;
padding: 18rpx 0;
}
.label {
flex: 0 0 200rpx;
color: #999EA8;
}
.value {
color: #292D33;
text-align: right;
}
}
}
.time-line {
display: flex;
align-items: center;
justify-content: flex-end;
margin-bottom: 12rpx;
&:last-child {
margin-bottom: 0;
}
.dot {
width: 10rpx;
height: 10rpx;
border-radius: 5rpx;
background: #347BFF;
margin-right: 12rpx;
flex-shrink: 0;
}
.time-text {
color: #292D33;
font-size: var(--fontSize28);
}
}
.imgs {
padding: 0 var(--fontSize32);
display: flex;
gap: var(--fontSize16);
.img {
width: 196rpx;
height: 196rpx;
border-radius: var(--fontSize12);
overflow: hidden;
background: #F4F5F7;
}
}
.bottom-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #FFFFFF;
padding: var(--fontSize20) var(--fontSize24) calc(var(--fontSize10) + env(safe-area-inset-bottom));
display: flex;
gap: var(--fontSize20);
box-sizing: border-box;
border-top: 1rpx solid #EFF0F2;
.btn {
flex: 1;
height: 88rpx;
border-radius: var(--fontSize12);
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize30);
font-weight: 600;
box-sizing: border-box;
}
.ghost {
border: 2rpx solid #D9DDE3;
color: #292D33;
background: #FFFFFF;
}
.danger {
border: 2rpx solid #F24724;
color: #F24724;
background: #FFFFFF;
}
}
.bottom-bar.single {
.btn {
flex: 1;
}
}
.rework-popup {
height: 100%;
display: flex;
flex-direction: column;
padding: 0 var(--fontSize32);
box-sizing: border-box;
}
.rework-title {
height: var(--fontSize110);
line-height: var(--fontSize110);
font-size: var(--fontSize32);
font-weight: 600;
text-align: center;
}
.rework-goods {
margin-top: 24rpx;
padding: var(--fontSize24);
background: #F7F8FA;
border-radius: 6px;
}
.goods-summary {
display: flex;
align-items: center;
}
.bullet {
width: var(--fontSize12);
height: var(--fontSize12);
border-radius: 100%;
background: #347BFF;
margin-right: var(--fontSize16);
flex-shrink: 0;
}
.goods-title {
flex: 1 1 auto;
min-width: 0;
font-size: var(--fontSize28);
color: #292D33;
font-weight: 500;
}
.goods-multi {
flex: 0 0 auto;
font-size: var(--fontSize24);
color: #999EA8;
margin-left: var(--fontSize12);
}
.goods-item__desc {
margin-top: 8rpx;
margin-left: 28rpx;
font-size: var(--fontSize24);
color: #999EA8;
}
.rework-form {
flex: 1 1 auto;
overflow: auto;
padding-bottom: var(--fontSize24);
}
.form-item {
margin-top: var(--fontSize24);
}
.form-label {
font-size: var(--fontSize28);
color: #292D33;
font-weight: 500;
}
.form-input-wrap {
margin-top: var(--fontSize16);
height: 88rpx;
border: 1rpx solid #E8E8EA;
border-radius: var(--fontSize12);
background: #FFFFFF;
padding: 0 var(--fontSize24);
display: flex;
align-items: center;
box-sizing: border-box;
}
.form-input {
flex: 1 1 auto;
min-width: 0;
height: 88rpx;
line-height: 88rpx;
font-size: var(--fontSize28);
color: #292D33;
}
.form-unit {
flex: 0 0 auto;
margin-left: var(--fontSize12);
font-size: var(--fontSize28);
color: #999EA8;
}
.form-tip {
margin-top: var(--fontSize12);
font-size: var(--fontSize24);
color: #BEC1C7;
}
.form-textarea-wrap {
margin-top: var(--fontSize16);
min-height: 192rpx;
border: 1rpx solid #E8E8EA;
border-radius: var(--fontSize12);
background: #FFFFFF;
padding: var(--fontSize20) var(--fontSize24);
box-sizing: border-box;
}
.form-textarea {
width: 100%;
min-height: 180rpx;
font-size: var(--fontSize28);
color: #292D33;
}
.warn {
margin-top: var(--fontSize24);
background: #FFF6E9;
border-radius: var(--fontSize12);
padding: var(--fontSize16) var(--fontSize20);
display: flex;
align-items: flex-start;
gap: var(--fontSize12);
box-sizing: border-box;
}
.warn-icon {
width: var(--fontSize32);
height: var(--fontSize32);
flex-shrink: 0;
margin-top: 2rpx;
}
.warn-text {
flex: 1 1 auto;
min-width: 0;
font-size: var(--fontSize24);
color: #FF9D0A;
line-height: 36rpx;
}
.rework-footer {
flex: 0 0 auto;
padding: var(--fontSize16) 0;
display: flex;
gap: var(--fontSize20);
background: #FFFFFF;
}
.rework-footer .btn {
flex: 1;
height: 88rpx;
border-radius: var(--fontSize12);
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize30);
font-weight: 600;
box-sizing: border-box;
}
.rework-footer .btn.disabled {
opacity: 0.6;
}
.rework-footer .ghost {
border: 2rpx solid #D9DDE3;
color: #292D33;
background: #FFFFFF;
}
.rework-footer .danger {
border: 2rpx solid #F24724;
color: #F24724;
background: #FFFFFF;
}
.required {
color: #EB4E4E;
margin-left: 4px;
}
<view class="page">
<view class="result-head">
<view class="icon-wrap">
<image class="icon" src="{{ IMG_URL }}icon-success.png" mode="aspectFit" />
</view>
<view class="title">施工完成!</view>
<view class="sub text-hide">{{ goodsName }}</view>
</view>
<view class="card">
<view class="card-title">商品信息</view>
<view class="info-list">
<view class="info-row">
<view class="label">数量</view>
<view class="value">{{ goodsInfo.materialsUsed }}米/件</view>
</view>
<view class="info-row">
<view class="label">剩余库存</view>
<view class="value">{{ goodsInfo.stock || '-' }}</view>
</view>
<view class="info-row">
<view class="label">UID</view>
<view class="value text-hide">{{ goodsInfo.upgradeGoodsCommodityCode || '-' }}</view>
</view>
<view class="info-row">
<view class="label">产品编码</view>
<view class="value text-hide">{{ goodsInfo.upgradeGoodsCustomCode || '-' }}</view>
</view>
<view class="info-row">
<view class="label">规格</view>
<view class="value text-hide">{{ goodsInfo.specification || '-' }}</view>
</view>
</view>
</view>
<view class="card">
<view class="card-title">出库信息</view>
<view class="info-list">
<view class="info-row">
<view class="label">出库数量</view>
<view class="value">{{ goodsInfo.materialsUsed }}</view>
</view>
<view class="info-row">
<view class="label">出库备注</view>
<view class="value text-hide">{{ goodsInfo.outboundRemark || '-' }}</view>
</view>
<view class="info-row align-top">
<view class="label">施工时间</view>
<view class="value">
<view class="time-line">
<view class="dot"></view>
<view class="time-text">{{ goodsInfo.startTime }}</view>
</view>
<view class="time-line">
<view class="dot" style="background: #35C376;"></view>
<view class="time-text">{{ goodsInfo.endTime }}</view>
</view>
</view>
</view>
<view class="info-row">
<view class="label">操作时间</view>
<view class="value">{{ goodsInfo.completedTime || '-' }}</view>
</view>
</view>
</view>
<view class="card" wx:if="{{ isReworkOrder }}">
<view class="card-title">返工信息</view>
<view class="info-list">
<view class="info-row">
<view class="label">返工施工单</view>
<view class="value text-hide">{{ goodsInfo.reworkConstructionCode }}</view>
</view>
<view class="info-row">
<view class="label">退料入库数</view>
<view class="value">{{ goodsInfo.refundQuantity }}米/件</view>
</view>
<view class="info-row">
<view class="label">返工时间</view>
<view class="value">{{ goodsInfo.reworkTime }}</view>
</view>
<view class="info-row">
<view class="label">返工原因</view>
<view class="value text-hide">{{ goodsInfo.remark }}</view>
</view>
</view>
</view>
<view class="card">
<view class="card-title">施工图片</view>
<view class="imgs">
<block wx:for="{{ goodsInfo.subItemPictures }}" wx:key="index">
<image class="img" src="{{ item.pictureUrl }}" mode="aspectFill" bindtap="onPreviewImg" data-index="{{ index }}" />
</block>
</view>
</view>
<view class="bottom-bar" wx:if="{{ !isReworkOrder }}">
<view class="btn ghost" bindtap="onBackDetail">返回详情</view>
<view class="btn danger" bindtap="onRework">发起返工</view>
</view>
<view class="bottom-bar single" wx:else>
<view class="btn ghost" bindtap="onBackDetail">返回施工单详情</view>
</view>
<van-popup
show="{{ reworkVisible }}"
position="bottom"
round
closeable
close-on-click-overlay="{{ true }}"
bind:close="onReworkCancel"
custom-style="height: 85%;"
>
<view class="rework-popup">
<view class="rework-title">发起返工</view>
<view class="rework-goods">
<view class="goods-summary">
<view class="bullet"></view>
<view class="goods-title text-hide">{{ goodsInfo.upgradeGoodsName }}</view>
<view class="goods-multi">x{{ goodsInfo.number }}</view>
</view>
<view class="goods-item__desc text-hide">
库存{{ goodsInfo.stock !== undefined && goodsInfo.stock !== null && goodsInfo.stock !== '' ? (goodsInfo.stock + '米/件') : '-' }}
</view>
</view>
<view class="rework-form">
<view class="form-item">
<view class="form-label">退料入库数量<text class="required">*</text></view>
<view class="form-input-wrap">
<input class="form-input" type="digit" value="{{ reworkReturnNum }}" placeholder="输入数字" placeholder-style="color:#BEC1C7;" bindinput="onReworkReturnInput" />
<view class="form-unit">米/件</view>
</view>
<view class="form-tip">最大可退数:{{ goodsInfo.materialsUsed }}米/件</view>
</view>
<view class="form-item">
<view class="form-label">返工原因<text class="required">*</text></view>
<view class="form-textarea-wrap">
<textarea class="form-textarea" maxlength="200" value="{{ reworkReason }}" placeholder="请输入(200字以内)" placeholder-style="color:#BEC1C7;" bindinput="onReworkReasonInput"></textarea>
</view>
</view>
<view class="warn">
<image class="warn-icon" src="{{ IMG_URL }}zy_tips_icon.png" mode="aspectFit" />
<view class="warn-text">发起返工后,将生成新的返工施工单,原商品标记为返工</view>
</view>
</view>
<view class="rework-footer">
<view class="btn ghost" bindtap="onReworkCancel">取消</view>
<view class="btn danger {{ reworkSubmitting ? 'disabled' : '' }}" bindtap="onReworkConfirm">确认返工</view>
</view>
</view>
</van-popup>
</view>
{
"usingComponents": {
"time-select": "../../components/timeSelect/index"
},
"navigationBarTitleText": "商品出库"
}
...@@ -145,6 +145,8 @@ var activeNum = function (array, subKey) { ...@@ -145,6 +145,8 @@ var activeNum = function (array, subKey) {
if (item.active) { if (item.active) {
if (item.useNum) { if (item.useNum) {
count = count + Number(item.useNum) count = count + Number(item.useNum)
} else {
count = count + 1
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!