Commit d464455b authored by 高铭波's avatar 高铭波

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

# Conflicts:
#	src/pages/order/document.vue
parents 9212b6f8 d20fe5d0
...@@ -5,11 +5,11 @@ const UNI_APP = { ...@@ -5,11 +5,11 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
apiUrl: 'http://192.168.1.22', //java端域名请求头 apiUrl: 'http://192.168.0.62:37080', //java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头 // apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/', qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/', qn_asset_url: 'http://deudn.c.pp.cc/',
argoDebugMode: 1 argoDebugMode: 1
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
(function () { (function () {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null; let ENV_VAR = null;
let VERSION_NUMBER = '1.3.1';//版本号 let VERSION_NUMBER = '1.3.2';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
...@@ -119,6 +119,11 @@ let orderApiFun = function(vm){ ...@@ -119,6 +119,11 @@ let orderApiFun = function(vm){
*/ */
let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/info'); let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/info');
/**
* 完工项阶段下一步
*/
let completeNextStep= async (params = {}, orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/nextStep', params);
/** /**
* 查询措施 * 查询措施
*/ */
...@@ -172,6 +177,10 @@ let orderApiFun = function(vm){ ...@@ -172,6 +177,10 @@ let orderApiFun = function(vm){
let otherUser = async (params = {}) => await vm.$u.get(prefix + 'other/auth/' + vm.vuex_token + '/other/user', params); let otherUser = async (params = {}) => await vm.$u.get(prefix + 'other/auth/' + vm.vuex_token + '/other/user', params);
// 是否添加客服 // 是否添加客服
let checkAddCustomer = async (params = {}) => await vm.$u.get(prefix + 'order/revision/' + vm.vuex_token + '/checkAddCustomer', params); let checkAddCustomer = async (params = {}) => await vm.$u.get(prefix + 'order/revision/' + vm.vuex_token + '/checkAddCustomer', params);
// 工单文件标签
let fileLabel = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file/lable/', params);
// 工单文件列表
let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
...@@ -212,7 +221,10 @@ let orderApiFun = function(vm){ ...@@ -212,7 +221,10 @@ let orderApiFun = function(vm){
workerApplyPay, workerApplyPay,
allowLogin, allowLogin,
otherUser, otherUser,
checkAddCustomer checkAddCustomer,
fileLabel,
fileList,
completeNextStep
} }
return orderApi return orderApi
} }
......
...@@ -88,7 +88,8 @@ const install = (Vue, vm) => { ...@@ -88,7 +88,8 @@ const install = (Vue, vm) => {
// return result; // return result;
case 200: case 200:
return { return {
data:result.data == null ? result : result.data, // result.data的值为0, false, ''的时候也要算有值 // data:result.data == null ? result : result.data, // result.data的值为0, false, ''的时候也要算有值
data:result.data,
code:code, code:code,
message:msg message:msg
}; };
......
...@@ -9,38 +9,49 @@ ...@@ -9,38 +9,49 @@
mode="center" mode="center"
width="690rpx"> width="690rpx">
<view class="slot-content"> <view class="slot-content">
<view class="check-status"> <view v-if="confirmButtonText !== '确定'">
<u-image width="224rpx" height="224rpx" :src="statusImage"></u-image> <view class="check-status">
<text :class="['status-txt', { 'pass-color': pass }]">{{statusTxt}}</text> <u-image width="224rpx" height="224rpx" :src="statusImage"></u-image>
</view> <text :class="['status-txt', { 'pass-color': pass }]">{{statusTxt}}</text>
<view class="check-list">
<view class="u-flex u-row-between list-title">
<view class="left-txt">验证项</view>
<view>已提交/需提交</view>
<view class="right-txt">结果</view>
</view> </view>
<view class="u-flex u-row-between list-item" <view class="check-list">
v-for="(item, index) in listData" :key="index"> <view class="u-flex u-row-between list-title">
<view class="item-txt left-txt" style="width: 160rpx;text-align: left;"> <view class="left-txt">验证项</view>
<u-icon <view>已提交/需提交</view>
:name="item.pass ? passIcon : noPassIcon" <view class="right-txt">结果</view>
:label="item.label"
margin-left="12"
label-color="#333333"
label-size="28"
size="32"></u-icon>
</view> </view>
<view class="item-txt">{{item.submitted}}/{{item.required}}</view> <view class="u-flex u-row-between list-item"
<view v-for="(item, index) in listData" :key="index">
:class="['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']" <view class="item-txt left-txt" style="width: 200rpx;text-align: left;">
style="width: 160rpx;text-align: right;"> <u-icon
{{item.pass ? "通过" : "未通过"}} :name="item.pass ? passIcon : noPassIcon"
:label="item.label"
margin-left="12"
label-color="#333333"
label-size="28"
size="32"></u-icon>
</view>
<view class="item-txt">{{item.submitted}}/{{item.required}}</view>
<view
:class="['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style="width: 160rpx;text-align: right;">
{{item.pass ? "通过" : "未通过"}}
</view>
</view> </view>
</view> </view>
</view> </view>
<view v-else>
<view class="check-status">
<text class='status-txt' style="color: #333;">确认安装结果</text>
</view>
<view class="u-flex no-install">
<text class="tips">提交信息,确认安装结论为不安装</text>
</view>
</view>
<view class="check-bottom"> <view class="check-bottom">
<view class="button cancel" v-show="!pass" @tap="cancel">取消</view> <view class="button cancel" v-show="cancelButtonText !== ''" @tap="cancel">{{ cancelButtonText }}</view>
<view class="button confirm" @tap="confirm">{{confirmText}}</view> <view class="button confirm" @tap="confirm">{{ confirmButtonText }}</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
...@@ -79,6 +90,14 @@ ...@@ -79,6 +90,14 @@
{label: '安装信息', submitted: 15, required: 20, pass: false} {label: '安装信息', submitted: 15, required: 20, pass: false}
] ]
} }
},
confirmButtonText: {
type: String,
default: '确定'
},
cancelButtonText: {
type: String,
default: ''
} }
}, },
data() { data() {
...@@ -104,9 +123,6 @@ ...@@ -104,9 +123,6 @@
statusTxt() { statusTxt() {
return this.pass ? "完工校验已通过" : "完工校验未通过" return this.pass ? "完工校验已通过" : "完工校验未通过"
}, },
confirmText() {
return this.pass ? "确定" : "去处理"
},
passIcon() { return process.uniEnv.qn_base_url + 'icon/pass.png'}, passIcon() { return process.uniEnv.qn_base_url + 'icon/pass.png'},
noPassIcon() { return process.uniEnv.qn_base_url + 'icon/no-pass.png'}, noPassIcon() { return process.uniEnv.qn_base_url + 'icon/no-pass.png'},
}, },
...@@ -115,14 +131,7 @@ ...@@ -115,14 +131,7 @@
this.$emit('close') this.$emit('close')
}, },
confirm() { confirm() {
if(this.pass) { this.$emit('confirm')
this.$emit('change')
} else {
let data = this.listData.find((item, index) => {
return item.pass == false;
})
this.$emit('handle', data)
}
} }
}, },
...@@ -161,6 +170,15 @@ ...@@ -161,6 +170,15 @@
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
} }
.no-install {
justify-content: center;
align-items: center;
height: 200rpx;
border-top: 2rpx solid #F4F5F7;
.tips {
font-size: 28rpx;
}
}
.check-bottom { .check-bottom {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -194,7 +212,7 @@ ...@@ -194,7 +212,7 @@
line-height: 32rpx; line-height: 32rpx;
} }
.left-txt { .left-txt {
width: 160rpx; width: 200rpx;
text-align: left; text-align: left;
} }
.right-txt { .right-txt {
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
line-height: 50rpx; line-height: 50rpx;
max-width: 46%; max-width: 46%;
align-items: center; align-items: center;
&.active{ &.active{
background-color: #2272FF; background-color: #2272FF;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="file-box"> <view class="file-box">
<view class="pics u-flex u-flex-wrap"> <view class="pics u-flex u-flex-wrap">
<view class="img-list" v-for="(item,index) in imgList" :key="index"> <view class="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)"></u-image> <u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)" fade lazy-load ></u-image>
<view class="icon-del-box" @click.stop="delFile(index)"> <view class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view> <view class="icon-del"></view>
<view class="icon-del rotate"></view> <view class="icon-del rotate"></view>
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
<template> <template>
<view :style="{'width': fieldsWidth}"> <view :style="{'width': fieldsWidth}">
<u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle" <u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" hold-keyboard/> :custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" :disabled="isDisabled" hold-keyboard/>
<view class="content" v-if="slotContent">
<text class="txt">{{ slotContent }}</text>
</view>
</view> </view>
</template> </template>
...@@ -26,42 +29,18 @@ ...@@ -26,42 +29,18 @@
type: { type: {
type: String, type: String,
default: 'text' default: 'text'
},
slotContent: {
type: String,
default: ''
} }
// width: { // 例如:454rpx
// type: String,
// default: '100%'
// }
}, },
data() { data() {
return { return {
inputType: 'text', inputType: 'text'
// type: 'text'
} }
}, },
computed: { computed: {
// type() {
// if (this.item) {
// let ty = this.item.fieldsType.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// return 'textarea'
// case 'password':
// return this.item.fieldsType
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// this.maxlength = 9
// return 'digit'
// case 'textarea':
// default:
// return 'text'
// }
// } else {
// return 'text'
// }
// },
maxlength() { maxlength() {
return this.type == 'digit' ? 9 : 140 return this.type == 'digit' ? 9 : 140
}, },
...@@ -89,6 +68,9 @@ ...@@ -89,6 +68,9 @@
}, },
backgroundColor() { backgroundColor() {
return this.textarea ? 'transparent' : '#F4F5F7' return this.textarea ? 'transparent' : '#F4F5F7'
},
isDisabled() {
return this.item.fieldsId === 254 || this.disabled ? true : false
} }
}, },
watch: {}, watch: {},
...@@ -97,8 +79,16 @@ ...@@ -97,8 +79,16 @@
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.input-item{ .input-item{
background: #F4F5F7; background: #F4F5F7;
} }
.content {
padding-top: 20rpx;
line-height: 45rpx;
.txt {
font-size: 24rpx;
color: #999;
}
}
</style> </style>
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
mounted() {}, mounted() {},
methods: { methods: {
setValue(txt){ setValue(txt){
if (this.disabled) return
this.dataValue = txt this.dataValue = txt
this.valueChange(txt) this.valueChange(txt)
} }
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
line-height: 50rpx; line-height: 50rpx;
max-width: 46%; max-width: 46%;
align-items: center; align-items: center;
&.active{ &.active{
background-color: #2272FF; background-color: #2272FF;
......
...@@ -326,10 +326,10 @@ ...@@ -326,10 +326,10 @@
{ {
"path": "document", "path": "document",
"style": { "style": {
"navigationBarTitleText": "资料文件", "navigationBarTitleText": "安装文件",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
// "disableScroll": true "disableScroll": true
} }
} }
] ]
......
...@@ -949,7 +949,7 @@ export default { ...@@ -949,7 +949,7 @@ export default {
/* position: absolute; */ /* position: absolute; */
position: relative; position: relative;
border-radius: 12rpx; border-radius: 12rpx;
margin-top: 60rpx; margin-top: 80rpx;
} }
.title { .title {
......
...@@ -301,6 +301,7 @@ ...@@ -301,6 +301,7 @@
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod + "&inGuaranteePeriod=" + item.inGuaranteePeriod
+ "&partnerCompanyId=" + item.partnerCompanyId + "&partnerCompanyId=" + item.partnerCompanyId
+ "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'') + "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'')
+ "&maintainStep=" + item.maintainStep
}) })
}, },
// handleAction(item) { // handleAction(item) {
......
<template> <template>
<view class="pg-complete"> <view class="pg-complete">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" :pass="pass" @close="closeCheckResult" @handle="handerProgrom" @change="confirm"></complete-check> <complete-check :show="completeCheck.status" :list-data="completeCheck.result" :pass="pass" @close="closeCheckResult" @confirm="confirm" :confirm-button-text="completeCheck.confirmText" :cancel-button-text="completeCheck.cancelText"></complete-check>
<view class="com-content"> <view class="com-content">
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息" title-bold></u-navbar> <u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" :title="list[tabIndex].panelName" title-bold></u-navbar>
<u-tabs class="order-tabs" ref="tabs" :current="current" name="panelName" :list="tabList" @change="swichMenu" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs> <u-tabs class="order-tabs" ref="tabs" :current="current" name="panelName" :list="tabList" @change="swichMenu" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs>
<view class="u-menu-wrap"> <view class="u-menu-wrap">
<!-- <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" v-if="list[tabIndex].items.length > 1 && showTab">
<view v-for="(item,index) in list[tabIndex].items" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text>
</view>
</scroll-view> -->
<scroll-view :scroll-top="scrollRightTop" style="height: 100%;" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId"> <scroll-view :scroll-top="scrollRightTop" style="height: 100%;" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId">
<u-form :model="form" ref="uForm"> <u-form :model="form" ref="uForm">
<template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"> <template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])">
<view class="class-item" :key="groupIndex"> <view class="class-item" :id="'item' + groupIndex" :key="groupIndex">
<view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view> <view class="title">{{groupItem.name}}</view>
<view class="class-bd"> <view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top" <u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`"> :prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'"> <view class="label" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'">
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}} {{item.fieldsTitle}}
</view> </view>
<template v-if="item.fieldsType"> <template v-if="item.fieldsType">
<xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType" <xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType"
:itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' @value-change="fieldValueChange"> :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="item.disabled || false" :slotContent="item.fieldsInfo" @value-change="fieldValueChange">
</xh-input> </xh-input>
<xh-multi-input v-else-if="item.formType==='multiinput'" <xh-multi-input v-else-if="item.formType==='multiinput'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-multi-input> </xh-multi-input>
<xh-radio v-else-if="item.formType==='radio'" <xh-radio v-else-if="item.formType==='radio'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="item.disabled || false" @value-change="fieldValueChange">
@value-change="fieldValueChange">
</xh-radio> </xh-radio>
<xh-checkbox v-else-if="item.formType==='checkbox'" <xh-checkbox v-else-if="item.formType==='checkbox'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
...@@ -64,10 +57,6 @@ ...@@ -64,10 +57,6 @@
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-scan> </xh-scan>
<xh-picker v-else-if="item.formType==='picker'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-picker>
<xh-service-measure v-else-if="item.formType==='servicemeasure'" <xh-service-measure v-else-if="item.formType==='servicemeasure'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId"
:orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]" :orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]"
...@@ -97,13 +86,9 @@ ...@@ -97,13 +86,9 @@
type="primary" shape="circle" :custom-style="customStyle" :hover-class="submitStatus ? '' : 'none'"> type="primary" shape="circle" :custom-style="customStyle" :hover-class="submitStatus ? '' : 'none'">
暂存 暂存
</u-button> </u-button>
<u-button class="btn-submit" @click="orderFinish" v-if="tabIndex===list.length - 1" <u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle"
type="primary" shape="circle" :custom-style="buttonStyle" :hover-class="submitStatus ? '' : 'none'">
完工
</u-button>
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle" v-else
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'"> type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
下一步 {{ tabIndex === list.length - 1 ? '提交' : '下一步' }}
</u-button> </u-button>
</view> </view>
</view> </view>
...@@ -121,7 +106,6 @@ ...@@ -121,7 +106,6 @@
import XhFiles from '@/components/createCom/XhFiles.vue' import XhFiles from '@/components/createCom/XhFiles.vue'
import XhLocation from '@/components/createCom/XhLocation.vue' import XhLocation from '@/components/createCom/XhLocation.vue'
import XhScan from '@/components/createCom/XhScan.vue' import XhScan from '@/components/createCom/XhScan.vue'
import XhPicker from '@/components/createCom/XhPicker.vue'
import XhTime from '@/components/createCom/XhTime.vue' import XhTime from '@/components/createCom/XhTime.vue'
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue' import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
import XhServiceMore from "../../components/createCom/XhServiceMore" import XhServiceMore from "../../components/createCom/XhServiceMore"
...@@ -129,7 +113,98 @@ ...@@ -129,7 +113,98 @@
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index' import baseFile from '@/components/upload/index'
import Detail from "@/components/order/detail.vue" import Detail from "@/components/order/detail.vue"
// import XhRadio from '@/components/createCom/XhRadio.vue'
// 表单类型map
const formType = new Map([
['text', ['input','textarea']],
['password', ['password','input']],
['textarea', ['input','digit']],
['number', ['input','digit']],
['decimal', ['input','digit']],
['double', ['input','digit']],
['integer', ['input','digit']],
['string', ['input','text']],
['jscode', ['input','text']],
['multiinput', ['multiinput','text']],
['select', ['select','text']],
['specifications', ['select','text']],
['radio', ['radio','text']],
['checkbox', ['checkbox','text']],
['file', ['file','text']],
['photos', ['file','text']],
['location', ['location','text']],
['scan', ['scan','text']],
['machine_code', ['scan','text']],
['service_measures', ['servicemeasure','text']],
['time', ['time','text']],
['date', ['time','text']],
['form', ['form','text']],
['label', ['label','text']],
])
/**
* modal 弹窗校验
* @description 用于校验下一步的动作
* @property {String} name 当前的订单阶段
* @property {Boolean} pass 是否通过校验
* @property {String}} type 是否有二次勘测或二次安装
* @property {submit} submit 提交或下一步
*/
const actions = (name, pass, type, submit) => {
const handerProgrom = {
perfect: {
confirmText: '去完善',
action: 'handerProgrom'
},
appointment: {
confirmText: '好的,再次预约',
action: 'appointment'
},
next: {
confirmText: '下一步',
action: 'nextAction'
},
noPerfectSubmit: {
confirmText: '去完善',
action: 'handerProgrom',
cancelText: '部分提交',
cancelAction: 'appointment'
},
submit: {
confirmText: '提交',
action: 'orderFinish',
},
confirm: {
confirmText: '确定',
action: 'nextAction',
}
}
if (name === 'partnerInspectItem') { // 勘察
if (!pass) return handerProgrom.perfect
return type ? (type === '01' ? handerProgrom.next : handerProgrom.appointment) : handerProgrom.perfect
} else if (name === 'partnerInstallItem') { // 安装
let hander = ''
switch (type){
case '01': // 安装完成
hander = !pass ? handerProgrom.perfect : handerProgrom.next
break;
case '02': // 二次安装
hander = !pass ? handerProgrom.noPerfectSubmit : handerProgrom.appointment
break;
case '03': //不安装
hander = handerProgrom.confirm
break;
default:
hander = handerProgrom.perfect
break;
}
return hander
} else { // 基础信息
if (!pass) return handerProgrom.perfect
return submit ? handerProgrom.submit : handerProgrom.next
}
}
export default { export default {
data() { data() {
return { return {
...@@ -143,7 +218,7 @@ ...@@ -143,7 +218,7 @@
tabIndex: 0, tabIndex: 0,
scrollTop: 0, //tab标题的滚动条位置 scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0, oldScrollTop: 0,
current: 0, // 预设当前项的值 current: null, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度 menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id itemId: '', // 栏目右边scroll-view用于滚动的id
...@@ -155,8 +230,14 @@ ...@@ -155,8 +230,14 @@
form: { // 一维表单 form: { // 一维表单
}, },
submitBtnStatus: false, submitBtnStatus: false,
completeCheckStatus: false, completeCheck: {
completeCheckResult: [], status: false,
resulut: [],
confirmText: '去完善',
cancelText: '',
action: '',
cancelAction: ''
},
waitHandlerPanelIndex: 0, waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0, waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0, waitHandlerEleIndex: 0,
...@@ -174,6 +255,7 @@ ...@@ -174,6 +255,7 @@
takeStatus: false, takeStatus: false,
currentItemDate:{}, currentItemDate:{},
photoItem: {}, photoItem: {},
maintainStep: 'partnerInspectItem',
// showTab: true, // showTab: true,
} }
}, },
...@@ -186,7 +268,6 @@ ...@@ -186,7 +268,6 @@
XhFiles, XhFiles,
XhLocation, XhLocation,
XhScan, XhScan,
XhPicker,
XhTime, XhTime,
XhServiceMeasure, XhServiceMeasure,
XhServiceMore, XhServiceMore,
...@@ -201,18 +282,13 @@ ...@@ -201,18 +282,13 @@
onLoad(option) { onLoad(option) {
getApp().trackPage('订单完工信息页') getApp().trackPage('订单完工信息页')
if (option) { if (option) {
if (option.pageIndex) { this.maintainStep = option.maintainStep
this.tabIndex = option.pageIndex this.orderId = option.orderId
uni.setNavigationBarTitle({ this.categoryId = option.categoryId
title: this.title this.orderServiceType = decodeURIComponent(option.orderServiceType)
}); this.inGuaranteePeriod = option.inGuaranteePeriod
} this.partnerCompanyId = option.partnerCompanyId
this.orderId = option.orderId this.auditResultsId = option.auditResultsId
this.categoryId = option.categoryId
this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId
this.auditResultsId = option.auditResultsId
// this.showTab =item.partnerCompanyName == '挚达充电桩' // this.showTab =item.partnerCompanyName == '挚达充电桩'
} else { } else {
...@@ -223,20 +299,10 @@ ...@@ -223,20 +299,10 @@
} }
this.getCompleteData() this.getCompleteData()
}, },
onReady() {
// 导航栏滚动切换
this.getMenuItemTop()
},
updated() { updated() {
//console.log(this.form.name, 'form.name') //console.log(this.form.name, 'form.name')
}, },
computed: { computed: {
pageTitles() {
return ['勘察信息', '完工信息', '基本信息']
},
title() {
return this.pageTitles[this.tabIndex]
},
tabList() { // 没有数据的时候tab要有占位数据,不然有页面有晃动 tabList() { // 没有数据的时候tab要有占位数据,不然有页面有晃动
return this.list.length > 0 ? this.list[this.tabIndex].items : [{name:''}] return this.list.length > 0 ? this.list[this.tabIndex].items : [{name:''}]
}, },
...@@ -275,11 +341,13 @@ ...@@ -275,11 +341,13 @@
}, },
methods: { methods: {
getCompleteData() {//获取工单配置的完工项目 getCompleteData() {//获取工单配置的完工项目
let self = this uni.showLoading({
if(self.orderId){ title: '加载中'
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => { })
if(this.orderId){
this.$u.api.getCompleteConfigAndData(this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
self.initData(res) this.initData(res)
} else { } else {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.message, title: res.message,
...@@ -290,100 +358,33 @@ ...@@ -290,100 +358,33 @@
} }
}, },
initData(res) { initData(res) {
for (var item of res.data.config) { this.form = res.data.value || {}
for (var i of item.items) {
for (var d of i.items) { const list = res.data.config.sort((a, b) => a.order - b.order)
var inputType = 'text' list.forEach((item, index) => {
var formType = '' if (this.maintainStep === item.panelFieldsName) this.tabIndex = index
var type = d.fieldsType.toLocaleLowerCase() item.items.forEach(v => {
switch (type) { v.items.forEach(d => {
case 'text': const type = d.fieldsType.toLocaleLowerCase()
inputType = 'textarea' const formMap = formType.get(type) || formType.get('text')
formType = 'input' d.formType = formMap[0]
break d.inputType = formMap[1]
case 'password':
inputType = 'password'
formType = 'input'
break
case 'textarea':
case 'number':
case 'decimal':
case 'double':
case 'integer':
formType = 'input'
inputType = 'digit'
break
case 'string':
formType='input',
inputType = 'text'
break
case 'multiinput':
formType = 'multiinput'
inputType = 'text'
break;
case 'select':
case 'specifications':
formType = 'select'
inputType = 'text'
break
case 'radio':
formType = 'radio'
inputType = 'text'
break
case 'checkbox':
formType = 'checkbox'
inputType = 'text'
break
case 'file':
case 'photos':
formType = 'file'
inputType = 'text'
break
case 'location':
formType = 'location'
inputType = 'text'
break
case 'scan':
case 'machine_code':
formType = 'scan'
inputType = 'text'
break
case 'picker':
case 'mutipicker':
formType = 'picker'
inputType = 'text'
break
case 'service_measures':
formType = 'servicemeasure'
inputType = 'text'
break
case 'time':
case 'date':
formType = 'time'
inputType = 'text'
break
case 'form':
formType = 'form'
inputType = 'text'
break
case 'label':
formType = 'label'
inputType = 'text'
break
}
d.formType = formType
d.inputType = inputType
if (d.fieldsId == 200 && res.data.value) { if (d.fieldsId == 200 && res.data.value) {
d.required = res.data.value['paymentMethodsType'] !='03' d.required = res.data.value['paymentMethodsType'] != '03'
} }
} if (d.fieldsId === 252 || d.fieldsId === 253) { // 申请费用计算
} this.calcMoney()
} }
this.list = res.data.config })
})
})
this.list = list
// this.showTab = this.list.length > 1 // this.showTab = this.list.length > 1
this.form = res.data.value || {} this.current = 0
// 异常单处理 // 异常单处理
if (this.auditResultsId) this.checkCompleteError() if (this.auditResultsId) this.checkCompleteError()
uni.hideLoading()
}, },
checkCompleteError() { // 异常单定位错误项 checkCompleteError() { // 异常单定位错误项
let self = this let self = this
...@@ -439,90 +440,173 @@ ...@@ -439,90 +440,173 @@
}) })
}, },
checkCompleteItem(){ checkCompleteItem(){
let self = this
let checkResult = [] let checkResult = []
let pass = true let pass = true
let first = true let first = true
self.list.forEach((panel, panelIndex)=>{ const lists = this.tabList
let panelResult = {label: panel.panelName, submitted: 0, required: 0, pass: true} lists.forEach((group, groupIndex) =>{
panel.items.forEach((group, groupIndex) =>{ const checkRequired = group.items.some(v => v.required)
if (checkRequired) {
let panelResult = {label: group.name, submitted: 0, required: 0, pass: true}
group.items.forEach((ele, eleIndex)=>{ group.items.forEach((ele, eleIndex)=>{
if(ele.required){ if(ele.required){
panelResult.required++ panelResult.required++
let value = self.form[ele.fieldsName] let value = this.form[ele.fieldsName]
if(value&&!Array.isArray(value)){ if(value&&!Array.isArray(value)){
panelResult.submitted++ panelResult.submitted++
}else if(value&&Array.isArray(value)&&value.length > 0){ }else if(value&&Array.isArray(value)&&value.length > 0){
panelResult.submitted++ panelResult.submitted++
}else if(first){// 记录第一个 为空 并且需要必填的项 用于定位 }else if(first){// 记录第一个 为空 并且需要必填的项 用于定位
first = false first = false
self.waitHandlerPanelIndex = panelIndex this.waitHandlerPanelIndex = this.tabIndex
self.waitHandlerGroupIndex = groupIndex this.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex this.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}` this.oldItemId = `item${ele.fieldsId}`
} }
} }
}) })
}) panelResult.pass = panelResult.required <= panelResult.submitted
panelResult.pass = panelResult.required <= panelResult.submitted pass = pass&&panelResult.pass
pass = pass&&panelResult.pass checkResult.push(panelResult)
checkResult.push(panelResult) }
}) })
console.log(checkResult) console.log(checkResult)
self.completeCheckResult = checkResult this.completeCheck.result = checkResult
return pass return pass
}, },
confirm(){// 检查结果窗口 确认回调 // 检查结果窗口取消回调
uni.reLaunch({ closeCheckResult(){
url: '/pages/index/order?type=3' this.completeCheck.status = false
}) this[this.completeCheck.cancelAction]()
}, },
closeCheckResult(){// 检查结果窗口取消回调 // 检查结果窗口 确认回调
this.completeCheckStatus = false confirm(){
this.completeCheck.status = false
this[this.completeCheck.action]()
}, },
handerProgrom(){// 检查结果窗口 去处理回调 定位到缺失的项 // 去完善
this.completeCheckStatus = false handerProgrom(){
this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex) this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex)
}, },
// 去预约
async appointment() {
const save = await this.nextStepSaveData()
if (save) {
uni.reLaunch({
url: '/pages/index/order?type=0'
})
}
},
// 下一步动作
async nextAction() {
const save = await this.nextStepSaveData()
if (this.tabIndex < this.list.length - 1 && save) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.current = 0
const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
this.oldItemId = ''
})
}
},
// 下一步弹窗处理
nextStep() {
this.pass = this.checkCompleteItem()
const name = this.list[this.tabIndex].panelFieldsName
const type = name === 'partnerInspectItem' ? this.form.inspectConclusionType : this.form.constructionConclusionType
const submit = this.tabIndex === this.list.length - 1
const result = actions(name, this.pass, type, submit)
this.completeCheck.status = true
this.completeCheck.confirmText = result.confirmText
this.completeCheck.action = result.action
this.completeCheck.cancelText = result.cancelText || ''
this.completeCheck.cancelAction = result.cancelAction || ''
},
// 下一步数据保存
nextStepSaveData() {
const params = {
maintainFields: this.handleSaveData(),
currentStep: this.list[this.tabIndex].panelFieldsName,
nextStep: this.list[this.tabIndex + 1].panelFieldsName,
}
return this.$u.api.completeNextStep(params, this.orderId).then((res)=>{
if (res.code == 200) {
return Promise.resolve(true)
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
return Promise.resolve(false)
}
})
},
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.$nextTick(function() {
if (this.oldItemId)this.itemId = this.oldItemId
this.getMenuItemTop()
})
},
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项 locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex this.tabIndex = panelIndex
this.arr = [] this.current = groupIndex;
this.scrollRightTop = 0; this.itemId = ''
this.current = 0;
this.$nextTick(function() { this.$nextTick(function() {
this.swichMenu(groupIndex) if (this.oldItemId)this.itemId = this.oldItemId
}) })
}, },
// 提交订单
orderFinish(){ orderFinish(){
let self = this const param = this.handleSaveData()
let pass = this.checkCompleteItem() this.$u.api.saveCompleteData(param,this.orderId).then((res)=>{
if(!pass){ if (res.code == 200) {//完工项信息保存成功再次完工工单
self.completeCheckStatus = true if(this.inGuaranteePeriod === 'Y'){
}else{// 先保存完工项 this.$u.api.inOrderFinish(this.orderId).then((res)=>{
let param = self.handleSaveData() if (res.code == 200) {
self.$u.api.saveCompleteData(param,self.orderId).then((res)=>{ this.$refs.uToast.show({
if (res.code == 200) {//完工项信息保存成功再次完工工单 title: '提交成功',
console.log("完工"); type: 'success',
this.pass = pass callback: () => {
if(self.inGuaranteePeriod === 'Y'){ uni.reLaunch({
self.$u.api.inOrderFinish(self.orderId).then((res)=>{ url: '/pages/index/order?type=3'
console.log(res) })
self.completeCheckStatus = true }
}) })
}else{ }
self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{ })
console.log(res) }else{
self.completeCheckStatus = true this.$u.api.outOrderFinish({customerPayType:'CASH'}, this.orderId).then((res)=>{
}) if (res.code == 200) {
} this.$refs.uToast.show({
} else { title: '提交成功',
this.$refs.uToast.show({ type: 'success',
title: res.message, callback: () => {
type: 'error', uni.reLaunch({
}) url: '/pages/index/order?type=3'
} })
}) }
} })
}
})
}
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
}, },
calMaterialCraftListAmount(arr){ calMaterialCraftListAmount(arr){
let amount = 0 let amount = 0
...@@ -556,49 +640,34 @@ ...@@ -556,49 +640,34 @@
innerItem = groupItem.items[data.itemIndex] innerItem = groupItem.items[data.itemIndex]
} }
if(innerItem.fieldsType ==='multiInput'){ if(innerItem.fieldsType === 'multiInput'){
// 多个输入框的值触发 // 多个输入框的值触发
let key = Object.keys(data.value)[0] let key = Object.keys(data.value)[0]
this.form[key] = data.value[key] this.form[key] = data.value[key]
}else{ }else{
this.$set(this.form,innerItem.fieldsName,data.value) this.$set(this.form,innerItem.fieldsName,data.value)
} }
if (innerItem.fieldsId == 199) { // 选不需要收款的时候,收款金额修改为非必选
for (var list of this.list) { // 同时修改基本信息和完工信息 if (innerItem.fieldsId === 199) { // 选不需要收款的时候,收款金额修改为非必选
for (var item of list.items) { const row = groupItem.items.find(v => v.fieldsId === 200)
for (var i of item.items) { row.required = data.value !='03'
if (i.fieldsId == 200) { }
i.required = data.value !='03'
} if (innerItem.fieldsId === 252 || innerItem.fieldsId === 253) { // 申请费用计算
} this.calcMoney()
}
}
}
},
nextStep() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.current = 0
this.leftMenuStatus(0)
const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
})
} }
}, },
tabsChange(index){ // 申请费用计算
this.tabIndex = index calcMoney() {
this.arr = [] const price = parseInt(this.form.pipe) || 0
this.scrollRightTop = 0; const pipeUseLength = parseFloat(this.form.pipeUseLength) || 0
this.current = 0; if (price && pipeUseLength) {
this.leftMenuStatus(0) const money = (price * pipeUseLength).toFixed(2)
this.$nextTick(function() { this.$set(this.form, 'pipeAmount', money)
if (this.oldItemId)this.itemId = this.oldItemId } else {
this.getMenuItemTop() this.$set(this.form, 'pipeAmount', 0)
}) }
}, },
// ------------------------- 以下方法为上传组件相关 ------------------------- // ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项 // 弹出上传选项
...@@ -692,62 +761,16 @@ ...@@ -692,62 +761,16 @@
if (this.arr.length == 0) { if (this.arr.length == 0) {
await this.getMenuItemTop(); await this.getMenuItemTop();
} }
if (index == this.current) return; // if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop; this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() { this.$nextTick(function() {
this.itemId = this.oldItemId setTimeout(() => {
if(!this.oldItemId) this.scrollRightTop = this.arr[index]; // 没有指定滚动到某一小项,就滚动到大的项
this.oldItemId = '' this.scrollRightTop = this.arr[index]
this.current = index; this.current = index
this.leftMenuStatus(index); }, 100)
})
},
// 获取一个目标元素的高度
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({
size: true
}, res => {
// 如果节点尚未生成,res值为null,循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
resolve();
}).exec();
}) })
}, },
// 观测元素相交状态
async observer() {
this.tabbar.map((val, index) => {
let observer = uni.createIntersectionObserver(this);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
observer.relativeTo('.right-box', {
top: 0
}).observe('#item' + index, res => {
if (res.intersectionRatio > 0) {
let id = res.id.substring(4);
this.leftMenuStatus(id);
}
})
})
},
// 设置左边菜单的滚动状态
async leftMenuStatus(index) {
this.current = index;
// 如果为0,意味着尚未初始化
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// 将菜单活动item垂直居中
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
},
// 获取右边菜单每个item到顶部的距离 // 获取右边菜单每个item到顶部的距离
getMenuItemTop() { getMenuItemTop() {
new Promise(resolve => { new Promise(resolve => {
...@@ -768,7 +791,6 @@ ...@@ -768,7 +791,6 @@
}).exec() }).exec()
}) })
}, },
// 右边菜单滚动 // 右边菜单滚动
async rightScroll(e) { async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop; this.oldScrollTop = e.detail.scrollTop;
...@@ -776,19 +798,16 @@ ...@@ -776,19 +798,16 @@
await this.getMenuItemTop(); await this.getMenuItemTop();
} }
if (this.timer) return; if (this.timer) return;
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
this.timer = setTimeout(() => { // 节流 this.timer = setTimeout(() => { // 节流
this.timer = null; this.timer = null;
// scrollHeight为右边菜单垂直中点位置 // scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2; let scrollHeight = e.detail.scrollTop
for (let i = 0; i < this.arr.length; i++) { for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i]; let height1 = this.arr[i];
let height2 = this.arr[i + 1]; let height2 = this.arr[i + 1];
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可 // 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) { if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i); this.current = i
return; return;
} }
} }
......
...@@ -682,7 +682,7 @@ ...@@ -682,7 +682,7 @@
}, },
// 去业务材料页面 // 去业务材料页面
handleClickFile() { handleClickFile() {
this.$u.route({url: 'pages/order/document'}) this.$u.route({url: 'pages/order/document' + '?partnerCompanyId=' + this.order.partnerCompanyId + '&brandId=' + this.order.lianbaoBrandId})
}, },
trackOrder() { trackOrder() {
// 接单成功事件,签到成功事件 // 接单成功事件,签到成功事件
...@@ -722,6 +722,7 @@ ...@@ -722,6 +722,7 @@
+ "&inGuaranteePeriod=" + this.order.inGuaranteePeriod + "&inGuaranteePeriod=" + this.order.inGuaranteePeriod
+ "&partnerCompanyId=" + this.order.partnerCompanyId + "&partnerCompanyId=" + this.order.partnerCompanyId
+ '&partnerCompanyName=' + this.order.partnerCompanyName + '&partnerCompanyName=' + this.order.partnerCompanyName
+ '&maintainStep=' + this.order.maintainStep
}) })
}, },
rejectOrder() { // 拒单 rejectOrder() { // 拒单
......
<template> <template>
<view class="doc-wrap"> <view :class="['doc-wrap', {'order-file': orderFile}]">
<u-navbar title="安装文件" :border-bottom="false" /> <u-navbar back-icon-color="#333333" background="#FFFFFF" title="安装文件" titleColor="#333333"
<view class="filter"> :border-bottom="false" title-bold></u-navbar>
<u-icon class="filter-icon" name="bag" label="品牌" label-size="24" /> <template v-if="!orderFile">
<u-icon class="filter-icon" name="tags" label="品类" label-size="24" /> <view v-for="(item, key) in labels" :key="key" class="label-list">
</view> <view class="label-title">
<view class="content"> <view>{{items[key]}}</view>
<view class="title">文件列表</view> <view class="label-file-right">
<view class="item" v-for="(item, index) in list" :key="index"> <text class="label-right-text">更多</text>
<view class="item-left"> <u-icon name="arrow-right"></u-icon>
<u-icon class="item-icon" name="doc" custom-prefix="wxh"></u-icon> </view>
<text class="item-icon-txt">P</text> </view>
<view class="item-name">{{ item.name }}</view> <view class="label-content">
<view v-for="(label, ind) in item" :key="ind" class="label-item">
<view :class="['label-normal', {'selected': label.id == selected[key].id}]"
@click="handleClick(key, label)">{{label.name}}</view>
</view>
</view>
</view>
</template>
<view class="file-title">文件列表</view>
<view class="file-list">
<view class="file-row" v-for="(item, index) in list" :key="index">
<view class="file-left">
<view class="file-name">
<u-icon class="item-icon" name="doc" custom-prefix="wxh" fontSize="52"></u-icon>
<image class="file-image" :src="wenjianImage"></image>
<view class="file-format-text">{{formatText(item.name)}}</view>
</view>
<text>{{item.name}}</text>
</view> </view>
<view class="item-right"> <view class="file-right">
<u-button shape="circle" :custom-style="shareBtn" @click="shareDocment(item)">分享</u-button> <u-button :custom-style="shareStyle" shape="circle" @click="handleShare">分享</u-button>
<u-button shape="circle" :custom-style="viewBtn" @click="openDocment(item)">查看</u-button> <u-button :custom-style="previewStyle" shape="circle" @click="handlePreview">查看</u-button>
</view> </view>
</view> </view>
<u-loadmore :status="status" margin-top="30" />
<u-gap height="316" /> <view class="loading-view" v-if="loading">
<u-loading mode="flower"></u-loading>
</view>
<view class="tip-view" v-else-if="list.length <= 0">{{tipText}}</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
let now = Date.now(); let now = Date.now()
export default { export default {
data() { data() {
return { return {
list: [], list: [],
status: 'loadmore', status: 'loadmore',
total: 0, total: 0,
shareData: { firstLoad: true,
title: '', labels: {
path: '' '1': [], // 合作商标签列表
'2': [] // 品牌标签列表
},
selected: {
'1': {}, // 选中的合作商
'2': {} // 选中的品牌
},
loading: false,
orderFile: false,
shareStyle: {
marginRight: '10rpx',
width: '100rpx',
height: '52rpx',
background: '#FFFFFF',
color: '#2272FF',
fontSize: '24rpx',
fontWeight: '400',
lineHeight: '52rpx'
},
previewStyle: {
width: '100rpx',
height: '52rpx',
background: '#2272FF',
color: '#FFFFFF',
fontSize: '24rpx',
fontWeight: '400',
lineHeight: '52rpx'
},
};
},
computed: {
items() {
return {
'1': '合作商',
'2': '品牌'
}
}, },
shareBtn: { shareStyle() {
marginRight: '10rpx', return {
width: '100rpx', 'background-color': '#FFFFFF',
height: '52rpx', 'heigth': '52rpx',
background: '#FFFFFF', 'width': '100rpx',
color: '#2272FF', 'color': '#2272FF',
fontSize: '24rpx', 'font-size': '24rpx',
fontWeight: '400', }
lineHeight: '52rpx'
}, },
viewBtn: { previewStyle() {
width: '100rpx', return {
height: '52rpx', 'background-color': '#2272FF',
background: '#2272FF', 'heigth': '52rpx',
color: '#FFFFFF', 'width': '100rpx',
fontSize: '24rpx', 'color': '#FFFFFF',
fontWeight: '400', 'font-size': '24rpx',
lineHeight: '52rpx' }
},
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian-bk.png'
},
tipText() {
return (this.selected['2'].name || this.orderFile) ? '暂无文件' : '请选择品牌'
} }
};
},
onLoad() {
console.log('onLoad===========');
this.loadDocuments();
},
onShareAppMessage(res) {
console.log("shareDocment2")
if (res.from === 'button') {
// 来自页面内分享按钮
console.log(res.target);
}
console.log(res.target);
return {
title: this.shareData.title,
path: this.shareData.path
};
},
onReachBottom() {
if (this.list.length >= this.total) return;
console.log('onReachBottom===========');
this.status = 'loading';
this.loadDocuments();
},
methods: {
loadDocuments() {
let data = [
{ name: '挚达-广汽-勘察报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-增项收费标准表.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-安装报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-自营平台系统相关的免责协议.PDF', url: '', time: now, from: ['挚达', '充电桩', '空调', '自营平台'] },
{ name: '挚达-广汽-报装声明.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-勘察报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-增项收费标准表.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-安装报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-自营平台系统相关的免责协议.PDF', url: '', time: now, from: ['挚达', '充电桩', '空调', '自营平台'] },
{ name: '挚达-广汽-报装声明.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-勘察报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-增项收费标准表.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-安装报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-自营平台系统相关的免责协议.PDF', url: '', time: now, from: ['挚达', '充电桩', '空调', '自营平台'] },
{ name: '挚达-广汽-报装声明.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-勘察报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-增项收费标准表.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-安装报告.PDF', url: '', time: now, from: ['挚达', '充电桩'] },
{ name: '挚达-广汽-自营平台系统相关的免责协议.PDF', url: '', time: now, from: ['挚达', '充电桩', '空调', '自营平台'] },
{ name: '挚达-广汽-报装声明.PDF', url: '', time: now, from: ['挚达', '充电桩'] }
];
this.total = 100;
let newList = this.$u.deepMerge(this.list, data);
this.list = newList;
console.log('loadDocuments===========');
if (newList.length >= this.total) this.status = 'nomore';
else this.status = 'loadmore';
},
/**
* 分享文件
* @param {Object} doc
*/
async shareDocment(doc) {
}, },
/** onLoad(e) {
* 浏览文件 if (e.partnerCompanyId && e.brandId) {
* @param {Object} doc this.orderFile = true
*/ this.loadFileList(e.partnerCompanyId, e.brandId)
openDocment(doc) { } else {
this.loadFileLabel('1')
}
}, },
} methods: {
}; handleClick(key, label) {
this.selected[key] = label
if (key == '1') {
this.selected['2'] = {}
this.list = []
this.loadFileLabel('2', label.id)
} else {
this.loadFileList(this.selected['1'].id, this.selected['2'].id)
}
},
handleShare() {
},
handlePreview() {
},
async loadFileLabel(type, partnerCompanyId) {
let param = {
type: type, // 1:合作商标签,2:品牌标签
}
if (type == '2') {
param.partnerCompanyId = partnerCompanyId // 合作商的标签id
}
let res = await this.$u.api.fileLabel(param)
if (res && res.code == 200) {
this.labels[type] = res.data || []
console.log(this.labels)
if (this.firstLoad && type == '1') { // 第一次额外加载第一个合作商的品牌标签
this.firstLoad = false
if (this.labels[type].length > 0) {
this.selected[type] = this.labels[type][0]
this.loadFileLabel('2', this.selected[type].id)
}
}
}
},
async loadFileList(partnerCompanyId, brandId) {
this.loading = true
let res = await this.$u.api.fileList({
partnerCompanyId: partnerCompanyId, // 合作商标签
brandId: brandId // 品牌标签
})
this.loading = false
if (res && res.code == 200) {
console.log(res.data)
this.list = res.data || []
}
},
formatText(name) {
let arr = name.split('.')
let item = arr.pop()
return item.substr(0, 1)
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.doc-wrap { .doc-wrap {
background-color: #f4f5f7; background-color: #F4F5F7;
.filter { height: 100vh;
padding-left: 30rpx; display: flex;
height: 60rpx; flex-direction: column;
line-height: 60rpx;
z-index: 2; &.order-file {
.filter-icon { background-color: #FFFFFF;
margin-right: 60rpx;
} }
}
.content { .label-list {
background: #ffffff; padding: 0 0 40rpx 30rpx;
border-radius: 32rpx 32rpx 0px 0px;
.title { .label-title {
padding: 30rpx 30rpx 15rpx 30rpx; font-size: 32rpx;
height: 77rpx; font-weight: bold;
font-size: 32rpx; color: #333333;
font-weight: bold; margin-bottom: 30rpx;
color: #333333; display: flex;
justify-content: space-between;
align-items: center;
.label-file-right {
display: flex;
align-items: center;
justify-content: flex-end;
color: #2272FF;
font-size: 26rpx;
padding-right: 30rpx;
.label-right-text {
font-weight: 400;
}
}
}
.label-content {
width: 100%;
display: flex;
align-items: center;
overflow-x: auto;
.label-item {
padding-right: 20rpx;
flex-shrink: 0;
.label-normal {
height: 60rpx;
font-size: 26rpx;
color: #666666;
background-color: #FFFFFF;
border-radius: 8rpx;
padding-left: 30rpx;
padding-right: 30rpx;
text-align: center;
line-height: 60rpx;
&.selected {
color: #FFFFFF;
background-color: #2272FF;
}
}
}
}
} }
.item { }
margin: 0 30rpx;
flex-basis: calc(100%); .file-title {
align-items: center; font-size: 32rpx;
min-height: 102rpx; font-weight: bold;
color: #333333;
padding: 20rpx 30rpx;
border-radius: 32rpx;
background-color: #FFFFFF;
// margin-top: 10rpx;
}
.file-list {
padding: 0 30rpx;
height: 100%;
overflow: auto;
background-color: #FFFFFF;
.file-row {
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
.item-left { margin-top: 10rpx;
margin-bottom: 50rpx;
.file-left {
display: flex; display: flex;
align-items: center; align-items: center;
.item-icon { color: #333333;
margin-right: 20rpx; font-size: 26rpx;
font-size: 52rpx;
color: #2272ff; .file-name {
} position: relative;
.item-icon-txt {
position: absolute; .file-format-text {
width: 52rpx; position: absolute;
height: 52rpx; width: 52rpx;
text-align: center; height: 52rpx;
font-size: 32rpx; text-align: center;
font-weight: bold; font-size: 32rpx;
color: #FFFFFF; font-weight: bold;
line-height: 52rpx; color: #FFFFFF;
} line-height: 52rpx;
.item-title { margin-right: 20rpx;
width: 52rpx; }
height: 52rpx;
background: #2272ff;
border-radius: 8rpx 25rpx 8rpx 8rpx;
}
.item-name {
word-break: break-all;
max-width: 380rpx;
font-size: 26rpx;
font-weight: 400;
color: #333333;
} }
} }
.item-right {
.file-right {
display: flex; display: flex;
align-items: center;
justify-content: flex-end;
.button-class {
margin-left: 10rpx;
}
} }
} }
.tip-view {
color: #999999;
width: 100%;
margin-top: 200rpx;
text-align: center;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 200rpx;
}
} }
}
</style> </style>
...@@ -246,16 +246,17 @@ ...@@ -246,16 +246,17 @@
}, },
async closeTake(img) { async closeTake(img) {
if(img !==undefined){ if(img !==undefined){
// 复制一份 用于保存
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
let saveList = JSON.parse(JSON.stringify(this.currentItemDate.orderImages))
const files = img.map(v => v.path) const files = img.map(v => v.path)
const value = await this.saveToTask(files) const value = await this.saveToTask(files)
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
// 复制一份 用于保存
let saveList = this.currentItemDate.orderImages.concat();
value.map(item =>{ value.map(item =>{
// step1 添加缓存图片 到显示
this.currentItemDate.orderImages.push(item.path)
// 文件key添加保存数组中 // 文件key添加保存数组中
saveList.push(item.key) saveList.push(item.key)
// step1 添加缓存图片 到显示
this.currentItemDate.orderImages.push(item.path)
}) })
// step2 保存图片 // step2 保存图片
var data={ var data={
...@@ -263,6 +264,7 @@ ...@@ -263,6 +264,7 @@
images : Array.from(saveList), images : Array.from(saveList),
fieldsName:this.currentItemDate.fieldName fieldsName:this.currentItemDate.fieldName
} }
console.log("data", data)
this.$u.api.saveImage(data,this.orderId).then((res) => { this.$u.api.saveImage(data,this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment