|
|
|
|
@ -5,59 +5,54 @@ |
|
|
|
|
<u-form labelPosition="left" :rules="rules" ref="repairDetailsForm" :model="repairDetails" |
|
|
|
|
:label-width="200" class="repair_form"> |
|
|
|
|
<u-form-item label="需求单号:" prop="requirementCode" :border-bottom="false"> |
|
|
|
|
<!-- <u-input v-model="repairDetails.requirementCode" type="text" :border="true" /> --> |
|
|
|
|
<betone-new-input label="" v-model="repairDetails.requirementCode" placeholder="请输入" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="提报单位:" prop="reportUnit" :border-bottom="false"> |
|
|
|
|
<!-- <u-input v-model="repairDetails.reportUnit" type="text" :border="true" :disabled="disabled" /> --> |
|
|
|
|
<betone-new-input label="" v-model="repairDetails.reportUnit" placeholder="请输入" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="故障现象描述:" prop="faultDescribe" :border-bottom="false"> |
|
|
|
|
<!-- <u-input v-model="repairDetails.faultDescribe" type="textarea" :border="true" |
|
|
|
|
:disabled="disabled" /> --> |
|
|
|
|
<betone-new-input label="" v-model="repairDetails.faultDescribe" placeholder="请输入" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="故障位置:" prop="faultLocation" :border-bottom="false"> |
|
|
|
|
<!-- <u-input v-model="repairDetails.faultLocation" type="text" :border="true" :disabled="disabled" /> --> |
|
|
|
|
<betone-new-input label="" v-model="repairDetails.faultLocation" placeholder="请输入" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="设备名称:" prop="deviceName" :border-bottom="false"> |
|
|
|
|
<!-- <u-input v-model="repairDetails.deviceName" type="text" :border="true" :disabled="disabled" /> --> |
|
|
|
|
<betone-new-input label="" v-model="repairDetails.deviceName" placeholder="请输入" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="设备专业类型:" prop="faultType" :border-bottom="false"> |
|
|
|
|
<!-- <u-input v-model="repairDetails.faultType" type="text" :border="true" :disabled="disabled" /> --> |
|
|
|
|
<betone-new-input label="" v-model="repairDetails.faultType" placeholder="请输入" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
<view class="repair_detail"> |
|
|
|
|
<!-- 维修人员 接单展示--> |
|
|
|
|
<view class="repair_detail" |
|
|
|
|
v-if="(dataTypes == 4 || dataTypes == 2) && (detailForm.status == 1 || detailForm.status == 0)"> |
|
|
|
|
<view class="repair_title">派单信息</view> |
|
|
|
|
<u-form labelPosition="left" :rules="sendRules" ref="sendOrderForm" :model="sendOrder" :label-width="200" |
|
|
|
|
class="repair_form"> |
|
|
|
|
<u-form-item label="维修人员:" prop="name" :border-bottom="false" :required="true"> |
|
|
|
|
<u-input v-if="dataTypes == 2" v-model="sendOrder.name" type="select" :border="true" |
|
|
|
|
@click="sendOrdersShow = true" :disabled="disabled" /> |
|
|
|
|
<betone-new-input v-if="dataTypes == 4" label="" v-model="sendOrder.name" placeholder="请输入" |
|
|
|
|
<betone-new-input v-if="dataTypes == 4" label="" v-model="sendOrder.name" placeholder="" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="计划完成时间:" prop="planCompleteTime" :border-bottom="false"> |
|
|
|
|
<u-input v-if="dataTypes == 2" v-model="sendOrder.planCompleteTime" type="select" |
|
|
|
|
@click="calendarShow = true" :border="true" placeholder="请选择时间" :disabled="disabled" /> |
|
|
|
|
<betone-new-input v-if="dataTypes == 4" label="" v-model="sendOrder.planCompleteTime" |
|
|
|
|
placeholder="请输入" :disabled="disabled" /> |
|
|
|
|
<betone-new-input v-if="dataTypes == 4" label="" v-model="sendOrder.planCompleteTime" placeholder="" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="客服意见:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<u-input v-if="dataTypes == 2" v-model="sendOrder.customerOpinion" type="textarea" :border="true" |
|
|
|
|
:disabled="disabled" /> |
|
|
|
|
<betone-new-input v-if="dataTypes == 4" label="" v-model="sendOrder.customerOpinion" |
|
|
|
|
placeholder="请输入" :disabled="disabled" /> |
|
|
|
|
:disabled="disabled" :height="120" /> |
|
|
|
|
<betone-new-input v-if="dataTypes == 4" label="" v-model="sendOrder.customerOpinion" placeholder="" |
|
|
|
|
:disabled="disabled" type="textarea" :height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
|
|
|
|
|
<u-form-item v-if="dataTypes == 4" label="是否申领物料:" prop="isNeedMaterials" :border-bottom="false" |
|
|
|
|
@ -77,7 +72,6 @@ |
|
|
|
|
<view class="material-text">型号:{{ item.xh }}</view> |
|
|
|
|
<view class="material-text">数量:{{ item.goodsNum }}</view> |
|
|
|
|
<view class="material-text">单位:{{ item.unit }}</view> |
|
|
|
|
<view class="material-text">价格:{{ item.brand }}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<u-button size="medium" :plain="true" style="margin-right: 32rpx;width:100%" type="primary" |
|
|
|
|
@ -85,22 +79,147 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<u-form-item v-if="dataTypes == 4" label="备注:" prop="remark" :border-bottom="false"> |
|
|
|
|
<u-input v-model="sendOrder.remark" type="textarea" :border="true" /> |
|
|
|
|
<u-input v-model="sendOrder.remark" type="textarea" :border="true" :height="120" /> |
|
|
|
|
|
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 维修人员 待提交维修方案 --> |
|
|
|
|
<view class="repair_detail" v-if="dataTypes == 4 && detailForm.status == 2"> |
|
|
|
|
<view class="repair_title">处理情况</view> |
|
|
|
|
<u-form labelPosition="left" ref="sendOrderForm" :model="detailForm" :label-width="200" class="repair_form"> |
|
|
|
|
<u-form-item label="接单时间:" prop="dispatchTime" :border-bottom="false"> |
|
|
|
|
<betone-new-input label="" v-model="detailForm.dispatchTime" placeholder="" :disabled="true" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="计划完成时间:" prop="planCompleteTime" :border-bottom="false"> |
|
|
|
|
<betone-new-input label="" v-model="detailForm.planCompleteTime" placeholder="" :disabled="true" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="客服意见:" prop="customerOpinion" :border-bottom="false"> |
|
|
|
|
<betone-new-input label="" v-model="detailForm.customerOpinion" placeholder="" :disabled="true" |
|
|
|
|
type="textarea" :height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
<!-- 维修详情 待提交维修方案 展示 --> |
|
|
|
|
<view class="repair_detail" |
|
|
|
|
v-if="(dataTypes == 4 && detailForm.status == 2) || (dataTypes == 3 && detailForm.status == 3)"> |
|
|
|
|
<view class="repair_title">维修详情</view> |
|
|
|
|
<u-form labelPosition="left" :rules="repairInfoRules" ref="repairInfoForm" :model="repairInfo" |
|
|
|
|
:label-width="140" class="repair_form"> |
|
|
|
|
<u-form-item label="维修人:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<betone-new-input :disabled="true" label="" v-model="detailForm.repairPersonName" placeholder="" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="设备名称:" prop="deviceName" :border-bottom="false"> |
|
|
|
|
<betone-new-input :disabled="true" label="" v-model="detailForm.deviceName" placeholder="" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="故障原因:" prop="faultReason" :border-bottom="false" :required="true"> |
|
|
|
|
<betone-new-input label="" v-model="repairInfo.faultReason" placeholder="请输入" type="textarea" |
|
|
|
|
:disabled="optionDisabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="处理方法:" prop="dealMethods" :border-bottom="false" :required="true"> |
|
|
|
|
<betone-new-input label="" v-model="repairInfo.dealMethods" placeholder="请输入" type="textarea" |
|
|
|
|
:disabled="optionDisabled" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="是否申领物料:" prop="isMaterial" :border-bottom="false" :label-width="200" |
|
|
|
|
:required="true"> |
|
|
|
|
<uni-data-checkbox :disabled="optionDisabled" v-model="repairInfo.isMaterial" |
|
|
|
|
:localdata="isMaterialList"></uni-data-checkbox> |
|
|
|
|
</u-form-item> |
|
|
|
|
<view class="selectForm clearfix" v-if="repairInfo.isMaterial == 1"> |
|
|
|
|
<view class="form-item form-label">物料申领:</view> |
|
|
|
|
<view class="form-item form-content"> |
|
|
|
|
<view class="select-box clearfix"> |
|
|
|
|
<view class="select-box-item clearfix" v-for="(item, index) in sendOrder.materialsData" |
|
|
|
|
:key="index"> |
|
|
|
|
<view class="material-text">名称:{{ item.name }}</view> |
|
|
|
|
<view class="material-text">规格:{{ item.rule }}</view> |
|
|
|
|
<view class="material-text">型号:{{ item.xh }}</view> |
|
|
|
|
<view class="material-text">数量:{{ item.goodsNum }}</view> |
|
|
|
|
<view class="material-text">单位:{{ item.unit }}</view> |
|
|
|
|
<view class="material-text">价格:{{ (dataTypes == 3 && detailForm.status == |
|
|
|
|
3) ? item.materialPrice : (item.unifiedQuotation * item.goodsNum) }}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<u-button v-if="!optionDisabled" size="medium" :plain="true" |
|
|
|
|
style="margin-right: 32rpx;width:100%" type="primary" @click="goodsSelect()">{{ |
|
|
|
|
sendOrder.materialsData.length > 0 ? '修改' : '添加' }}</u-button> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<block v-if="dataTypes == 3 && detailForm.status == 3&&repairInfo.isMaterial == 1"> |
|
|
|
|
<u-form-item label="总价:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<view>{{ approveInfo.totalPrice }}</view> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="折扣:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<betone-new-input label="" v-model="approveInfo.discount" placeholder="" type="number" |
|
|
|
|
@changevalue="changDiscount" />折 |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="折扣后的金额:" prop="reportPeople" :border-bottom="false" :label-width="240"> |
|
|
|
|
<view>{{ approveInfo.discountPrice }}</view> |
|
|
|
|
</u-form-item> |
|
|
|
|
</block> |
|
|
|
|
</u-form> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<!-- 维修负责人 审批 --> |
|
|
|
|
<view class="repair_detail" v-if="dataTypes == 3 && detailForm.status == 3"> |
|
|
|
|
<view class="repair_title">主管审批</view> |
|
|
|
|
<u-form labelPosition="left" ref="repairInfoForm" :model="approveInfo" :label-width="140" |
|
|
|
|
class="repair_form"> |
|
|
|
|
<u-form-item label="审批结果:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<betone-input-picker :label="''" :pickerData="approveType" :mode="'selector'" :keyName="'text'" |
|
|
|
|
@changeSelect="changeApproveResult" v-model="approveInfo.approveText"></betone-input-picker> |
|
|
|
|
|
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="审批意见:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<betone-new-input label="" v-model="approveInfo.approveRemark" placeholder="请输入" type="textarea" |
|
|
|
|
:height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
<!-- 客户 审批 确认维修方案 --> |
|
|
|
|
<view class="repair_detail" v-if="dataTypes == 1 && detailForm.status == 4"> |
|
|
|
|
<view class="repair_title">客户审批</view> |
|
|
|
|
<u-form labelPosition="left" ref="repairInfoForm" :model="clientInfo" :label-width="140" |
|
|
|
|
class="repair_form"> |
|
|
|
|
<u-form-item label="审批结果:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<betone-input-picker :label="''" :pickerData="approveType" :mode="'selector'" :keyName="'text'" |
|
|
|
|
@changeSelect="changeClientResult" v-model="clientInfo.approveText"></betone-input-picker> |
|
|
|
|
|
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item label="审批意见:" prop="reportPeople" :border-bottom="false"> |
|
|
|
|
<betone-new-input label="" v-model="clientInfo.approveRemark" placeholder="请输入" type="textarea" |
|
|
|
|
:height="120" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
</view> |
|
|
|
|
<!-- btns --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 2"> |
|
|
|
|
<!-- 客服派单--> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 2 && detailForm.status == 0"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="sendOrderSubmit()">确定派单</u-button> |
|
|
|
|
</view> |
|
|
|
|
<view class="repair-4-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 4"> |
|
|
|
|
<!-- 维修人员接单--> |
|
|
|
|
<view class="repair-4-btn" style="margin-right: 32rpx;width:100%" |
|
|
|
|
v-if="dataTypes == 4 && detailForm.status == 1"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" @click="turnShow = true">驳回</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="repairOrderSubmit()">确定派单</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="repairOrderSubmit()">确认接单</u-button> |
|
|
|
|
</view> |
|
|
|
|
<!-- 维修人员 提交维修方案 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 4 && detailForm.status == 2"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="servicemanSubmit()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
<!-- 维修负责人 审批 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 3 && detailForm.status == 3"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="approveSubmit()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
<!-- 客户确认维修方案 --> |
|
|
|
|
<view class="repair-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 1 && detailForm.status == 4"> |
|
|
|
|
<u-button size="medium" @click="endOrderCancel()">取消</u-button> |
|
|
|
|
<u-button size="medium" type="primary" @click="customerSubmit()">提交</u-button> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 选择维修人员 --> |
|
|
|
|
<u-select v-model="sendOrdersShow" :list="sendOrdersList" @confirm="sendOrdersConfirm" :isShowsearch="true" |
|
|
|
|
value-name="id" title="选择维修人员"></u-select> |
|
|
|
|
@ -145,11 +264,12 @@ |
|
|
|
|
</betone-dialog> |
|
|
|
|
|
|
|
|
|
<!-- 维修人员驳回 --> |
|
|
|
|
<betone-modal v-model="turnShow" :title="'驳回原因'" @confirm="turnFn"> |
|
|
|
|
<betone-modal v-model="turnShow" :title="'驳回原因'" @confirm="turnFn" @cancel="turnShow = false"> |
|
|
|
|
<view class="modal-text"> |
|
|
|
|
<betone-new-input v-model="repaiRejectReason" placeholder="请输入" style="margin-bottom: 32rpx" /> |
|
|
|
|
</view> |
|
|
|
|
</betone-modal> |
|
|
|
|
<betone-loading ref="BetLoading" /> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
@ -162,7 +282,10 @@ export default { |
|
|
|
|
}, |
|
|
|
|
disabled() { |
|
|
|
|
return this.$store.state.dataType == 2 ? false : true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
optionDisabled() { |
|
|
|
|
return this.$store.state.dataType == 3 && this.detailForm.status == 3 ? true : false |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
data() { |
|
|
|
|
@ -229,10 +352,64 @@ export default { |
|
|
|
|
isGoodsNomore: false, |
|
|
|
|
turnShow: false,//驳回弹框 |
|
|
|
|
repaiRejectReason: '',//驳回弹框 |
|
|
|
|
|
|
|
|
|
repairInfo: {//维修人员 维修方案提交 |
|
|
|
|
reportPeople: '',//填报人 |
|
|
|
|
deviceName: '',//设备名称 |
|
|
|
|
faultReason: '',//故障原因 |
|
|
|
|
dealMethods: '',//处理方法 |
|
|
|
|
isMaterial: null,//是否申领物料 |
|
|
|
|
materialTable: [],//物料数据 |
|
|
|
|
}, |
|
|
|
|
repairInfoRules: { |
|
|
|
|
faultReason: [ |
|
|
|
|
{ |
|
|
|
|
type: "string", |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入", |
|
|
|
|
trigger: ["blur", "change"], |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
dealMethods: [ |
|
|
|
|
{ |
|
|
|
|
type: "string", |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入", |
|
|
|
|
trigger: ["blur", "change"], |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
approveInfo: {//维修负责人审批 |
|
|
|
|
discount: null,//折扣 |
|
|
|
|
discountPrice: null,//折扣后的价格 |
|
|
|
|
totalPrice: null,//总价 |
|
|
|
|
approvePerson: '',//审批人 id |
|
|
|
|
approveRemark: '',//审批备注 |
|
|
|
|
approveResult: null,//1通过 0驳回 |
|
|
|
|
approveText: '',//展示内容 |
|
|
|
|
approveTime: '',//当前时间 |
|
|
|
|
}, |
|
|
|
|
approveType: [ |
|
|
|
|
{ |
|
|
|
|
text: '通过', |
|
|
|
|
value: 1 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '驳回', |
|
|
|
|
value: 0 |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
clientInfo: { |
|
|
|
|
approvePerson: '',//审批人 id |
|
|
|
|
approveRemark: '',//审批备注 |
|
|
|
|
approveResult: null,//1通过 0驳回 |
|
|
|
|
approveText: '',//展示内容 |
|
|
|
|
approveTime: '',//当前时间 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onReady() { |
|
|
|
|
this.$refs.sendOrderForm.setRules(this.sendRules); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.getRepairPersons()//获取维修人员列表 |
|
|
|
|
@ -261,8 +438,24 @@ export default { |
|
|
|
|
this.sendOrder.planCompleteTime = this.detailForm.planCompleteTime.split(' ')[0] |
|
|
|
|
this.sendOrder.customerOpinion = this.detailForm.customerOpinion |
|
|
|
|
this.sendOrder.remark = this.detailForm.remark |
|
|
|
|
// repairPersonName |
|
|
|
|
|
|
|
|
|
// 维修主管审批 填充字段 |
|
|
|
|
this.repairInfo.faultReason = this.detailForm.faultCause |
|
|
|
|
this.repairInfo.dealMethods = this.detailForm.processMethod |
|
|
|
|
this.repairInfo.isMaterial = this.detailForm.isNeedMaterial |
|
|
|
|
this.sendOrder.materialsData = this.detailForm.materials |
|
|
|
|
let data = 0 |
|
|
|
|
if (this.detailForm.materials.length > 0) { |
|
|
|
|
this.detailForm.materials.forEach(item => { |
|
|
|
|
data = data + item.materialPrice |
|
|
|
|
console.log(1111111, item.materialPrice) |
|
|
|
|
item.goodsNum = item.materialCount |
|
|
|
|
item.name = item.materialName |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 获取审批总价 |
|
|
|
|
this.approveInfo.totalPrice = data |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
@ -292,11 +485,12 @@ export default { |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 客服接单 确认 |
|
|
|
|
// 客服接单 确认 先调用修改工单的接口 再调客服派单的接口 |
|
|
|
|
sendOrderSubmit() { |
|
|
|
|
this.$refs.sendOrderForm.setRules(this.sendRules); |
|
|
|
|
this.$refs.sendOrderForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
let query = { |
|
|
|
|
let updayeQuery = { |
|
|
|
|
id: this.orderId, |
|
|
|
|
reportUnit: this.repairDetails.reportUnit, |
|
|
|
|
faultDescribe: this.repairDetails.faultDescribe, |
|
|
|
|
@ -304,20 +498,33 @@ export default { |
|
|
|
|
faultType: this.repairDetails.faultType, |
|
|
|
|
deviceName: this.repairDetails.deviceName, |
|
|
|
|
dispatchTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()), |
|
|
|
|
status: this.dataTypes == 2 ? 2 : this.dataTypes == 3 ? 2 : this.dataTypes == 4 ? 3 : '', |
|
|
|
|
remark: this.repairDetails.remark, |
|
|
|
|
} |
|
|
|
|
let sendOrderQuery_ = { |
|
|
|
|
id: this.orderId, |
|
|
|
|
repairPerson: this.sendOrder.repairPerson, |
|
|
|
|
planCompleteTime: this.sendOrder.planCompleteTime ? this.sendOrder.planCompleteTime + ' 00:00:00' : '', |
|
|
|
|
remark: this.repairDetails.remark, |
|
|
|
|
customerOpinion: this.sendOrder.customerOpinion |
|
|
|
|
} |
|
|
|
|
this.$u.api.editData(query).then(res => { |
|
|
|
|
|
|
|
|
|
this.$u.api.workOrderupdate(updayeQuery).then(res => { |
|
|
|
|
this.BetLoading.hide(); |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "派单成功", icon: "none" }); |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
this.$u.api.serviceman(sendOrderQuery_).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "派单成功", icon: "none" }); |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.BetLoading.hide(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
console.log('验证失败'); |
|
|
|
|
} |
|
|
|
|
@ -388,18 +595,8 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 维修人员接单确认 |
|
|
|
|
// 维修人员接单确认 如果有申领物料 先调用申领物料接口 再调用维修人员接收工单按钮 |
|
|
|
|
repairOrderSubmit() { |
|
|
|
|
let query = { |
|
|
|
|
id: this.orderId, |
|
|
|
|
reportUnit: this.repairDetails.reportUnit, |
|
|
|
|
dispatchTime: this.detailForm.dispatchTime, |
|
|
|
|
planCompleteTime: this.detailForm.planCompleteTime, |
|
|
|
|
repairPerson: null, |
|
|
|
|
status: this.dataTypes == 2 ? 2 : this.dataTypes == 3 ? 2 : this.dataTypes == 4 ? 3 : '', |
|
|
|
|
remark: this.sendOrder.remark, |
|
|
|
|
customerOpinion: this.detailForm.customerOpinion |
|
|
|
|
} |
|
|
|
|
// 判断是否申领物料 调用申领接口 |
|
|
|
|
if (this.sendOrder.isNeedMaterials == 1 && this.sendOrder.materialsData.length <= 0) { |
|
|
|
|
uni.showToast({ title: "请选择需要的申领材料", icon: "none" }); |
|
|
|
|
@ -410,38 +607,57 @@ export default { |
|
|
|
|
uni.showToast({ title: "申领数量不能为0", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
let data = [] |
|
|
|
|
console.log('this.materialsData', this.sendOrder.materialsData) |
|
|
|
|
this.sendOrder.materialsData.map(item => { |
|
|
|
|
data.push({ |
|
|
|
|
productId: item.productName,//物资id |
|
|
|
|
productName: item.name, //物资名称 |
|
|
|
|
brand: item.brand,//品牌 |
|
|
|
|
xh: item.xh,//型号 |
|
|
|
|
rule: item.rule,//参数 |
|
|
|
|
applyNum: item.applyNum,//领用数量 |
|
|
|
|
this.BetLoading.show(); |
|
|
|
|
if (this.sendOrder.isNeedMaterials == 1) { |
|
|
|
|
let data = [] |
|
|
|
|
this.sendOrder.materialsData.map(item => { |
|
|
|
|
data.push({ |
|
|
|
|
inventoryId: item.inventoryId,//物资id |
|
|
|
|
productName: item.name, //物资名称 |
|
|
|
|
brand: item.brand,//品牌 |
|
|
|
|
xh: item.xh,//型号 |
|
|
|
|
rule: item.rule,//参数 |
|
|
|
|
applyNum: item.applyNum,//领用数量 |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
let query1 = { |
|
|
|
|
details: data, |
|
|
|
|
applyUserId: this.userInfo.user_id, //申领人Id |
|
|
|
|
applyUser: this.userInfo.user_name, //申领人 |
|
|
|
|
applyTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//申领时间(yyyy-MM-dd HH:mm:ss) |
|
|
|
|
status: 0, |
|
|
|
|
workId: this.orderId, |
|
|
|
|
} |
|
|
|
|
this.$u.api.applySave(query1).then(res => { |
|
|
|
|
// 申领传参 |
|
|
|
|
let query1 = { |
|
|
|
|
details: data, |
|
|
|
|
applyUserId: this.userInfo.user_id, //申领人Id |
|
|
|
|
applyUser: this.userInfo.user_name, //申领人 |
|
|
|
|
applyTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//申领时间(yyyy-MM-dd HH:mm:ss) |
|
|
|
|
status: 0, |
|
|
|
|
workId: this.orderId, |
|
|
|
|
} |
|
|
|
|
this.$u.api.applySave(query1).then(res => { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.$u.api.editData(query).then(res => { |
|
|
|
|
let query_ = { |
|
|
|
|
id: this.orderId |
|
|
|
|
} |
|
|
|
|
this.$u.api.servicemanReceive(query_).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "派单成功", icon: "none" }); |
|
|
|
|
uni.showToast({ title: "确认成功", icon: "none" }); |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.$u.api.editData(query).then(res => { |
|
|
|
|
// if (res.code == 200) { |
|
|
|
|
// uni.showToast({ title: "派单成功", icon: "none" }); |
|
|
|
|
// uni.navigateBack({ |
|
|
|
|
// delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 维修人员驳回 |
|
|
|
|
turnFn() { |
|
|
|
|
@ -464,7 +680,192 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 维修人员提交方案 |
|
|
|
|
servicemanSubmit() { |
|
|
|
|
this.$refs.repairInfoForm.setRules(this.repairInfoRules); |
|
|
|
|
// 选择物料列表 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.repairInfoForm |
|
|
|
|
this.$refs.repairInfoForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
|
|
if (this.repairInfo.isMaterial == null) { |
|
|
|
|
uni.showToast({ title: "是否申领物料", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.repairInfo.isMaterial == 1 && this.sendOrder.materialsData.length <= 0) { |
|
|
|
|
uni.showToast({ title: "请选择需要申领的物料信息", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
// 申领物料 数量的判断 |
|
|
|
|
if (this.sendOrder.materialsData.find(item => item.goodsNum == 0)) { |
|
|
|
|
uni.showToast({ title: "申领数量不能为0", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
let data = [] |
|
|
|
|
if (this.repairInfo.isMaterial == 1) { |
|
|
|
|
this.sendOrder.materialsData.map(item => { |
|
|
|
|
data.push({ |
|
|
|
|
inventoryId: item.inventoryId,//物资id |
|
|
|
|
materialName: item.name, //物资名称 |
|
|
|
|
brand: item.brand,//品牌 |
|
|
|
|
xh: item.xh,//型号 |
|
|
|
|
rule: item.rule,//参数 |
|
|
|
|
materialPrice: item.goodsNum * item.unifiedQuotation, |
|
|
|
|
materialCount: item.goodsNum,//领用数量 |
|
|
|
|
orderId: this.detailForm.id, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
let query = { |
|
|
|
|
id: this.detailForm.id, |
|
|
|
|
faultCause: this.repairInfo.faultReason, |
|
|
|
|
processMethod: this.repairInfo.dealMethods, |
|
|
|
|
isNeedMaterial: this.repairInfo.isMaterial, |
|
|
|
|
materials: data |
|
|
|
|
} |
|
|
|
|
this.$u.api.workOrderupdate(query).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
|
|
|
|
let query1 = { |
|
|
|
|
id: this.detailForm.id |
|
|
|
|
} |
|
|
|
|
this.$u.api.servicemanSubmit(query1).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "提交成功", icon: "none" }); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 维修负责人审批 输入折扣 |
|
|
|
|
changDiscount(e) { |
|
|
|
|
this.approveInfo.discountPrice = (e / 10) * this.approveInfo.totalPrice |
|
|
|
|
}, |
|
|
|
|
changeApproveResult(e) { |
|
|
|
|
this.approveInfo.approveText = this.approveType[e].text |
|
|
|
|
this.approveInfo.approveResult = this.approveType[e].value |
|
|
|
|
}, |
|
|
|
|
// 维修负责人审批 先更新工单信息 再调用维修负责人审批按钮 |
|
|
|
|
approveSubmit() { |
|
|
|
|
// 需要更新的工单信息 |
|
|
|
|
let query_ = { |
|
|
|
|
discount: this.approveInfo.discount, |
|
|
|
|
discountPrice: this.approveInfo.discountPrice, |
|
|
|
|
id: this.detailForm.id, |
|
|
|
|
totalPrice: this.approveInfo.totalPrice, |
|
|
|
|
} |
|
|
|
|
// 维修负责人审批 |
|
|
|
|
let query1 = { |
|
|
|
|
id: this.detailForm.id, |
|
|
|
|
approvePerson: this.userInfo.user_id,//审批人 id |
|
|
|
|
approveRemark: this.approveInfo.approveRemark,//审批备注 |
|
|
|
|
approveResult: this.approveInfo.approveResult,//1通过 0驳回 |
|
|
|
|
approveTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//当前时间 |
|
|
|
|
} |
|
|
|
|
if (!this.approveInfo.discount&&this.repairInfo.isMaterial == 1) { |
|
|
|
|
uni.showToast({ title: "请填写折扣信息", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.approveInfo.approveResult == null) { |
|
|
|
|
uni.showToast({ title: "请选择审批结果", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (!this.approveInfo.approveRemark) { |
|
|
|
|
uni.showToast({ title: "请选择审批意见", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
this.$u.api.workOrderupdate(query_).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
|
|
|
|
if (this.approveInfo.approveResult == 1) { |
|
|
|
|
this.$u.api.supervisorconfirm(query1).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "审核成功", icon: "none" }); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.$u.api.supervisorReject(query1).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "驳回成功", icon: "none" }); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 客户确认维修方案 类别 |
|
|
|
|
changeClientResult(e) { |
|
|
|
|
this.clientInfo.approveText = this.approveType[e].text |
|
|
|
|
this.clientInfo.approveResult = this.approveType[e].value |
|
|
|
|
}, |
|
|
|
|
// 客户审核 提交 |
|
|
|
|
customerSubmit() { |
|
|
|
|
if (this.clientInfo.approveResult == null) { |
|
|
|
|
uni.showToast({ title: "请选择审批结果", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (!this.clientInfo.approveRemark) { |
|
|
|
|
uni.showToast({ title: "请选择审批意见", icon: "none" }); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
// 客户审批 |
|
|
|
|
let query1 = { |
|
|
|
|
id: this.detailForm.id, |
|
|
|
|
approvePerson: this.userInfo.user_id,//审批人 id |
|
|
|
|
approveRemark: this.clientInfo.approveRemark,//审批备注 |
|
|
|
|
approveResult: this.clientInfo.approveResult,//1通过 0驳回 |
|
|
|
|
approveTime: dateFormat("yyyy-MM-dd hh:mm:ss", new Date()),//当前时间 |
|
|
|
|
} |
|
|
|
|
if (this.clientInfo.approveResult == 1) {//通过 |
|
|
|
|
this.$u.api.customerConfirm(query1).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "确认成功", icon: "none" }); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else {//驳回 |
|
|
|
|
this.$u.api.customerReject(query1).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
uni.showToast({ title: "驳回成功", icon: "none" }); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 // 默认值是1,表示回退一个页面 |
|
|
|
|
}) |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取时间 |
|
|
|
|
initDate() { |
|
|
|
|
|
|
|
|
|
let date = new Date(); |
|
|
|
|
@ -496,7 +897,7 @@ export default { |
|
|
|
|
//this.maxDate = year + '-'+ month +'-' + day; // 最大日期可选到今天 |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -669,5 +1070,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.arrow { |
|
|
|
|
top: 12rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |