Commit b2327bd8 authored by 李超鹏's avatar 李超鹏

type:update

scope:self-support
body:保存完工信息调试
parent 9f73d208
......@@ -8,11 +8,11 @@
</template>
<script>
import objMixin from './objMixin'
import arrMixin from './arrMixin'
export default {
name: 'XhRadio',
components: {},
mixins: [objMixin],
mixins: [arrMixin],
props: {},
filters:{},
data() {
......
......@@ -75,21 +75,14 @@
deep:true,
immediate: true,
},
// 'value'(val, oldVal){
// if(val){
// this.imgList = val.map(img =>{
// return {path:img}
// })
// }
// }
},
mounted() {
if(this.value){
this.imgList = this.value.map(img =>{
return {path: img}
return {path: img, src:img}
})
this.setValue()
}
this.setValue()
},
methods: {
selectUpload(){
......
......@@ -72,7 +72,7 @@
},
watch: {
specificationId(val, oldVal){
this.initComponent()
this.initComponent()
},
},
mounted() {
......
......@@ -77,13 +77,22 @@
</scroll-view>
</view>
<view class="btn-wrap flex-xc">
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle"
<u-button class="btn-submit" @click="saveComplete"
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
暂存
</u-button>
<u-button class="btn-submit" @click="nextStep" v-if="tabIndex===list.length - 1"
type="primary" shape="circle" :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'">
下一步
</u-button>
</view>
</view>
<take-photo v-else @close="closeTake"></take-photo>
<u-toast ref="uToast" />
</view>
</template>
<script>
......@@ -176,12 +185,13 @@
if (option) {
this.orderId = option.orderId
this.categoryId = option.categoryId
this.orderServiceType = option.orderServiceType
this.orderServiceType = decodeURIComponent(option.orderServiceType)
} else {
this.orderId = 9708719
this.categoryId = 88
this.orderServiceType = '安装'
}
this.getCompleteData()
},
onReady() {
this.$refs.uForm.setRules(this.rules);
......@@ -192,18 +202,6 @@
//console.log(this.form.name, 'form.name')
},
computed: {
getCompleteData() {
let self = this
if(self.orderId){
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
if (res.code == 200) {
self.list = res.data.config
} else {
console.log(res.message, "获取订单详情失败!");
}
});
}
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
......@@ -226,6 +224,51 @@
}
},
methods: {
getCompleteData() {//获取工单配置的完工项目
let self = this
if(self.orderId){
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
if (res.code == 200) {
self.list = res.data.config
self.form = res.data.value
} else {
console.log(res.message, "获取订单完工项目失败!");
}
});
}
},
saveComplete(){// 保存完工信息
let self = this
let param = {}
self.list.forEach((panel)=>{
param[panel.panelFieldsName] = []
panel.items.forEach((group) =>{
group.items.forEach((ele)=>{
if(self.form[ele.fieldsName]){
param[panel.panelFieldsName].push({
"fieldsName": ele.fieldsName,
"fieldsType": ele.fieldsType,
"fieldsValue": self.form[ele.fieldsName],
"required": ele.required,
})
}
})
})
})
self.$u.api.saveCompleteData(param,self.orderId).then((res)=>{
if (res.code == 200) {
this.$refs.uToast.show({
title: '保存成功',
type: 'success',
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
getTakeStatus(event) {
this.takeStatus = event.status
this.fileIndex = event.index.toString()
......@@ -260,10 +303,9 @@
}else{
this.$set(this.form,innerItem.fieldsName,data.value)
}
console.log(this.form, 'this.form')
},
nextStep() {
if (this.tabIndex < this.list.length) {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.$nextTick(function() {
......@@ -600,5 +642,15 @@
.btn-wrap {
width: 100%;
padding: 20rpx 0 40rpx 0;
display: flex;
justify-content: center;
align-items: center;
}
.btn-save {
color: #FFFFFF;
background-color: #2272FF;
font-size: 32rpx;
font-weight: bold;
}
</style>
......@@ -183,7 +183,7 @@
// 页面数据
getOrderList(index) {
// 状态处理
this.pageNumber += 1
// this.pageNumber += 1
this.loaded = false
var param = {
pageNumber: this.pageNumber,
......
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