代码提交

test
zhangdi 1 year ago
parent 14f63f5b29
commit 291494f64a
  1. 24
      api/api.js
  2. 125
      common/betone_components/betone-list.vue
  3. 4
      common/betone_components/betone-modal.vue
  4. 2
      common/betone_components/betone-new-input.vue
  5. 12
      pages.json
  6. 5
      pages/login/login.vue
  7. 4
      pages/order/tasking.vue
  8. 72
      pages/submission/recordsdetails.vue
  9. 629
      pages/submission/sendOrders.vue
  10. 22
      utils/util.js

@ -126,8 +126,30 @@ const install = (Vue, vm) => {
authorization: false,
isparams: true
})
// 客服关闭接口 /
let cloneOrder = (params) => http.post('/workOrder/clone', params, {
authorization: false,
isparams: false
})
// 需求编辑 editData
let editData = (params) => http.post('/workOrder/update', params, {
authorization: false,
isparams: false
})
// 维修人员驳回 /
let repairReject = (params) => http.post('/workOrder/repairReject', params, {
authorization: false,
isparams: false
})
// 申领单提交 /
let applySave = (params) => http.post('/apply/save', params, {
authorization: false,
isparams: false
})
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList, workOrderSave, getWorkOrderRecords, getBreakdownInfo, workOrderupdate, evaluateSign, getRepairPersons, getGoodsList, getDictionaryList, getUserList, workList, deviceList,upkeepStat,pieStat,getUserInfo,overview };
vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList, workOrderSave, getWorkOrderRecords, getBreakdownInfo, workOrderupdate, evaluateSign, getRepairPersons, getGoodsList, getDictionaryList, getUserList, workList, deviceList,upkeepStat,pieStat,getUserInfo,overview,sendOrders,cloneOrder,editData,repairReject,applySave };
}
export default {

@ -8,7 +8,8 @@
bg-color="rgba(248, 248, 248, 1)"></u-tabs>
</view>
<view class="order-box">
<view class="order-item" v-for="(item, index) in orderData" :key="index" @click="goPage(item, 'details')">
<!-- @click="goPage(item, 'details')" -->
<view class="order-item" v-for="(item, index) in orderData" :key="index" >
<view class="item-top">
<view class="item-left" v-if="dataTypes == 1">
<text class="item-orderNo">单号{{ item.requirementCode }}</text>
@ -33,20 +34,28 @@
<text>{{ item.faultDescribe }}</text>
</view>
<view class="con-btn">
<!-- 所有状态都有 -->
<u-button size="mini" plain style="margin-right: 32rpx"
@click.stop="goPage(item, 'breakdownView')">查看</u-button>
<!-- 客户查看 -->
<block v-if="dataTypes == 1">
<u-button size="mini" plain style="margin-right: 32rpx"
@click.stop="goPage(item, 'breakdownView')">查看</u-button>
</block>
<!-- 客服维修人员维修负责人 -->
<block v-if="dataTypes != 1">
<u-button size="mini" plain style="margin-right: 32rpx"
@click.stop="goPage(item, 'details')">查看</u-button>
</block>
<!-- 状态0 客服才能进行派单 -->
<block v-if="item.status == 0 && dataTypes == 2">
<u-button size="mini" :plain="true" style="margin-right: 32rpx"
@click.stop="sendOrders()" type="primary">派单</u-button>
@click.stop="sendOrders(item)" type="primary"></u-button>
</block>
<block v-if="item.status == 0 && dataTypes == 4">
<!-- 状态2 维修人员展示接单确认按钮 -->
<block v-if="item.status == 2 && dataTypes == 4">
<u-button size="mini" :plain="true" style="margin-right: 32rpx" type="primary"
@click="orderConfirm(item)">接单确认</u-button>
</block>
<block v-if="item.status == 2 && dataTypes == 4">
<block v-if="item.status == 3 && dataTypes == 4">
<u-button size="mini" :plain="true" style="margin-right: 32rpx" type="primary"
@click="goPage(item, 'details')">维修</u-button>
</block>
@ -58,7 +67,9 @@
type="primary" @click="goPage(item, 'breakdownUpdate')">修改</u-button>
</block>
<!-- 待维修 -- 查看位置-->
<block v-if="(dataTypes == 1) && (item.status == 1 || item.status == 2 || item.status == 3)">
<block
v-if="(dataTypes == 1) && (item.status == 1 || item.status == 2 || item.status == 3)">
<u-button size="mini" :plain="true" style="margin-right: 32rpx" :hair-line="true"
type="primary" @click="goPage(item, 'location')">查看位置</u-button>
</block>
@ -67,14 +78,15 @@
type="primary" @click="goPage(item, 'evaluate')">评价</u-button>
</block>
<!-- 关闭 -->
<!-- <block>
<u-button size="mini" plain style="margin-right: 32rpx">关闭</u-button>
</block> -->
<!-- 驳回 -->
<!-- <block v-if="dataTypes == 1">
<!--客服角色 关闭 -->
<block v-if="(dataTypes == 2) && (item.status == 8 || item.status == 0)">
<u-button size="mini" plain type="primary" style="margin-right: 32rpx"
@click="openClone(item)">关闭</u-button>
</block>
<!-- 维修负责人 驳回 -->
<block v-if="(dataTypes == 3) && (item.status == 1 || item.status == 7)">
<u-button size="mini" plain style="margin-right: 32rpx">驳回</u-button>
</block> -->
</block>
</view>
</view>
</view>
@ -85,11 +97,14 @@
<betone-loading ref="BetLoading" />
<!-- 派单弹框 选择维修人员 -->
<u-select v-model="sendOrdersShow" :list="sendOrdersList" @confirm="sendOrdersConfirm" :isShowsearch="true"
value-name="id" title="选择维修人员"></u-select>
<!-- 关闭 弹框 -->
<betone-modal :title="'关闭原因'" :confirmText="'确认'" v-model="cloneVisible" @confirm="confirmCloseSub">
<view class="modal-text">
<betone-new-input v-model="cloneReason" placeholder="请输入" style="margin-bottom: 32rpx" />
</view>
</betone-modal>
</view>
</template>
@ -129,7 +144,11 @@ export default {
},
sendOrdersShow: false,//
sendOrdersList: []
sendOrdersList: [],
cloneVisible: false,//
cloneReason: '',//
cloneInfo: {},//
};
},
computed: {
@ -143,8 +162,8 @@ export default {
mounted() {
this.$nextTick(() => {
this.getRecordsList()
this.getRepairPersons()//
// this.getRecordsList()
// this.getRepairPersons()//
//
uni.$on('onReachBottom', () => {
if (this.isNomore) {
@ -227,12 +246,18 @@ export default {
if (item == 0) {
return '待接单'
}
if (item == 1 || item == 2 || item == 3) {
if(item == 2){ //
return '待接单'
}
if (item == 1 || item == 3) {
return '待维修'
}
if (item == 4 || item == 5 || item == 6) {
if (item == 4 || item == 5 || item == 6 || item == 9) {
return '已完成'
}
if (item == 7) {
return '已驳回'
}
},
//
@ -251,25 +276,23 @@ export default {
},
//
sendOrders() {
this.sendOrdersShow = true
},
//
sendOrdersConfirm(e) {
//
// {"id":"1857232935845892097","reportUnit":"","maintenanceTeam":"1847218701580435458","dispatchTime":"2024-11-15 00:00:00","planCompleteTime":"","repairPerson":null,"status":1,"remark":""}
let query_ = {
id:e.id,
reportUnit:e.reportUnit,
status:1,//
sendOrders(item) {
let param = {
id: item.id
}
uni.navigateTo({
url: `/pages/submission/sendOrders${this.$u.queryParams(param)}`,
});
},
//
orderConfirm(row) {
let param = {
id: row.id
}
uni.navigateTo({
url: `/pages/submission/sendOrders${this.$u.queryParams(param)}`,
});
},
//
getRepairPersons() {
@ -284,6 +307,32 @@ export default {
})
},
//
openClone(item) {
this.cloneVisible = true
this.cloneInfo = item
},
confirmCloseSub() {
if (this.cloneReason == '') {
uni.showToast({ title: "请填写关闭原因", icon: "none" });
return false;
}
let query = {
id: this.cloneInfo.id,
cloneReason: this.cloneReason,
status: 9
}
this.$refs.BetLoading.show();
this.$u.api.cloneOrder(query).then(res => {
this.cloneVisible = false
this.$refs.BetLoading.hide();
if (res.code == 200) {
uni.showToast({ title: "关闭成功", icon: "none" });
this.getRecordsList()
}
})
},
//
goPage(item, type) {
if (type == 'details') {

@ -155,8 +155,8 @@ export default {
this.$emit("changeShow", false);
},
btnClick(type) {
this.show = false;
this.$emit("changeShow", false);
// this.show = false;
// this.$emit("changeShow", false);
this.$emit(type);
},
},

@ -40,7 +40,7 @@
:maxlength="maxlength"
:disabled="disabled"
></u-input>
<u-icon style="padding-right:12rpx" @click="scanCode" v-if="endIcon" size="60" :name="endIcon"></u-icon>
<u-icon style="padding-right:12rpx" @click="scanCode" v-if="endIcon&&!disabled" size="60" :name="endIcon"></u-icon>
<view class="wrap sms" v-if="isSms">
<u-toast ref="uToast"></u-toast>
<u-verification-code

@ -86,6 +86,18 @@
}
}
},
{
"path": "pages/submission/sendOrders",
"style": {
"navigationBarTitleText": "工单",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#F8F8F8",
"app-plus": {
"titleNView": {}
}
}
},
{
"path": "pages/order/tasking",
"style": {

@ -96,6 +96,11 @@ export default {
key: "loginInfo",
data: {...this.userInfo,'rememberPwd':true},
});
}else{
uni.setStorage({
key: "loginInfo",
data: {'rememberPwd':false},
});
}
//
this.$u.api

@ -1,7 +1,7 @@
<template>
<view class="page-css">
<view class="page-header-txt">科研医疗建筑运维平台</view>
<betone-list :tabList="tabList"></betone-list>
<betone-list :tabList="tabList" ref="tablist"></betone-list>
<betone-tabbar ref="tabbarRef" />
</view>
</template>
@ -50,6 +50,8 @@ export default {
},
onShow() {
this.$nextTick(() => {
console.log(999999)
this.$refs.tablist.getRecordsList()
this.$refs.tabbarRef.getPermission();
});
},

@ -1,5 +1,5 @@
<template>
<view class="pages-css"
<view class="page-css"
:style="{ 'padding-bottom': (detailForm.status == 5 && dataTypes == 1) ? '180rpx' : '20rpx' }">
<view class="">
<view class="status_box" v-if="detailForm.status != 2">
@ -105,6 +105,15 @@
</view>
</view>
</view>
<!-- 关闭详情 -->
<view class="repair_detail" v-if="detailForm.status == 9">
<view class="repair_title">关闭详情</view>
<view class="detail_item">
<text class="item_left_txt">关闭原因</text>
<text class="item_right_txt">{{ detailForm.cloneReason }}</text>
</view>
</view>
<view class="repair_detail" v-if="detailForm.status != 2">
<view class="repair_title">其他信息</view>
<view class="detail_item">
@ -133,14 +142,14 @@
</view>
</view>
<!-- 维修按钮 并且是维修人员角色 进来显示 -->
<view class="repair_detail" v-if="detailForm.status == 2 && dataTypes == 4">
<view class="repair_detail" v-if="detailForm.status == 3 && dataTypes == 4">
<view class="repair_title">处理情况</view>
<view class="detail_item">
<text class="item_left_txt">接单时间</text>
<text class="item_right_txt reason">2024/8/20 9:25:30</text>
</view>
</view>
<view class="repair_detail" v-if="detailForm.status == 2 && dataTypes == 4">
<view class="repair_detail" v-if="detailForm.status == 3 && dataTypes == 4">
<view class="repair_title">维修详情</view>
<u-form labelPosition="left" :rules="rules" ref="repairDetailsForm" :model="repairDetails"
:label-width="140" class="repair_form">
@ -160,7 +169,8 @@
<betone-new-input label="" v-model="repairDetails.dealMethods" placeholder="请输入"
type="textarea" />
</u-form-item>
<u-form-item label="是否申领物料:" prop="isMaterial" :border-bottom="false" :label-width="200" :isRequire="true">
<u-form-item label="是否申领物料:" prop="isMaterial" :border-bottom="false" :label-width="200"
:isRequire="true">
<uni-data-checkbox v-model="repairDetails.isMaterial"
:localdata="isMaterialList"></uni-data-checkbox>
</u-form-item>
@ -185,7 +195,7 @@
</view>
</view>
<view class="repair-btn" style="margin-right: 32rpx;width:100%"
v-if="detailForm.status == 2 && dataTypes == 4">
v-if="detailForm.status == 3 && dataTypes == 4">
<!-- <u-button size="medium">保存</u-button> -->
<u-button size="medium" type="primary" @click="repairSubmit()">提交</u-button>
</view>
@ -274,7 +284,7 @@ export default {
},
{
text: '否',
value: 0
value: 2
}
],
//
@ -283,7 +293,7 @@ export default {
deviceName: '',//
faultReason: '',//
dealMethods: '',//
isMaterial: '',//
isMaterial: null,//
materialTable: [],//
},
rules: {
@ -362,8 +372,49 @@ export default {
// this.repairDetailsForm
this.$refs.repairDetailsForm.validate(valid => {
if(valid){
console.log(111111111, '校验通过')
if (valid) {
if (this.repairDetails.isMaterial == null) {
uni.showToast({ title: "是否申领物料", icon: "none" });
return false
}
var data = []
if (this.repairDetails.isMaterial == 1 && this.selectGoodsList.length <= 0) {
uni.showToast({ title: "请选择需要申领的物料信息", icon: "none" });
return false
}
console.log(4444444, this.selectGoodsList)
this.selectGoodsList.forEach((item, index) => {
data.push({
orderId: this.detailForm.id,
materialName: item.name,
materialCount: item.goodsNum,
materialPrice: item.price,
bigClassId: item.bigClassId,
rule: item.rule,
unit: item.unit,
xh: item.xh
})
})
let query = {
id: this.detailForm.id,
faultCause: this.repairDetails.faultReason,
processMethod: this.repairDetails.dealMethods,
isNeedMaterial: this.repairDetails.isMaterial,
status: 4,
materials: data
}
this.$u.api.editData(query).then(res => {
if (res.code == 200) {
uni.showToast({ title: "维修成功", icon: "none" });
setTimeout(() => {
uni.navigateBack({
delta: 1 // 1退
})
}, 500)
}
})
}
})
},
@ -459,11 +510,10 @@ export default {
</script>
<style lang="scss" scoped>
.pages-css {
.page-css {
width: 100%;
padding: 0;
background: rgba(239, 239, 239, 1);
padding-top: 26rpx;
padding-bottom: 180rpx;

@ -0,0 +1,629 @@
<template>
<view class="page-css">
<view class="repair_detail">
<view class="repair_title">提报信息</view>
<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_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="请输入"
: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" />
</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" />
</u-form-item>
<u-form-item v-if="dataTypes == 4" label="是否申领物料:" prop="isNeedMaterials" :border-bottom="false"
:label-width="200" :isRequire="true">
<uni-data-checkbox v-model="sendOrder.isNeedMaterials"
:localdata="isMaterialList"></uni-data-checkbox>
</u-form-item>
<view class="selectForm clearfix" v-if="sendOrder.isNeedMaterials == 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">价格{{ item.brand }}</view>
</view>
</view>
<u-button size="medium" :plain="true" style="margin-right: 32rpx;width:100%" type="primary"
@click="goodsSelect()">{{ sendOrder.materialsData.length > 0 ? '修改' : '添加' }}</u-button>
</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-form-item>
</u-form>
</view>
<!-- btns -->
<view class="repair-btn" style="margin-right: 32rpx;width:100%" v-if="dataTypes == 2">
<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">
<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>
</view>
<!-- 选择维修人员 -->
<u-select v-model="sendOrdersShow" :list="sendOrdersList" @confirm="sendOrdersConfirm" :isShowsearch="true"
value-name="id" title="选择维修人员"></u-select>
<!-- 选择时间 -->
<u-calendar v-model="calendarShow" mode="date" @change="calendarChange"></u-calendar>
<!-- 维修人员物料选择 -->
<betone-dialog v-model="aterialShow" height="900rpx">
<view class="search-box">
<betone-new-input v-model="goodsearchInfo.goodsName" placeholder="搜索物品名称" icon="search"
style="margin-bottom: 32rpx" @changevalue="searchGoodsData()" />
</view>
<scroll-view class="scroll-Y" @scrolltolower="goodsLower" scroll-y="true"
style="max-height: 900rpx; width: auto; background-color: gainsboro;">
<view class="material-box">
<view class="material-item" v-for="(item, index) in goodsTableData" :key="index">
<view class="title-wrapper">
<u-checkbox v-model="item.checked" shape="circle"></u-checkbox>
</view>
<view class="item-right">
<view class="material-title">
<text class="material-title-name">{{ item.name }}</text>
<text class="material-title-code">{{ item.code }}</text>
<text>库存数{{ item.num }}</text>
</view>
<view class="material-text">品牌{{ item.brand }}</view>
<view class="material-text">型号{{ item.xh }}</view>
<view class="material-num">
<text>参数{{ item.rule }}</text><u-number-box v-model="item.goodsNum"
:step="1"></u-number-box>
</view>
</view>
</view>
</view>
</scroll-view>
<view class="material-btn">
<u-button size="medium" @click="aterialShow = false">取消</u-button>
<u-button size="medium" type="primary" @click="goodsSubmit()">确认</u-button>
</view>
</betone-dialog>
<!-- 维修人员驳回 -->
<betone-modal v-model="turnShow" :title="'驳回原因'" @confirm="turnFn">
<view class="modal-text">
<betone-new-input v-model="repaiRejectReason" placeholder="请输入" style="margin-bottom: 32rpx" />
</view>
</betone-modal>
</view>
</template>
<script>
import { dateFormat } from '@/utils/util.js'
export default {
computed: {
dataTypes() {
return this.$store.state.dataType
},
disabled() {
return this.$store.state.dataType == 2 ? false : true
}
},
data() {
return {
userInfo:{},//
orderId: '',//id
detailForm: {},//
rules: {},
repairDetails: {
requirementCode: '',//
reportUnit: '',//
faultDescribe: '',//
faultLocation: '',//
deviceName: '',//
faultType: '',//
},
sendOrder: {
repairPerson: '',// id
name: '',//
planCompleteTime: '',//
customerOpinion: '',//
isNeedMaterials: null,//
materialsData: [],//
remark: '',//
},
sendRules: {
name: {
type: "string",
required: true,
message: "请选择维修人员",
trigger: ["blur", "change"],
}
},
sendOrdersShow: false,//
sendOrdersList: [],
calendarShow: false,//
isMaterialList: [
{
text: '是',
value: 1
},
{
text: '否',
value: 2
}
],
aterialShow: false,//
goodsearchInfo: {
goodsName: '',
},
goodsTableData: [],
goodspage: {
current: 1,
size: 10,
},
isGoodsNomore: false,
turnShow: false,//
repaiRejectReason: '',//
}
},
onReady() {
this.$refs.sendOrderForm.setRules(this.sendRules);
},
onShow() {
this.getRepairPersons()//
this.orderId = this.$route.query.id
this.getDtails()
this.userInfo = uni.getStorageSync("userinfo");
//
if (this.dataTypes == 4) {
this.getGoodsList()
}
},
methods: {
getDtails() {
this.$u.api.getBreakdownInfo({ id: this.orderId }).then(res => {
if (res.code == 200) {
this.detailForm = res.data
this.repairDetails.requirementCode = this.detailForm.requirementCode
this.repairDetails.reportUnit = this.detailForm.reportUnit
this.repairDetails.faultDescribe = this.detailForm.faultDescribe
this.repairDetails.faultLocation = this.detailForm.faultLocation
this.repairDetails.deviceName = this.detailForm.deviceName
this.repairDetails.faultType = this.detailForm.faultType
this.sendOrder.name = this.detailForm.repairPersonName
this.sendOrder.repairPerson = this.detailForm.repairPerson
this.sendOrder.planCompleteTime = this.detailForm.planCompleteTime.split(' ')[0]
this.sendOrder.customerOpinion = this.detailForm.customerOpinion
this.sendOrder.remark = this.detailForm.remark
// repairPersonName
}
})
},
//
getRepairPersons() {
this.$u.api.getRepairPersons().then(res => {
if (res.code == 200) {
let data_ = res.data
data_.forEach(i => {
this.sendOrdersList.push({ ...i, label: i.name })
})
}
})
},
//
sendOrdersConfirm(e) {
//
this.sendOrder.name = e[0].label
this.sendOrder.repairPerson = e[0].value
},
calendarChange(e) {
this.sendOrder.planCompleteTime = e.result
},
endOrderCancel() {
uni.navigateBack({
delta: 1 // 1退
})
},
//
sendOrderSubmit() {
this.$refs.sendOrderForm.validate(valid => {
if (valid) {
let query = {
id: this.orderId,
reportUnit: this.repairDetails.reportUnit,
faultDescribe: this.repairDetails.faultDescribe,
faultLocation: this.repairDetails.faultLocation,
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,
repairPerson: this.sendOrder.repairPerson,
planCompleteTime: this.sendOrder.planCompleteTime ? this.sendOrder.planCompleteTime + ' 00:00:00' : '',
customerOpinion: this.sendOrder.customerOpinion
}
this.$u.api.editData(query).then(res => {
if (res.code == 200) {
uni.showToast({ title: "派单成功", icon: "none" });
uni.navigateBack({
delta: 1 // 1退
})
}
})
} else {
console.log('验证失败');
}
});
},
//
searchGoodsData() {
// selectGoodsList
},
//
goodsLower() {
if (this.isGoodsNomore) {
return;
}
this.goodspage.current++;
this.getGoodsList();
},
//
getGoodsList() {
let query_ = {
...this.goodspage
}
this.$u.api.getGoodsList(query_).then(res => {
if (res.code == 200) {
var totalPage = res.data.total;
var newOrders = res.data.records;
newOrders.forEach(element => {
// element.rule = element.rule == '' ? 0 : Number(element.rule)
this.$set(element, 'goodsNum', 0)
this.$set(element, 'checked', false)
});
this.goodsTableData = [...this.goodsTableData, ...(res.data.records || [])];
if (newOrders.length == 0) {
// this.loadingState = "nomore";
this.isGoodsNomore = true;
}
if (totalPage == this.goodsTableData.length) {
// this.loadingState = "nomore";
this.isGoodsNomore = true;
}
}
})
},
//
goodsSubmit() {
let selected = this.goodsTableData.filter(i => {
return i.checked
})
this.sendOrder.materialsData = JSON.parse(JSON.stringify(selected))
this.aterialShow = false
},
goodsSelect() {
this.aterialShow = true
//
//
// this.goodsTableData
this.goodsTableData.forEach(i => {
i.checked = false
})
if (this.sendOrder.materialsData.length > 0) {
this.goodsTableData.forEach(i => {
this.sendOrder.materialsData.forEach(v => {
if (i.id == v.id) {
i.checked = true
}
})
})
}
},
//
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) {
//
// if (this.sendOrder.materialsData.find(item => item.goodsNum == 0)) {
// uni.showToast({ title: "0", icon: "none" });
// }
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,//
})
})
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 => {
if (res.code == 200) {
uni.showToast({ title: "派单成功", icon: "none" });
uni.navigateBack({
delta: 1 // 1退
})
}
})
},
//
turnFn() {
if (this.repaiRejectReason == '') {
uni.showToast({ title: "请输入驳回原因", icon: "none" });
return false
}
let query = {
id: this.orderId,
repaiRejectReason: this.repaiRejectReason,
status: 7
}
this.$u.api.repairReject(query).then(res => {
if (res.code == 200) {
this.turnShow = false
uni.showToast({ title: "驳回成功", icon: "none" });
uni.navigateBack({
delta: 1 // 1退
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.page-css {
padding: 0;
height: 100%;
overflow: auto;
.repair_detail {
margin: 32rpx 24rpx 20rpx;
border-radius: 20rpx;
background-color: rgba(255, 255, 255, 1);
padding: 6rpx 0 34rpx;
.repair_title {
line-height: 60rpx;
color: rgba(0, 0, 0, 1);
font-size: 32rpx;
text-align: left;
font-family: SourceHanSansSC-bold;
margin: 18rpx 0 0rpx 20rpx;
font-weight: bold;
}
.repair_form {
padding: 0 18rpx;
}
}
.repair-btn {
width: 100%;
display: flex;
justify-content: space-around;
/* 水平均匀分布 */
margin-top: 32rpx;
padding: 0 32rpx;
margin-bottom: 32rpx;
/deep/.u-btn {
width: 47%;
}
}
.repair-4-btn {
width: 100%;
display: flex;
justify-content: space-around;
/* 水平均匀分布 */
margin-top: 32rpx;
padding: 0 32rpx;
margin-bottom: 32rpx;
/deep/.u-btn {
width: 32%;
}
}
.selectForm {
width: 100%;
padding: 26rpx;
line-height: 60rpx;
display: flex;
flex-direction: row;
.form-item {
float: left;
width: calc(100% - 26rpx - 26rpx - 200rpx);
.material-text {
width: 50%;
float: left;
}
}
.form-content {
flex: 1;
}
.form-label {
width: 200rpx;
text-align: center;
}
}
.material-box {
flex: 1;
background: #fff;
margin: 0;
overflow: auto;
// padding-bottom: 32rpx;
.material-item {
height: 300rpx;
border-radius: 20rpx;
background-color: rgba(249, 249, 249, 1);
margin: 32rpx 0 0;
padding: 32rpx;
display: flex;
flex-direction: row;
.title-wrapper {}
.item-right {
flex: 1;
.material-title {
display: flex;
flex-direction: row;
color: rgba(108, 108, 108, 1);
font-size: 28rpx;
line-height: 60rpx;
.material-title-name {
color: rgba(51, 51, 51, 1);
font-size: 36rpx;
font-weight: 550;
padding-right: 16rpx;
}
.material-title-code {
flex: 1;
}
}
.material-text {
line-height: 60rpx;
color: rgba(108, 108, 108, 1);
font-size: 28rpx;
}
.material-num {
display: flex;
flex-direction: row;
justify-content: space-between;
}
}
}
}
.material-btn {
width: 100%;
display: flex;
justify-content: space-between;
/* 水平均匀分布 */
margin-top: 32rpx;
padding: 0 32rpx;
/deep/.u-btn {
width: 48%;
}
}
.select-box {
width: 100%;
.select-box-item {
width: 100%;
border-radius: 20rpx;
background-color: rgba(249, 249, 249, 1);
margin-bottom: 32rpx;
line-height: 60rpx;
color: rgba(108, 108, 108, 1);
font-size: 28rpx;
padding: 24rpx;
}
}
}
</style>

@ -403,4 +403,26 @@ export const isVideo =(fileName) =>{
export const isImage=(fileName)=> {
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg'];
return imageExtensions.includes(fileName.split('.').pop().toLowerCase());
}
export const dateFormat=(fmt, date)=> {
let ret;
const opt = {
"y+": date.getFullYear().toString(), // 年
"M+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"h+": date.getHours().toString(), // 时
"m+": date.getMinutes().toString(), // 分
"s+": date.getSeconds().toString(), // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (const k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(
ret[1],
ret[1].length === 1 ? opt[k] : opt[k].padStart(ret[1].length, "0")
);
}
}
return fmt;
}
Loading…
Cancel
Save