Commit 13f1ff51 authored by Facius's avatar Facius

feat: 【ID1001292】 前台-师傅在小程序前台完工后,“审核中”及“已完工”状态下均可查看完工信息

parent 4c952cfb
<!-- ******************* 定位 ******************* --> <!-- ******************* 定位 ******************* -->
<template> <template>
<view> <view>
<view class="list u-flex u-row-between"> <view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view> <view class="u-m-r-20">{{ item.fieldsTitle }}</view>
<view class="u-flex-1 location-name" @click="getLocation"> <view class="u-flex-1 location-name" @click="getLocation">
<u-icon name="map" color="#2979ff" size="30"></u-icon>自动定位 <u-icon name="map" color="#2979ff" size="30"></u-icon>自动定位
</view> </view>
</view> </view>
<view class="u-flex-1 location">{{valueTxt || '正在获取中...'}}</view> <view class="u-flex-1 location">{{ valueTxt || '正在获取中...' }}</view>
</view> </view>
</template> </template>
<script> <script>
import arrMixin from './arrMixin' import arrMixin from './arrMixin'
export default { export default {
name: 'XhLocation', name: 'XhLocation',
components: {}, components: {},
mixins: [arrMixin], mixins: [arrMixin],
props: {}, props: {},
filters:{}, filters: {},
data() { data() {
return {} return {}
}, },
computed: { computed: {
valueTxt() { valueTxt() {
let str = '' let str = ''
const dataValue = this.dataValue const dataValue = this.dataValue
if(dataValue && dataValue.length>1){ if (dataValue && dataValue.length > 1) {
str = '经度:'+dataValue[0].toFixed(4)+','+'纬度:'+dataValue[1].toFixed(4) str =
} '经度:' +
return str dataValue[0].toFixed(4) +
}, ',' +
mixingImage() { '纬度:' +
return process.uniEnv.qn_base_url + 'mixing.png' dataValue[1].toFixed(4)
} }
}, return str
watch: {}, },
created() { mixingImage() {
this.getLocation() return process.uniEnv.qn_base_url + 'mixing.png'
}, },
methods: { },
getLocation() { watch: {},
let self = this created() {
const dataValue = this.dataValue || [] this.getLocation()
const waterInfo = this.waterInfo },
uni.getLocation({ methods: {
type: 'gcj02', getLocation() {
success: function(res) { if (this.disabled) return
dataValue.push(res.longitude) let self = this
dataValue.push(res.latitude) const dataValue = this.dataValue || []
self.dataValue = dataValue const waterInfo = this.waterInfo
self.setValue(dataValue) uni.getLocation({
}, type: 'gcj02',
fail(err) {} success: function(res) {
}); dataValue.push(res.longitude)
}, dataValue.push(res.latitude)
setValue(txt) { self.dataValue = dataValue
this.valueChange(this.dataValue) self.setValue(dataValue)
} },
} fail(err) {},
} })
},
setValue(txt) {
this.valueChange(this.dataValue)
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.required { .required {
padding-right: 10rpx; padding-right: 10rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
color: #fa3534; color: #fa3534;
} }
.item-image { .item-image {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.location-name { .location-name {
color: #2272FF; color: #2272ff;
text-align: right; text-align: right;
} }
.location { .location {
background: #F4F5F7; background: #f4f5f7;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
border-radius: 12rpx; border-radius: 12rpx;
} }
</style> </style>
<!-- ******************* 扫码 ******************* --> <!-- ******************* 扫码 ******************* -->
<template> <template>
<view class=""> <view class="">
<view class="u-flex" @click="scanCode"> <view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view> <view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
<view class="u-flex"> <view class="u-flex">
<u-input class="u-flex-1 input-item" v-model="dataValue" @input="valueChange" type="text" /> <u-input
</view> class="u-flex-1 input-item"
</view> v-model="dataValue"
@input="valueChange"
type="text"
:disabled="disabled"
/>
</view>
</view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
name: 'XhScan', name: 'XhScan',
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: {}, props: {},
filters:{}, filters: {},
data() { data() {
return {} return {}
}, },
computed: { computed: {},
}, watch: {},
watch: {}, mounted() {},
mounted() {}, methods: {
methods: { scanCode(type) {
scanCode(type){ if (this.disabled) return
const self = this const self = this
uni.scanCode({ uni.scanCode({
success: function (res) { success: function(res) {
let result = res.result let result = res.result
if (result.substring(0, 4) === 'http') { if (result.substring(0, 4) === 'http') {
let arr = result.split('/#/') let arr = result.split('/#/')
if (arr.length < 2) arr = result.split('?') if (arr.length < 2) arr = result.split('?')
result = arr[1] result = arr[1]
} }
self.dataValue = result self.dataValue = result
self.valueChange(result) self.valueChange(result)
} },
}); })
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.required { .required {
padding-right: 10rpx; padding-right: 10rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
color: #fa3534; color: #fa3534;
} }
.input-item{ .input-item {
background: #F4F5F7; background: #f4f5f7;
border-radius: 12rpx; border-radius: 12rpx;
padding-left: 20rpx; padding-left: 20rpx;
} }
</style> </style>
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
:value="index" :value="index"
range-key="label" range-key="label"
:range="settings" :range="settings"
:disabled="disabled"
@click="showPicker = true" @click="showPicker = true"
@change="pickerChange" @change="pickerChange"
class="txt u-flex-1" class="txt u-flex-1"
> >
<view>{{ text || "请选择" }}</view> <view>{{ text || '请选择' }}</view>
</picker> </picker>
<u-icon <u-icon
class="input-icon" class="input-icon"
...@@ -30,9 +31,9 @@ ...@@ -30,9 +31,9 @@
</template> </template>
<script> <script>
import objMixin from "./objMixin"; import objMixin from './objMixin'
export default { export default {
name: "XhPicker", name: 'XhPicker',
components: {}, components: {},
mixins: [objMixin], mixins: [objMixin],
props: { props: {
...@@ -40,17 +41,17 @@ export default { ...@@ -40,17 +41,17 @@ export default {
defaultSelector: { defaultSelector: {
type: Array, type: Array,
default() { default() {
return [0]; return [0]
}, },
}, },
// 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 // 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容
rangeKey: { rangeKey: {
type: String, type: String,
default: "label", default: 'label',
}, },
value: { value: {
type: String, type: String,
default: "{}", default: '{}',
}, },
orderId: { orderId: {
type: Number, type: Number,
...@@ -62,11 +63,11 @@ export default { ...@@ -62,11 +63,11 @@ export default {
}, },
specificationId: { specificationId: {
type: String, type: String,
default: "0", default: '0',
}, },
orderServiceType: { orderServiceType: {
type: String, type: String,
default: "安装", default: '安装',
}, },
}, },
filters: {}, filters: {},
...@@ -76,47 +77,47 @@ export default { ...@@ -76,47 +77,47 @@ export default {
showPicker: false, showPicker: false,
settings: [], settings: [],
measure: [], measure: [],
index: "", index: '',
}; }
}, },
computed: { computed: {
text() { text() {
let val = ""; let val = ''
if (this.value) { if (this.value) {
let data = JSON.parse(this.value); let data = JSON.parse(this.value)
val = data[0].measureTypeName + "-" + data[0].measureName; val = data[0].measureTypeName + '-' + data[0].measureName
} }
return val; return val
}, },
fieldsWidth() { fieldsWidth() {
return this.item.fieldsWidth ? this.item.fieldsWidth + "rpx" : "100%"; return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
}, },
}, },
watch: { watch: {
specificationId(val, oldVal) { specificationId(val, oldVal) {
this.initComponent(); this.initComponent()
}, },
}, },
mounted() { mounted() {
this.isNotMulti = this.orderServiceType === "安装"; this.isNotMulti = this.orderServiceType === '安装'
this.initComponent(); this.initComponent()
}, },
methods: { methods: {
openPicker() { openPicker() {
if (this.specificationId === "0") { if (this.specificationId === '0') {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "请先选择规格", title: '请先选择规格',
type: "error", type: 'error',
}); })
return; return
} }
this.showPicker = true; this.showPicker = true
}, },
initComponent() { initComponent() {
if (this.isNotMulti) { if (this.isNotMulti) {
this.initMeasure(); this.initMeasure()
} else { } else {
this.initSymptoms(); this.initSymptoms()
} }
}, },
initSymptoms() { initSymptoms() {
...@@ -133,50 +134,50 @@ export default { ...@@ -133,50 +134,50 @@ export default {
categoryId: this.categoryId, categoryId: this.categoryId,
specificationId: this.specificationId, specificationId: this.specificationId,
orderServiceTypeText: this.orderServiceType, orderServiceTypeText: this.orderServiceType,
}; }
this.$u.api.getMeasureV2(param).then(res => { this.$u.api.getMeasureV2(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
let result = []; let result = []
for (let key in res.data) { for (let key in res.data) {
this.measure = res.data[key].measureExtendDtos; this.measure = res.data[key].measureExtendDtos
res.data[key].measureExtendDtos.map((item, index) => { res.data[key].measureExtendDtos.map((item, index) => {
result.push({ id: item.measureId, label: item.measureName }); result.push({ id: item.measureId, label: item.measureName })
}); })
} }
if (this.orderServiceType === "安装") { if (this.orderServiceType === '安装') {
this.settings = result; this.settings = result
} else { } else {
this.settings[2] = result; this.settings[2] = result
} }
} else { } else {
console.log(res.message, "查询措施失败"); console.log(res.message, '查询措施失败')
} }
}); })
} }
}, },
pickerConfirm(data) { pickerConfirm(data) {
let result = []; let result = []
if (this.isMulti) { if (this.isMulti) {
// 维修 // 维修
} else { } else {
// 安装 // 安装
result.push(this.measure[data[0]]); result.push(this.measure[data[0]])
} }
this.valueChange(JSON.stringify(result)); this.valueChange(JSON.stringify(result))
}, },
pickerChange(data) { pickerChange(data) {
this.showPicker = false; this.showPicker = false
this.index = data.detail.value; this.index = data.detail.value
let result = []; let result = []
if (this.isMulti) { if (this.isMulti) {
// 维修 // 维修
} else { } else {
// 安装 // 安装
result.push(this.measure[this.index]); result.push(this.measure[this.index])
} }
this.valueChange(JSON.stringify(result)); this.valueChange(JSON.stringify(result))
}, },
columnchange(data) { columnchange(data) {
// // 树列改变时进行联动操作 // // 树列改变时进行联动操作
...@@ -185,7 +186,7 @@ export default { ...@@ -185,7 +186,7 @@ export default {
// this.settings.splice(column+1,1,arr) // this.settings.splice(column+1,1,arr)
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.picker-common { .picker-common {
......
...@@ -23,66 +23,67 @@ ...@@ -23,66 +23,67 @@
</template> </template>
<script> <script>
import arrMixin from "./arrMixin"; import arrMixin from './arrMixin'
export default { export default {
name: "XhInput", // 新建 input name: 'XhInput', // 新建 input
components: {}, components: {},
mixins: [arrMixin], mixins: [arrMixin],
props: { props: {
placeholder: { placeholder: {
type: String, type: String,
default: "请输入", default: '请输入',
}, },
orderId: { orderId: {
type: String, type: String,
default: "请输入", default: '请输入',
}, },
}, },
data() { data() {
return { return {
maxlength: 140, maxlength: 140,
}; }
}, },
computed: { computed: {
mixingImage() { mixingImage() {
return process.uniEnv.qn_base_url + "mixing.png"; return process.uniEnv.qn_base_url + 'mixing.png'
}, },
arrowText() { arrowText() {
if(this.$u.test.isEmpty(this.dataValue)) return "请选择"; if (this.$u.test.isEmpty(this.dataValue)) return '请选择'
if(this.item.fieldsName == "materialList") { if (this.item.fieldsName == 'materialList') {
let hasMate = false let hasMate = false
var newData = this.dataValue.find((item) => { var newData = this.dataValue.find((item) => {
if(!this.$u.test.isEmpty(item.useLength)) { if (!this.$u.test.isEmpty(item.useLength)) {
hasMate = true hasMate = true
return item.useLength != '0' return item.useLength != '0'
} }
}) })
if(hasMate && this.$u.test.isEmpty(newData)) return "请选择" if (hasMate && this.$u.test.isEmpty(newData)) return '请选择'
} }
return "已选择"; return '已选择'
}, },
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
toMaterialPage() { toMaterialPage() {
let self = this; if (this.disabled) return
let self = this
uni.navigateTo({ uni.navigateTo({
url: url:
"pages/order/material?orderId=" + 'pages/order/material?orderId=' +
this.orderId + this.orderId +
"&fieldName=" + '&fieldName=' +
this.item.fieldsName, this.item.fieldsName,
// 接口调用成功的回调函数,即跳转到B页面 test.vue 后的回调函数 // 接口调用成功的回调函数,即跳转到B页面 test.vue 后的回调函数
success: function (res) { success: function(res) {
// 通过eventChannel向被打开页面传送数据 // 通过eventChannel向被打开页面传送数据
res.eventChannel.emit("showMaterialData", self.dataValue); res.eventChannel.emit('showMaterialData', self.dataValue)
}, },
}); })
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<!-- ******************* 输入框 ******************* --> <!-- ******************* 输入框 ******************* -->
<template> <template>
<view class="picker-box"> <view class="picker-box">
<!-- <view class="u-flex u-row-between" @click="openPicker"> <!-- <view class="u-flex u-row-between" @click="openPicker">
<view class="txt u-flex-1">{{dataValue||'请选择时间'}}</view> <view class="txt u-flex-1">{{dataValue||'请选择时间'}}</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> --> </view> -->
<!-- <u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker> --> <!-- <u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker> -->
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<picker mode="date" :value="dataValue" @change="bindDateChange" class="txt u-flex-1"> <picker
<view>{{dataValue || '请选择时间'}}</view> mode="date"
</picker> :value="dataValue"
<u-icon name="arrow-right" color="#666" size="28"></u-icon> @change="bindDateChange"
</view> class="txt u-flex-1"
</view> :disabled="disabled"
>
<view>{{ dataValue || '请选择时间' }}</view>
</picker>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
</view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: {}, props: {},
data() { data() {
return { return {
showPicker: false, showPicker: false,
params: { params: {
year: true, year: true,
month: true, month: true,
day: true, day: true,
hour: false, hour: false,
minute: false, minute: false,
second: false, second: false,
timestamp: true, timestamp: true,
}, },
date: '请选择', date: '请选择',
} }
}, },
mounted() {}, mounted() {},
methods: { methods: {
openPicker() { openPicker() {
this.showPicker = true this.showPicker = true
}, },
pickerConfirm(data) { pickerConfirm(data) {
let result = [] let result = []
let dataValue = data.year + '-' + data.month + '-' + data.day let dataValue = data.year + '-' + data.month + '-' + data.day
this.dataValue = dataValue this.dataValue = dataValue
this.valueChange(dataValue) this.valueChange(dataValue)
}, },
bindDateChange: function(e) { bindDateChange: function(e) {
const value = e.target.value const value = e.target.value
this.dataValue = value this.dataValue = value
this.valueChange(value) this.valueChange(value)
} },
} },
} }
</script> </script>
<style> <style></style>
</style>
...@@ -62,7 +62,10 @@ ...@@ -62,7 +62,10 @@
label-position="top" label-position="top"
:prop="item.fieldsName" :prop="item.fieldsName"
:border-bottom="false" :border-bottom="false"
v-show="item.fieldsName != 'actualPaid' || show200" v-show="
(item.fieldsName != 'actualPaid' || show200) &&
((readOnly && form[item.fieldsName]) || !readOnly)
"
:id="`item${item.fieldsId}`" :id="`item${item.fieldsId}`"
> >
<view <view
...@@ -152,7 +155,7 @@ ...@@ -152,7 +155,7 @@
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
<template v-slot> <template v-slot>
<view class="img-list"> <view class="img-list" v-if="!readOnly">
<u-image <u-image
class="pic" class="pic"
width="160rpx" width="160rpx"
...@@ -178,6 +181,7 @@ ...@@ -178,6 +181,7 @@
:itemIndex="itemIndex" :itemIndex="itemIndex"
:item="item" :item="item"
:value="form[item.fieldsName] || ''" :value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-location> </xh-location>
...@@ -187,6 +191,7 @@ ...@@ -187,6 +191,7 @@
:itemIndex="itemIndex" :itemIndex="itemIndex"
:item="item" :item="item"
:value="form[item.fieldsName] || ''" :value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-scan> </xh-scan>
...@@ -200,6 +205,7 @@ ...@@ -200,6 +205,7 @@
:orderServiceType="orderServiceType" :orderServiceType="orderServiceType"
:specificationId="form['specificationId'] || 0" :specificationId="form['specificationId'] || 0"
:value="form[item.fieldsName]" :value="form[item.fieldsName]"
:disabled="readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-service-measure> </xh-service-measure>
...@@ -209,6 +215,7 @@ ...@@ -209,6 +215,7 @@
:itemIndex="itemIndex" :itemIndex="itemIndex"
:item="item" :item="item"
:value="form[item.fieldsName] || ''" :value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-time> </xh-time>
...@@ -219,6 +226,7 @@ ...@@ -219,6 +226,7 @@
:item="item" :item="item"
:order-id="orderId" :order-id="orderId"
:value="form[item.fieldsName] || ''" :value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-service-more> </xh-service-more>
...@@ -1063,7 +1071,6 @@ export default { ...@@ -1063,7 +1071,6 @@ export default {
// ------------------------- 以下方法为上传组件相关 ------------------------- // ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项 // 弹出上传选项
selectUpload(item, groupIndex, itemIndex) { selectUpload(item, groupIndex, itemIndex) {
if (this.disabled) return
const imgList = this.$refs[`fileChild${groupIndex}${itemIndex}`][0] const imgList = this.$refs[`fileChild${groupIndex}${itemIndex}`][0]
.imgList .imgList
if (imgList.length === 10) { if (imgList.length === 10) {
......
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