|
@@ -2,11 +2,12 @@
|
|
|
<view>
|
|
|
<!-- 状态 -->
|
|
|
<!-- && userInfoRoleName.indexOf('admin') == -1 -->
|
|
|
- <view class="label" v-if="(form.status == 2 || form.status == 3 || form.status == 4)">
|
|
|
+ <view class="label" v-if="(form.dispatchingWorkers == 2 || form.status == 3 || form.status == 4)">
|
|
|
<view class="tab" ref="wx" :style="{'color':wxStyle,'height':'100%','border-right': '1rpx solid #f4f4f4'}" @click="tab('wx')">
|
|
|
<text>报修单</text>
|
|
|
</view>
|
|
|
- <view class="tab" ref="gz" :style="{'color':gzStyle,'height':'100%','border-left': '1rpx solid #f4f4f4'}" @click="tab('gz')">
|
|
|
+ <view class="tab" ref="gz" :style="{'color':gzStyle,'height':'100%','border-left': '1rpx solid #f4f4f4'}"
|
|
|
+ @click="tab('gz')">
|
|
|
<text>工作单</text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -17,9 +18,9 @@
|
|
|
<!-- <view class="text">设备信息:</view> -->
|
|
|
<u-input v-model="form.deviceName" disabledColor="#fff" disabled
|
|
|
border="none" placeholder="请选择设备信息" >
|
|
|
- <template slot="suffix">
|
|
|
+ <!-- <template slot="suffix">
|
|
|
<u-icon name="scan" color="#bbb" size="32"></u-icon>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</u-input>
|
|
|
</view>
|
|
|
|
|
@@ -68,9 +69,9 @@
|
|
|
<!-- <view class="text">设备信息:</view> -->
|
|
|
<u-input v-model="form.deviceName" disabledColor="#fff" disabled
|
|
|
border="none" placeholder="请选择设备信息" >
|
|
|
- <template slot="suffix">
|
|
|
+ <!-- <template slot="suffix">
|
|
|
<u-icon name="scan" color="#bbb" size="32"></u-icon>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</u-input>
|
|
|
</view>
|
|
|
|
|
@@ -118,9 +119,9 @@
|
|
|
<!-- <view class="text">设备信息:</view> -->
|
|
|
<u-input v-model="form.deviceName" disabledColor="#fff" disabled
|
|
|
border="none" placeholder="请选择设备信息" >
|
|
|
- <template slot="suffix">
|
|
|
+ <!-- <template slot="suffix">
|
|
|
<u-icon name="scan" color="#bbb" size="32"></u-icon>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</u-input>
|
|
|
</view>
|
|
|
|
|
@@ -147,9 +148,9 @@
|
|
|
<view>
|
|
|
<view class="kapian" v-for="(item,index) in form.maintenanceFees" :key="item.id">
|
|
|
<view class="WXflex">
|
|
|
- <view class="wxscfun" style="color: #fff; background-color: #FD4B09;" v-if="form.status == 3" @click="maintenanceDe(item,index)">删除</view>
|
|
|
+ <view class="wxscfun" style="color: #fff; background-color: #FD4B09;" v-if="form.status == 3" @click="kapianClick(item,index)">修改</view>
|
|
|
</view>
|
|
|
- <view class="repairProject" @click="kapianClick(item)">
|
|
|
+ <view class="repairProject">
|
|
|
<view class="wxbox">
|
|
|
{{item.costName}}
|
|
|
</view>
|
|
@@ -176,24 +177,25 @@
|
|
|
|
|
|
<u-gap height="60"></u-gap>
|
|
|
|
|
|
- <view class="bottombox" v-if="type != 'XQ'">
|
|
|
- <view class="bottombox_name" v-if="form.status != 3 && form.status != 1">
|
|
|
+ <view class="bottombox">
|
|
|
+ <view class="bottombox_name" v-if="form.dispatchingWorkers == 2 && form.status != 1">
|
|
|
<text>{{form.maintenanceWorkerName}}</text>
|
|
|
</view>
|
|
|
<view class="bottombox_name" @click="pickerShowfun" v-if="form.status == 1 && userInfoRoleName.indexOf('admin') != -1">
|
|
|
<text>{{form.maintenanceWorkerName == null || form.maintenanceWorkerName == '' ? '请选择维修工' : form.maintenanceWorkerName}}</text>
|
|
|
</view>
|
|
|
- <view v-if="form.status == 3 && wxStyle == ''" style="color: #FD4B09;">维修费:{{form.maintenanceAmount}}元</view>
|
|
|
+ <view v-if="(form.status == 3 || form.status == 4) && form.dispatchingWorkers == 3" style="color: #FD4B09;">维修费:{{form.maintenanceAmount?form.maintenanceAmount:0}}元</view>
|
|
|
<view class="bottombox_right">
|
|
|
<view class="buttonClass"
|
|
|
v-if="form.status == 1 && userInfoRoleName.indexOf('admin') != -1"
|
|
|
@click="maintenanceDispatchingWorkersfun">确认派工</view>
|
|
|
<view class="buttonClass"
|
|
|
- v-if="form.status == 2 && userInfoRoleName.indexOf('admin') != -1"
|
|
|
+ v-if="form.dispatchingWorkers == 2 && userInfoRoleName.indexOf('admin') != -1"
|
|
|
@click="maintenanceRevokeDispatchingWorkersfun">撤销派工</view>
|
|
|
- <view class="buttonClass" v-if="form.status == 2 && userInfoRoleName.indexOf('维修工') != -1" @click="receivingOrdersfun">确认接单</view>
|
|
|
- <view class="buttonClass" v-if="form.status == 3" @click="Confirmexpenses">确认费用</view>
|
|
|
- <view class="buttonClass" v-if="form.status == 4" @click="Confirmexpenses">确认结算</view>
|
|
|
+ <view class="buttonClass" v-if="form.dispatchingWorkers == 2 && userInfoRoleName.indexOf('维修工') != -1" @click="receivingOrdersfun">确认接单</view>
|
|
|
+ <view class="buttonClass" v-if="form.status == 3 && userInfoRoleName.indexOf('维修工') != -1 && form.dispatchingWorkers == 3" @click="Confirmexpenses">确认费用</view>
|
|
|
+ <view class="buttonClass" v-if="form.status == 4" @click="Revocationfeesfun">撤销费用</view>
|
|
|
+ <view class="buttonClass" v-if="form.status == 4" @click="ConfirmSettlement">确认结算</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -211,16 +213,17 @@
|
|
|
</u-popup> -->
|
|
|
|
|
|
<u-modal :show="kapianShow" title="项目" :showCancelButton="true" @cancel="kapianCancel" @confirm="kapianConfirm" confirmColor="#FD4B09">
|
|
|
- <view class="kapianModel">
|
|
|
- <view>
|
|
|
- <text style="color: #FD4B09;">项目:</text>
|
|
|
+ <view style="position: relative;">
|
|
|
+ <view class="positionSC" @click="maintenanceDe(kapianindex)">删除</view>
|
|
|
+ <view class="kapianModel">
|
|
|
+ <text style="color: #FD4B09;font-size: 28rpx;">项目:</text>
|
|
|
<u-input v-model="kapian.costName" disabledColor="#fff" :disabled="form.status != 3"
|
|
|
- border="none" confirm-type="next" placeholder="添加项目" ></u-input>
|
|
|
+ border="bottom" confirm-type="next" placeholder="添加项目" ></u-input>
|
|
|
</view>
|
|
|
- <view>
|
|
|
- <text style="color: #FD4B09;">金额:</text>
|
|
|
+ <view class="kapianModel">
|
|
|
+ <text style="color: #FD4B09;font-size: 28rpx;">金额:</text>
|
|
|
<u-input v-model="kapian.amount" disabledColor="#fff" :disabled="form.status != 3"
|
|
|
- border="none" type="digit" confirm-type="done" @input="moneyInput" placeholder="金额" ></u-input>
|
|
|
+ border="bottom" type="digit" confirm-type="done" @input="moneyInput" placeholder="金额" ></u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-modal>
|
|
@@ -234,7 +237,8 @@
|
|
|
maintenanceConfirm,
|
|
|
userList,
|
|
|
maintenanceDispatchingWorkers,
|
|
|
- maintenanceRevokeDispatchingWorkers
|
|
|
+ maintenanceRevokeDispatchingWorkers,
|
|
|
+ maintenancerRvokeConfirmFees
|
|
|
} from '@/api/device/index.js'
|
|
|
import http from '@/http/api.js'
|
|
|
import {
|
|
@@ -269,7 +273,9 @@
|
|
|
// 添加费用弹窗
|
|
|
kapianShow: false,
|
|
|
pickerList:[],
|
|
|
- userInfoRoleName:[]
|
|
|
+ userInfoRoleName:[],
|
|
|
+ // 当前点击费用的下标
|
|
|
+ kapianindex:null,
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
@@ -282,8 +288,11 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- kapianClick(item) {
|
|
|
+ // 添加费用的点击
|
|
|
+ kapianClick(item,index) {
|
|
|
+ if (this.form.status == 4) return
|
|
|
this.kapian = item
|
|
|
+ this.kapianindex = index
|
|
|
this.kapianShow = true;
|
|
|
},
|
|
|
// 添加项目取消
|
|
@@ -293,7 +302,13 @@
|
|
|
},
|
|
|
// 添加项目确认
|
|
|
kapianConfirm() {
|
|
|
- this.form.maintenanceFees.push(this.kapian)
|
|
|
+ console.log("this.kapianindex," + this.kapianindex);
|
|
|
+ if (this.kapianindex != null) {
|
|
|
+ this.form.maintenanceFees[this.kapianindex] = this.kapian
|
|
|
+ }else {
|
|
|
+ this.form.maintenanceFees.push(this.kapian)
|
|
|
+ }
|
|
|
+ this.kapianindex = null
|
|
|
this.kapianShow = false;
|
|
|
},
|
|
|
moneyInput() {
|
|
@@ -312,13 +327,14 @@
|
|
|
// this.form.status = 2
|
|
|
|
|
|
} else if (type == "gz") {
|
|
|
+ if (this.form.dispatchingWorkers == 2) return
|
|
|
this.gzStyle = "#fd4b09"
|
|
|
this.wxStyle = ""
|
|
|
// this.form.status = 3
|
|
|
}
|
|
|
},
|
|
|
// 设备删除
|
|
|
- maintenanceDe(row,index){
|
|
|
+ maintenanceDe(index){
|
|
|
this.form.maintenanceFees.splice(index,1)
|
|
|
this.moneyInput()
|
|
|
},
|
|
@@ -354,6 +370,7 @@
|
|
|
message: "派工成功",
|
|
|
})
|
|
|
this.form = res.data
|
|
|
+ this.tab('wx')
|
|
|
}else {
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'error',
|
|
@@ -425,7 +442,7 @@
|
|
|
if (res.code == 200) {
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'success',
|
|
|
- message: "接单成功",
|
|
|
+ message: "操作成功",
|
|
|
})
|
|
|
// uni.navigateBack({
|
|
|
// delta: 1
|
|
@@ -442,6 +459,27 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ // 撤销费用
|
|
|
+ Revocationfeesfun(){
|
|
|
+ maintenancerRvokeConfirmFees(this.form).then(res=>{
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: "撤销成功",
|
|
|
+ })
|
|
|
+ this.form = res.data
|
|
|
+ }else {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 确认结算
|
|
|
+ ConfirmSettlement(){
|
|
|
+
|
|
|
+ },
|
|
|
// 确认接单接口
|
|
|
receivingOrdersfun(){
|
|
|
maintenanceReceivingOrders(this.form).then(res=>{
|
|
@@ -452,6 +490,7 @@
|
|
|
message: "接单成功",
|
|
|
})
|
|
|
this.form = res.data
|
|
|
+ this.tab('gz')
|
|
|
}else {
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'error',
|
|
@@ -470,10 +509,10 @@
|
|
|
if (this.form.status == 4) {
|
|
|
this.gzStyle = "#fd4b09"
|
|
|
this.wxStyle = ""
|
|
|
- } else if (this.form.status == 3) {
|
|
|
+ } else if (this.form.status == 3 && this.form.dispatchingWorkers == 3) {
|
|
|
this.gzStyle = "#fd4b09"
|
|
|
this.wxStyle = ""
|
|
|
- } else if (this.form.status == 2) {
|
|
|
+ } else if (this.form.dispatchingWorkers == 2) {
|
|
|
console.log(this.form.status);
|
|
|
this.wxStyle = "#fd4b09"
|
|
|
this.gzStyle = ""
|
|
@@ -559,8 +598,19 @@
|
|
|
|
|
|
.kapianModel {
|
|
|
display: flex;
|
|
|
+ align-items: center;
|
|
|
// justify-content: flex-start;
|
|
|
}
|
|
|
+ .positionSC {
|
|
|
+ position: absolute;
|
|
|
+ top: -80rpx;
|
|
|
+ right: -60rpx;
|
|
|
+ background: #fd4b09;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 30rpx;
|
|
|
+ padding: 10rpx 15rpx;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ }
|
|
|
|
|
|
.label {
|
|
|
left: 0rpx;
|
|
@@ -687,7 +737,8 @@
|
|
|
.buttonClass {
|
|
|
// background: #2d4a6a;
|
|
|
background: #FD4B09;
|
|
|
- padding: 10rpx 60rpx;
|
|
|
+ padding: 15rpx;
|
|
|
+ margin: 0 5rpx;
|
|
|
border-radius: 30rpx;
|
|
|
color: #fff;
|
|
|
// font-weight: bold;
|