|
@@ -5,51 +5,23 @@
|
|
|
<u-form :model="form" ref="uForm">
|
|
<u-form :model="form" ref="uForm">
|
|
|
<u-form-item label="选择设备" required prop="running" :label-width="150">
|
|
<u-form-item label="选择设备" required prop="running" :label-width="150">
|
|
|
<u-input v-model="form.running" disabled @click="handleSelect" placeholder="请选择设备" type="select" />
|
|
<u-input v-model="form.running" disabled @click="handleSelect" placeholder="请选择设备" type="select" />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <u-select
|
|
|
|
|
+ v-model="haltState"
|
|
|
|
|
+ :list="runningList"
|
|
|
|
|
+ @confirm="runningSubmit"
|
|
|
|
|
+ ></u-select> -->
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
<common-popup :list="runningList" @select="runningSubmit" ref="popup" />
|
|
<common-popup :list="runningList" @select="runningSubmit" ref="popup" />
|
|
|
<view class="main-color-text f-size-32 f-weight-6 mt-2">基本信息</view>
|
|
<view class="main-color-text f-size-32 f-weight-6 mt-2">基本信息</view>
|
|
|
- <u-form-item label="设备新号" required :label-width="150">
|
|
|
|
|
- <u-input v-model="form.no" @blur="sbNoBlur($event)" />
|
|
|
|
|
- </u-form-item>
|
|
|
|
|
<u-form-item label="设备名称" :label-width="150">
|
|
<u-form-item label="设备名称" :label-width="150">
|
|
|
<u-input v-model="form.sbName" disabled />
|
|
<u-input v-model="form.sbName" disabled />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
- <u-form-item label="使用位置" prop="sbCph" required :label-width="150">
|
|
|
|
|
- <u-input v-model="form.sbCph" :cursor-spacing="cursorSpacing" />
|
|
|
|
|
|
|
+ <u-form-item label="设备编号" :label-width="150">
|
|
|
|
|
+ <u-input v-model="form.bianhao" disabled />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
- <u-form-item label="报修人" required :label-width="150">
|
|
|
|
|
- <u-input v-model="form.actualUser" />
|
|
|
|
|
- </u-form-item>
|
|
|
|
|
- <!-- <u-form-item label="工单类别" required prop="category" :label-width="150">
|
|
|
|
|
- <u-input v-model="category" disabled @click="badState = true" type="select" />
|
|
|
|
|
- <u-select v-model="badState" :list="categoryMap" @confirm="badSubmit"></u-select>
|
|
|
|
|
- </u-form-item> -->
|
|
|
|
|
<view class="main-color-text f-size-32 f-weight-6 mt-2">报修信息</view>
|
|
<view class="main-color-text f-size-32 f-weight-6 mt-2">报修信息</view>
|
|
|
- <!-- <u-form-item
|
|
|
|
|
- label="是否停机"
|
|
|
|
|
- required
|
|
|
|
|
- prop="halt"
|
|
|
|
|
- :label-width="150"
|
|
|
|
|
- >
|
|
|
|
|
- <u-input
|
|
|
|
|
- v-model="form.halt"
|
|
|
|
|
- disabled
|
|
|
|
|
- @click="haltState = true"
|
|
|
|
|
- placeholder="请选择是否停机"
|
|
|
|
|
- type="select"
|
|
|
|
|
- />
|
|
|
|
|
- <u-select
|
|
|
|
|
- v-model="haltState"
|
|
|
|
|
- :list="haltList"
|
|
|
|
|
- @confirm="haltSubmit"
|
|
|
|
|
- :default-value="haltDefaultValue"
|
|
|
|
|
- ></u-select>
|
|
|
|
|
- </u-form-item>-->
|
|
|
|
|
- <!-- <u-form-item
|
|
|
|
|
- label="报修来源"
|
|
|
|
|
- prop="repair"
|
|
|
|
|
- :label-width="150"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <!-- <u-form-item label="报修来源" prop="repair" required :label-width="150">
|
|
|
<u-input
|
|
<u-input
|
|
|
v-model="form.repair"
|
|
v-model="form.repair"
|
|
|
disabled
|
|
disabled
|
|
@@ -63,13 +35,8 @@
|
|
|
@confirm="repairSubmit"
|
|
@confirm="repairSubmit"
|
|
|
></u-select>
|
|
></u-select>
|
|
|
</u-form-item>-->
|
|
</u-form-item>-->
|
|
|
-
|
|
|
|
|
- <!-- <u-form-item
|
|
|
|
|
- label="紧急等级"
|
|
|
|
|
- prop="level"
|
|
|
|
|
- required
|
|
|
|
|
- :label-width="150"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <!--
|
|
|
|
|
+ <u-form-item label="紧急等级" prop="level" required :label-width="150">
|
|
|
<u-input
|
|
<u-input
|
|
|
v-model="form.level"
|
|
v-model="form.level"
|
|
|
disabled
|
|
disabled
|
|
@@ -82,32 +49,55 @@
|
|
|
:list="levelList"
|
|
:list="levelList"
|
|
|
@confirm="levelSubmit"
|
|
@confirm="levelSubmit"
|
|
|
></u-select>
|
|
></u-select>
|
|
|
- </u-form-item>-->
|
|
|
|
|
|
|
+ </u-form-item>
|
|
|
|
|
|
|
|
- <!-- <u-form-item
|
|
|
|
|
- label="故障类别"
|
|
|
|
|
|
|
+ <u-form-item label="故障类别" required prop="badType" :label-width="150">
|
|
|
|
|
+ <u-input v-model="form.badType" disabled @click="badState = true" type="select" />
|
|
|
|
|
+ <u-select v-model="badState" :list="badList" @confirm="badSubmit"></u-select>
|
|
|
|
|
+ </u-form-item>-->
|
|
|
|
|
+ <!-- <u-form-item
|
|
|
|
|
+ label="工单类别"
|
|
|
required
|
|
required
|
|
|
- prop="badType"
|
|
|
|
|
|
|
+ prop="category"
|
|
|
:label-width="150"
|
|
:label-width="150"
|
|
|
>
|
|
>
|
|
|
<u-input
|
|
<u-input
|
|
|
- v-model="form.badType"
|
|
|
|
|
|
|
+ v-model="category"
|
|
|
disabled
|
|
disabled
|
|
|
@click="badState = true"
|
|
@click="badState = true"
|
|
|
type="select"
|
|
type="select"
|
|
|
/>
|
|
/>
|
|
|
<u-select
|
|
<u-select
|
|
|
v-model="badState"
|
|
v-model="badState"
|
|
|
- :list="badList"
|
|
|
|
|
|
|
+ :list="categoryMap"
|
|
|
@confirm="badSubmit"
|
|
@confirm="badSubmit"
|
|
|
></u-select>
|
|
></u-select>
|
|
|
- </u-form-item>-->
|
|
|
|
|
- <u-form-item label="故障描述" :label-width="150">
|
|
|
|
|
|
|
+ </u-form-item> -->
|
|
|
|
|
+ <u-form-item label="使用位置" prop="sbCph" required :label-width="150">
|
|
|
|
|
+ <tree-select v-model="form.sbCph" valueName="title" :data="sbPositionData"></tree-select>
|
|
|
|
|
+ </u-form-item>
|
|
|
|
|
+ <u-form-item label="是否停机" required prop="needStop" :label-width="150">
|
|
|
|
|
+ <!-- <u-input v-model="form.halt" disabled @click="haltState = true" placeholder="请选择是否停机"
|
|
|
|
|
+ type="select" /> -->
|
|
|
|
|
+ <u-radio-group v-model="form.needStop" @change="radioGroupChange">
|
|
|
|
|
+ <u-radio :name="0">
|
|
|
|
|
+ 否
|
|
|
|
|
+ </u-radio>
|
|
|
|
|
+ <u-radio :name="1">
|
|
|
|
|
+ 是
|
|
|
|
|
+ </u-radio>
|
|
|
|
|
+ </u-radio-group>
|
|
|
|
|
+ </u-form-item>
|
|
|
|
|
+ <u-form-item label="报修人" prop="actualUser" required :label-width="150">
|
|
|
|
|
+ <u-input v-model="form.actualUser" :cursor-spacing="cursorSpacing" />
|
|
|
|
|
+ </u-form-item>
|
|
|
|
|
+ <u-form-item label="故障描述" prop="content" required :label-width="150">
|
|
|
<u-input v-model="form.content" :cursor-spacing="cursorSpacing" />
|
|
<u-input v-model="form.content" :cursor-spacing="cursorSpacing" />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
|
|
+ <!-- <u-select v-model="aShow" mode="mutil-column-auto" :list="aList" @confirm="confirm"></u-select>-->
|
|
|
<u-form-item label="上传图片" :label-width="150">
|
|
<u-form-item label="上传图片" :label-width="150">
|
|
|
<u-upload width="180" height="180" max-count="6" :action="action" :file-list="fileList"
|
|
<u-upload width="180" height="180" max-count="6" :action="action" :file-list="fileList"
|
|
|
- @on-success="uploadSuccess" @on-remove="uploadRemove" :header="header"></u-upload>
|
|
|
|
|
|
|
+ @on-success="uploadSuccess" @on-remove="uploadRemove"></u-upload>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
</u-form>
|
|
</u-form>
|
|
|
<view class="d-flex j-around a-center footer">
|
|
<view class="d-flex j-around a-center footer">
|
|
@@ -126,20 +116,19 @@ export default {
|
|
|
badType: '',
|
|
badType: '',
|
|
|
running: '',
|
|
running: '',
|
|
|
sbName: '',
|
|
sbName: '',
|
|
|
- actualUser: '',
|
|
|
|
|
- no: '',
|
|
|
|
|
- halt: '',
|
|
|
|
|
sbCph: '',
|
|
sbCph: '',
|
|
|
|
|
+ bianhao: '',
|
|
|
|
|
+ halt: '',
|
|
|
repair: '',
|
|
repair: '',
|
|
|
remarks: '',
|
|
remarks: '',
|
|
|
|
|
+ actualUser: '',
|
|
|
content: '',
|
|
content: '',
|
|
|
- userId: '',
|
|
|
|
|
repairErrorTypeId: '',
|
|
repairErrorTypeId: '',
|
|
|
photo: '',
|
|
photo: '',
|
|
|
level: '',
|
|
level: '',
|
|
|
// 传入的
|
|
// 传入的
|
|
|
sbId: '',
|
|
sbId: '',
|
|
|
- needStop: '',
|
|
|
|
|
|
|
+ needStop: 0,
|
|
|
levelValue: '',
|
|
levelValue: '',
|
|
|
source: ''
|
|
source: ''
|
|
|
},
|
|
},
|
|
@@ -227,6 +216,7 @@ export default {
|
|
|
// #endif
|
|
// #endif
|
|
|
sbBackId: '',
|
|
sbBackId: '',
|
|
|
address: '',
|
|
address: '',
|
|
|
|
|
+ sbPositionData: [],
|
|
|
tabbar: [
|
|
tabbar: [
|
|
|
{
|
|
{
|
|
|
iconPath: '/static/tabars/home.png',
|
|
iconPath: '/static/tabars/home.png',
|
|
@@ -263,74 +253,103 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
- console.log(this.action)
|
|
|
|
|
|
|
+ this.userInfo = this.$BaseTool.UserUtil.getUserInfo()
|
|
|
|
|
+ if (this.userInfo) {
|
|
|
|
|
+ this.form.actualUser = this.userInfo.realName
|
|
|
|
|
+ }
|
|
|
const pages = getCurrentPages()
|
|
const pages = getCurrentPages()
|
|
|
const currPage = pages[pages.length - 1]
|
|
const currPage = pages[pages.length - 1]
|
|
|
this.sbBackId = currPage.sbBackId
|
|
this.sbBackId = currPage.sbBackId
|
|
|
|
|
+ this.sbId = currPage.sbBackId
|
|
|
if (this.sbBackId) {
|
|
if (this.sbBackId) {
|
|
|
this.$Http
|
|
this.$Http
|
|
|
- .fetchSbInfo({
|
|
|
|
|
|
|
+ .fetchSbInfoIgnores({
|
|
|
id: this.sbBackId
|
|
id: this.sbBackId
|
|
|
})
|
|
})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- this.form.no = res.data.no
|
|
|
|
|
|
|
+ this.form.bianhao = res.data.no
|
|
|
this.form.sbName = res.data.name
|
|
this.form.sbName = res.data.name
|
|
|
- this.form.running = res.data.name
|
|
|
|
|
this.form.sbCph = res.data.cph
|
|
this.form.sbCph = res.data.cph
|
|
|
|
|
+ this.form.running = res.data.name
|
|
|
this.form.sbId = this.sbBackId
|
|
this.form.sbId = this.sbBackId
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
|
|
+
|
|
|
if (options && options.detailId) {
|
|
if (options && options.detailId) {
|
|
|
|
|
+ this.sbId = options.detailId
|
|
|
this.$Http
|
|
this.$Http
|
|
|
- .fetchSbInfo({
|
|
|
|
|
|
|
+ .fetchSbInfoIgnores({
|
|
|
id: options.detailId
|
|
id: options.detailId
|
|
|
})
|
|
})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- this.form.no = res.data.no
|
|
|
|
|
|
|
+ this.form.bianhao = res.data.no
|
|
|
this.form.sbName = res.data.name
|
|
this.form.sbName = res.data.name
|
|
|
this.form.running = res.data.name
|
|
this.form.running = res.data.name
|
|
|
- this.form.sbCph = res.data.cph
|
|
|
|
|
this.form.sbId = options.detailId
|
|
this.form.sbId = options.detailId
|
|
|
|
|
+ this.form.sbCph = res.data.cph
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- this.sourceMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
|
|
|
|
|
- const categoryMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
|
|
|
|
|
- for (const key in categoryMap) {
|
|
|
|
|
- this.categoryMap.push({
|
|
|
|
|
- label: categoryMap[key],
|
|
|
|
|
- value: key
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- for (const key in this.sourceMap) {
|
|
|
|
|
- this.repairList.push({
|
|
|
|
|
- label: this.sourceMap[key],
|
|
|
|
|
- value: key
|
|
|
|
|
|
|
+ // this.sourceMap = this.$DictCache.getLabelByValueMapByType(
|
|
|
|
|
+ // this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE
|
|
|
|
|
+ // );
|
|
|
|
|
+ // for (const key in this.sourceMap) {
|
|
|
|
|
+ // this.repairList.push({
|
|
|
|
|
+ // label: this.sourceMap[key],
|
|
|
|
|
+ // value: key
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.form.repair = this.repairList[0].label;
|
|
|
|
|
+ // this.form.source = this.repairList[0].value;
|
|
|
|
|
+ // this.levelMap = this.$DictCache.getLabelByValueMapByType(
|
|
|
|
|
+ // this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL
|
|
|
|
|
+ // );
|
|
|
|
|
+ // for (const key in this.levelMap) {
|
|
|
|
|
+ // this.levelList.push({
|
|
|
|
|
+ // label: this.levelMap[key],
|
|
|
|
|
+ // value: key
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.form.level = this.levelList[0].label;
|
|
|
|
|
+ // this.form.levelValue = this.levelList[0].value;
|
|
|
|
|
+
|
|
|
|
|
+ // this.statusMap = this.$DictCache.getLabelByValueMapByType(
|
|
|
|
|
+ // this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS
|
|
|
|
|
+ // );
|
|
|
|
|
+ console.log(22)
|
|
|
|
|
+ this.$Http
|
|
|
|
|
+ .getDictType({
|
|
|
|
|
+ type: this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- this.form.repair = this.repairList[0].label
|
|
|
|
|
- this.form.source = this.repairList[0].value
|
|
|
|
|
- this.levelMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
|
|
|
|
|
- for (const key in this.levelMap) {
|
|
|
|
|
- this.levelList.push({
|
|
|
|
|
- label: this.levelMap[key],
|
|
|
|
|
- value: key
|
|
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.categoryMap = res.data
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- this.form.level = this.levelList[0].label
|
|
|
|
|
- this.form.levelValue = this.levelList[0].value
|
|
|
|
|
-
|
|
|
|
|
- this.statusMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
|
|
|
|
|
- this.needStopMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.YES_NO)
|
|
|
|
|
- for (const key in this.needStopMap) {
|
|
|
|
|
- this.haltList.push({
|
|
|
|
|
- label: this.needStopMap[key],
|
|
|
|
|
- value: key
|
|
|
|
|
|
|
+ this.$Http
|
|
|
|
|
+ .getSbPositionTree().then(res => {
|
|
|
|
|
+ this.sbPositionData = res.data
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- this.form.halt = this.haltList[this.haltDefaultValue].label
|
|
|
|
|
- this.form.needStop = this.haltList[this.haltDefaultValue].value
|
|
|
|
|
|
|
+ // const categoryMap = this.$DictCache.getLabelByValueMapByType(
|
|
|
|
|
+ // this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY
|
|
|
|
|
+ // )
|
|
|
|
|
+ // for (const key in categoryMap) {
|
|
|
|
|
+ // this.categoryMap.push({
|
|
|
|
|
+ // label: categoryMap[key],
|
|
|
|
|
+ // value: key
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // console.log(this.categoryMap)
|
|
|
|
|
+ // this.needStopMap = this.$DictCache.getLabelByValueMapByType(
|
|
|
|
|
+ // this.$DictCache.TYPE.YES_NO
|
|
|
|
|
+ // )
|
|
|
|
|
+ // for (const key in this.needStopMap) {
|
|
|
|
|
+ // this.haltList.push({
|
|
|
|
|
+ // label: this.needStopMap[key],
|
|
|
|
|
+ // value: key
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.form.halt = this.haltList[this.haltDefaultValue].label;
|
|
|
|
|
+ // this.form.needStop = this.haltList[this.haltDefaultValue].value;
|
|
|
this.getType()
|
|
this.getType()
|
|
|
// 获取设备数据
|
|
// 获取设备数据
|
|
|
// this.initSb();
|
|
// this.initSb();
|
|
@@ -374,22 +393,24 @@ export default {
|
|
|
url: '/pages/search/search'
|
|
url: '/pages/search/search'
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 是否停机切换
|
|
|
|
|
+ radioGroupChange(value) {
|
|
|
|
|
+ this.form.needStop = value
|
|
|
|
|
+ },
|
|
|
handleSubmit() {
|
|
handleSubmit() {
|
|
|
|
|
+ console.log(this.form);
|
|
|
|
|
+
|
|
|
if (this.form.sbId === null || this.form.sbId === '') {
|
|
if (this.form.sbId === null || this.form.sbId === '') {
|
|
|
this.$Message.toast('请先输入设备新号')
|
|
this.$Message.toast('请先输入设备新号')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
const params = {
|
|
const params = {
|
|
|
content: this.form.content,
|
|
content: this.form.content,
|
|
|
- remark: this.form.remarks,
|
|
|
|
|
- level: this.form.levelValue,
|
|
|
|
|
needStop: this.form.needStop,
|
|
needStop: this.form.needStop,
|
|
|
sbId: this.form.sbId,
|
|
sbId: this.form.sbId,
|
|
|
sbName: this.form.sbName,
|
|
sbName: this.form.sbName,
|
|
|
sbCph: this.form.sbCph,
|
|
sbCph: this.form.sbCph,
|
|
|
- repairErrorTypeId: this.form.repairErrorTypeId,
|
|
|
|
|
- source: this.form.source,
|
|
|
|
|
- category: this.form.category,
|
|
|
|
|
|
|
+ actualUser: this.form.actualUser,
|
|
|
applicationFileList: this.imagesList
|
|
applicationFileList: this.imagesList
|
|
|
}
|
|
}
|
|
|
console.log(params)
|
|
console.log(params)
|
|
@@ -401,6 +422,7 @@ export default {
|
|
|
this.$refs.uForm.validate(valid => {
|
|
this.$refs.uForm.validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
this.$Http.addRepairApplicationForm(params).then(res => {
|
|
this.$Http.addRepairApplicationForm(params).then(res => {
|
|
|
|
|
+ this.resetForm()
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pages/repair/repair'
|
|
url: '/pages/repair/repair'
|
|
|
})
|
|
})
|
|
@@ -408,6 +430,30 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 报修提交成功后清除表单数据
|
|
|
|
|
+ resetForm() {
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ badType: '',
|
|
|
|
|
+ running: '',
|
|
|
|
|
+ sbName: '',
|
|
|
|
|
+ sbCph: '',
|
|
|
|
|
+ bianhao: '',
|
|
|
|
|
+ halt: '',
|
|
|
|
|
+ repair: '',
|
|
|
|
|
+ remarks: '',
|
|
|
|
|
+ actualUser: this.userInfo ? this.userInfo.realName : '',
|
|
|
|
|
+ content: '',
|
|
|
|
|
+ repairErrorTypeId: '',
|
|
|
|
|
+ photo: '',
|
|
|
|
|
+ level: '',
|
|
|
|
|
+ sbId: '',
|
|
|
|
|
+ needStop: 0,
|
|
|
|
|
+ levelValue: '',
|
|
|
|
|
+ source: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ this.imagesList = []
|
|
|
|
|
+ this.fileList = []
|
|
|
|
|
+ },
|
|
|
// 紧急等级
|
|
// 紧急等级
|
|
|
levelSubmit(data) {
|
|
levelSubmit(data) {
|
|
|
this.form.level = data[0].label
|
|
this.form.level = data[0].label
|