Commit 4c952cfb authored by Facius's avatar Facius

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

parent 8e42bf84
<!-- ******************* 多选框 ******************* -->
<template>
<view class="list">
<view v-for="(item,index) in settings" :key="index"
:class="{'txt':true,'active':checkStatus(item.key)}" @click="setValue(item.key)">{{item.label}}
<view
v-for="(item, index) in settings"
:key="index"
:class="{ txt: true, active: checkStatus(item.key) }"
@click="setValue(item.key)"
>{{ item.label }}
</view>
</view>
</template>
<script>
import arrMixin from './arrMixin'
export default {
import arrMixin from './arrMixin'
export default {
name: 'XhRadio',
components: {},
mixins: [arrMixin],
props: {},
filters:{},
filters: {},
data() {
return {}
},
computed: {
settings() {
return this.item.fieldsOptions || []
}
},
},
watch: {},
mounted() {},
methods: {
checkStatus(item){
if(!item){
checkStatus(item) {
if (!item) {
return false
}
const dataValue = this.dataValue
let flag = Array.isArray(dataValue) && dataValue.indexOf(item)>-1
let flag = Array.isArray(dataValue) && dataValue.indexOf(item) > -1
return flag
},
setValue(txt) {
if (this.disabled) return
const dataValue = this.dataValue || []
let idx = dataValue.indexOf(txt)
if (idx > -1) {
dataValue.splice(idx,1)
dataValue.splice(idx, 1)
} else {
dataValue.push(txt)
}
this.dataValue = dataValue
this.valueChange(this.dataValue)
}
}
}
},
},
}
</script>
<style lang="scss" scoped>
.list {
.list {
display: flex;
flex-wrap: wrap;
.txt{
color:#333;
padding:10rpx 30rpx;
.txt {
color: #333;
padding: 10rpx 30rpx;
margin: 10rpx;
background: #F4F5F7;
background: #f4f5f7;
border-radius: 10rpx;
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
max-width: 46%;
align-items: center;
&.active{
background-color: #2272FF;
color:#fff;
}
&.active {
background-color: #2272ff;
color: #fff;
}
}
}
</style>
......@@ -3,9 +3,26 @@
<view>
<view class="file-box">
<view class="pics u-flex u-flex-wrap">
<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)" fade lazy-load ></u-image>
<view class="icon-del-box" @click.stop="delFile(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)"
fade
lazy-load
></u-image>
<view
class="icon-del-box"
v-if="!disabled"
@click.stop="delFile(index)"
>
<view class="icon-del"></view>
<view class="icon-del rotate"></view>
</view>
......@@ -22,48 +39,48 @@
</template>
<script>
import arrMixin from './arrMixin'
import baseFile from '@/components/upload/index';
import takePhoto from '@/components/take/index.vue'
// import uploader from '@/plugins/uploader/index.js'
import arrMixin from './arrMixin'
import baseFile from '@/components/upload/index'
import takePhoto from '@/components/take/index.vue'
// import uploader from '@/plugins/uploader/index.js'
export default {
export default {
name: 'XhFiles',
components: {
'take-photo': takePhoto
'take-photo': takePhoto,
},
mixins: [arrMixin,baseFile],
mixins: [arrMixin, baseFile],
props: {
files: {
type: Array,
},
partnerCompanyId: {
type: String,
default: ''
default: '',
},
categoryId: {
type: String,
default: ''
default: '',
},
brandId: {
type: String,
default: ''
default: '',
},
},
filters:{},
filters: {},
data() {
return {
maskShow:false,
maskShow: false,
list: [
{
text: '相册'
text: '相册',
},
{
text: '拍照'
}
text: '拍照',
},
],
takeStatus: false,
currentItemDate:{},
currentItemDate: {},
}
},
computed: {
......@@ -75,9 +92,11 @@
},
},
mounted() {
if(this.value){
this.imgList = this.value.filter(v => v).map(img =>{
return {src:img ? img : ''}
if (this.value) {
this.imgList = this.value
.filter((v) => v)
.map((img) => {
return { src: img ? img : '' }
})
this.setValue()
}
......@@ -85,18 +104,18 @@
methods: {
setTmpValue(values) {
this.imgList = this.imgList.concat(values)
const dataValue = this.imgList.map(v => v.src)
const dataValue = this.imgList.map((v) => v.src)
this.valueChange(dataValue)
},
setValue() {
const dataValue = this.imgList.map(item => item.src)
const dataValue = this.imgList.map((item) => item.src)
this.valueChange(dataValue)
},
prviewImage(item, index) {
uni.previewImage({
urls: [item.path ? item.path : item.src],
current: index
});
current: index,
})
},
delFile(index) {
this.imgList.splice(index, 1)
......@@ -197,22 +216,20 @@
}
});
}*/
}
}
},
}
</script>
<style lang="scss" scoped>
.img-list {
.img-list {
position: relative;
margin: 8rpx;
width: 160rpx;
height: 160rpx;
.pic{
.pic {
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&:nth-child(3n){
&:nth-child(3n) {
margin-right: 0;
}
}
......@@ -245,18 +262,18 @@
position: absolute;
transform: rotate(90deg);
}
}
// .list {
// display: flex;
}
// .list {
// display: flex;
// .txt {
// color: #666;
// padding: 10rpx;
// .txt {
// color: #666;
// padding: 10rpx;
// &.active {
// background-color: red;
// color: #fff;
// }
// }
// }
// &.active {
// background-color: red;
// color: #fff;
// }
// }
// }
</style>
<!-- ******************* 多个输入框 ******************* -->
<template>
<view class="u-flex u-flex-wrap">
<u-input class="input-item" v-for="(item,index) in inputOptions" v-model="item.value" @input="val=>{getValue(item)}" type="text" :key="index" :border="true" :placeholder="item.placeholder" />
<u-input
class="input-item"
v-for="(item, index) in inputOptions"
v-model="item.value"
@input="
(val) => {
getValue(item)
}
"
type="text"
:key="index"
:border="true"
:placeholder="item.placeholder"
:disabled="disabled"
/>
</view>
</template>
<script>
import objMixin from './objMixin'
export default {
import objMixin from './objMixin'
export default {
name: 'XhMultiInput',
components: {},
mixins: [objMixin],
......@@ -18,32 +32,32 @@
computed: {
inputOptions() {
let options = this.item.inputOptions || []
let result = options.map(item => {
let result = options.map((item) => {
return {
...item,
value: ''
value: '',
}
})
return result
}
},
},
watch: {},
mounted() {},
methods: {
getValue(item){
getValue(item) {
let currentValue = {}
currentValue[item.fieldsName] = item.value
// 以key,value的对象形式传递
this.valueChange(currentValue)
}
}
}
},
},
}
</script>
<style scoped>
.input-item{
.input-item {
width: 31%;
margin: 5rpx;
background: #F4F5F7;
}
background: #f4f5f7;
}
</style>
<!-- ******************* 单个下拉选择 ******************* -->
<template>
<view class="xh-select" :style="{'width': fieldsWidth}">
<view class="xh-select" :style="{ width: fieldsWidth }">
<!-- <u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input>
<u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
<u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> -->
<view class="u-flex u-row-between picker-common">
<picker mode="selector" :value="index" range-key="label" :range="settings" @click="show = true" @change="pickerChange" class="u-flex-1">
<view class="txt">{{text || '请选择'}}</view>
<picker
mode="selector"
:value="index"
range-key="label"
:range="settings"
@click="show = true"
@change="pickerChange"
class="u-flex-1"
:disabled="disabled"
>
<view class="txt">{{ text || '请选择' }}</view>
</picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
<u-icon
class="input-icon"
color="#2272FF"
:name="show ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
import stringMixin from './stringMixin'
export default {
name: 'XhSelect',
components: {},
mixins: [stringMixin],
props: {
placeholder: {
type: String,
default: '请选择'
default: '请选择',
},
width: { // 例如:454rpx
width: {
// 例如:454rpx
type: String,
default: '100%'
}
default: '100%',
},
},
data() {
return {
show: false,
index: ''
index: '',
}
},
computed: {
......@@ -48,19 +62,21 @@
settings() {
let result = []
let settings = this.item.fieldsOptions || []
result = settings.map(item => {
result = settings.map((item) => {
return {
label: item.label,
value: item.key,
color: '#333333',
fontSize: 26
fontSize: 26,
}
})
return result
},
text(){
let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue})
return option?option.label:''
text() {
let option = this.item.fieldsOptions.find((a) => {
return a.key === this.dataValue
})
return option ? option.label : ''
},
placeholderStyle() {
return 'color:#999999;font-size:26rpx'
......@@ -69,16 +85,16 @@
return {
'background-color': '#F4F5F7',
'border-radius': '12rpx',
'color': '#333333',
color: '#333333',
'padding-left': '20rpx',
'padding-right': '60rpx',
'width': this.width,
'font-size':'26rpx',
'height': '76rpx'
width: this.width,
'font-size': '26rpx',
height: '76rpx',
}
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
},
},
watch: {},
......@@ -95,23 +111,23 @@
this.dataValue = id
this.valueChange(id)
},
}
}
},
}
</script>
<style lang="scss" scoped>
.xh-select {
.xh-select {
position: relative;
.input-icon {
position: absolute;
right: 20rpx;
top: 26rpx;
color: #2272FF;
color: #2272ff;
}
}
.picker-common {
}
.picker-common {
min-height: 35px;
background-color: #F4F5F7;
background-color: #f4f5f7;
border-radius: 6px;
color: #333333;
padding-left: 10px;
......@@ -124,5 +140,5 @@
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
</style>
<!-- ******************* 单个下拉选择 ******************* -->
<template>
<view class="xh-specifications" :style="{'width': fieldsWidth}">
<view class="u-flex u-row-between picker-common" @click="$u.throttle(handleClick, 500)">
<view>{{text || '请选择'}}</view>
<view class="xh-specifications" :style="{ width: fieldsWidth }">
<view
class="u-flex u-row-between picker-common"
@click="$u.throttle(handleClick, 500)"
>
<view>{{ text || '请选择' }}</view>
<u-icon class="input-icon" color="#2272FF" name="arrow-down"></u-icon>
</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
import stringMixin from './stringMixin'
export default {
name: 'XhSpecifications',
components: {},
mixins: [stringMixin],
props: {
placeholder: {
type: String,
default: '请选择'
default: '请选择',
},
width: { // 例如:454rpx
width: {
// 例如:454rpx
type: String,
default: '100%'
default: '100%',
},
type: {
type: String,
default: 'text'
default: 'text',
},
},
data() {
return {
}
return {}
},
computed: {
fieldsWidth() { // 后台返回宽度就用后台的
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
fieldsWidth() {
// 后台返回宽度就用后台的
return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
},
text() {
// 根据选中的key显示
let option = this.item.fieldsOptions.find((a) => {
return a.key === this.dataValue
})
return option ? option.label : ''
},
text(){ // 根据选中的key显示
let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue})
return option?option.label:''
}
},
watch: {},
mounted() {},
methods: {
handleClick() {
var pages = getCurrentPages();
if (this.disabled) return
var pages = getCurrentPages()
if (pages.length >= 1) {
var page = pages[pages.length - 1];
var page = pages[pages.length - 1]
page.info = this.item // 给下个页面传递数据
}
uni.navigateTo({ // 把选中的key传给下个页面
url: 'pages/order/specification?selectedId=' + this.dataValue
uni.navigateTo({
// 把选中的key传给下个页面
url: 'pages/order/specification?selectedId=' + this.dataValue,
})
}
}
}
},
},
}
</script>
<style lang="scss" scoped>
.xh-specifications {
.xh-specifications {
position: relative;
.input-icon {
position: absolute;
right: 20rpx;
top: 26rpx;
color: #2272FF;
color: #2272ff;
}
}
.picker-common {
}
.picker-common {
min-height: 35px;
background-color: #F4F5F7;
background-color: #f4f5f7;
border-radius: 6px;
color: #333333;
padding-left: 10px;
......@@ -83,5 +92,5 @@
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
</style>
......@@ -356,8 +356,12 @@ export default {
},
// title:标题,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
handleClick() {
var func = 'action'
var func = 'click'
this.handleExceptions()
// 不是待完工、审核中、异常单、已完工点按钮算点cell
if ([3, 4, 5, 6].indexOf(this.orderType) != -1) {
func = 'action'
}
this.$emit(
func,
this.orderData,
......
......@@ -84,7 +84,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="item.disabled || false"
:disabled="readOnly || item.disabled || false"
:slotContent="item.fieldsInfo"
@value-change="fieldValueChange"
>
......@@ -95,6 +95,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-multi-input>
......@@ -104,7 +105,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="item.disabled || false"
:disabled="readOnly || item.disabled || false"
@value-change="fieldValueChange"
>
</xh-radio>
......@@ -114,6 +115,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-checkbox>
......@@ -123,6 +125,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-select>
......@@ -132,6 +135,7 @@
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-specifications>
......@@ -144,6 +148,7 @@
:partnerCompanyId="partnerCompanyId"
:categoryId="categoryId"
:value="form[item.fieldsName] || []"
:disabled="readOnly"
@value-change="fieldValueChange"
>
<template v-slot>
......@@ -499,7 +504,9 @@ export default {
this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId
this.orderStatus = option.orderStatus
this.auditResults = option?.auditResults ? option?.auditResults.split(',') : []
this.auditResults = option?.auditResults
? option?.auditResults.split(',')
: []
// this.showTab =item.partnerCompanyName == '挚达充电桩'
} else {
this.orderId = 11880091
......@@ -513,6 +520,9 @@ export default {
//console.log(this.form.name, 'form.name')
},
computed: {
readOnly() {
return [80, 81, 85, 87, 89, 110].indexOf(Number(this.orderStatus)) != -1
},
tabList() {
// 没有数据的时候tab要有占位数据,不然有页面有晃动
return this.list.length > 0
......@@ -577,8 +587,11 @@ export default {
this.form = res.data.value || {}
this.initFormData()
const list = res.data.config.sort((a, b) => a.order - b.order)
if (this.readOnly) this.tabIndex = 0
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName) this.tabIndex = index
if (this.maintainStep === item.panelFieldsName && !this.readOnly) {
this.tabIndex = index
}
item.items.forEach((v) => {
v.items.forEach((d) => {
const type = d.fieldsType.toLocaleLowerCase()
......@@ -605,10 +618,12 @@ export default {
})
})
// this.showTab = this.list.length > 1
// 异常单处理
if (this.auditResults.length > 0 && (this.orderStatus === '88' || this.orderStatus === '86')) {
if (
this.auditResults.length > 0 &&
(this.orderStatus === '88' || this.orderStatus === '86')
) {
this.checkCompleteError(list)
} else {
this.list = list
......@@ -678,9 +693,9 @@ export default {
let index = list.length++
list[index] = {
order: index + 1,
panelFieldsName: "error",
panelName: "异常处理",
items: result
panelFieldsName: 'error',
panelName: '异常处理',
items: result,
}
this.list = list
this.tabIndex = index
......@@ -818,7 +833,12 @@ export default {
// 下一步动作
async nextAction() {
const save = await this.nextStepSaveData()
if (this.tabIndex < this.list.length - 1 && save) {
if (save) {
this.nextTab()
}
},
nextTab() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
......@@ -831,8 +851,14 @@ export default {
})
}
},
// 下一步弹窗处理
nextStep() {
console.log('---------------------------', this.readOnly)
if (this.readOnly) {
this.nextTab()
return
}
this.pass = this.checkCompleteItem()
const name = this.list[this.tabIndex].panelFieldsName
......@@ -1037,6 +1063,7 @@ export default {
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload(item, groupIndex, itemIndex) {
if (this.disabled) return
const imgList = this.$refs[`fileChild${groupIndex}${itemIndex}`][0]
.imgList
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