维修管理接口
This commit is contained in:
@@ -26,7 +26,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
option: [{value: '1', label: '是'}, {value: '2', label: '否'}],
|
||||
option: [{value: '0', label: '否'}, {value: '1', label: '是'}],
|
||||
active: '',
|
||||
open: false,
|
||||
up: false
|
||||
|
||||
@@ -471,3 +471,37 @@ export const queryMaintenanceDtl = (row) => post('api/pda/sb/queryMaintenanceDtl
|
||||
row: row
|
||||
})
|
||||
// 1.4确认
|
||||
export const dtlConfirm = (row) => post('api/pda/sb/dtlConfirm', {
|
||||
rows: row
|
||||
})
|
||||
// 1.5故障类型
|
||||
export const errorType = (row) => post('api/pda/sb/errorType', {})
|
||||
// 1.6故障等级
|
||||
export const errorLevel = (row) => post('api/pda/sb/errorLevel', {})
|
||||
// 1.7报修
|
||||
export const repairs = (code, id, desc, level) => post('api/pda/sb/repairs', {
|
||||
device_code: code,
|
||||
device_faultclass_id: id,
|
||||
fault_desc: desc,
|
||||
fault_level: level
|
||||
})
|
||||
// 1.8查询设备维修执行
|
||||
export const queryRepairs = (code, mflag) => post('api/pda/sb/queryRepairs', {
|
||||
device_code: code,
|
||||
maintenance_flag: mflag
|
||||
})
|
||||
// 1.9设备保养单操作
|
||||
export const repairOpeate = (row, operate) => post('api/pda/sb/repairOpeate', {
|
||||
row: row,
|
||||
operate: operate
|
||||
})
|
||||
// 1.10维修明细查询
|
||||
export const queryRepairDtl = (row) => post('api/pda/sb/queryRepairDtl', {
|
||||
row: row
|
||||
})
|
||||
// 1.11确认
|
||||
export const repaireDtlConfirm = (form, row, pname) => post('api/pda/sb/repaireDtlConfirm', {
|
||||
form: form,
|
||||
rows: row,
|
||||
product_person_name: pname
|
||||
})
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
<img src="../../images/xinrui/menu/password.png" alt="">
|
||||
<p class="fxcol">修改密码</p>
|
||||
</div>
|
||||
<!-- <div class="menu-col fxrow" @click="goInner('/MaintainExecution')"><p class="fxcol">设备保养执行-维修工</p></div>
|
||||
<div class="menu-col fxrow" @click="goInner('/MaintainConfirm')"><p class="fxcol">设备保养确认-生产员</p></div>
|
||||
<div class="menu-col fxrow" @click="goInner('/EquipRepair')"><p class="fxcol">设备报修</p></div>
|
||||
<div class="menu-col fxrow" @click="goInner('/EquipRepairExecute')"><p class="fxcol">设备维修执行</p></div>
|
||||
<div class="menu-col fxrow" @click="goInner('/MaintainResultFill')"><p class="fxcol">设备维修确认</p></div> -->
|
||||
<!-- <div class="menu-col fxrow" @click="goInner('/ProcessMakePowder')"><p class="fxcol">配粉工序</p></div>
|
||||
<div class="menu-col fxrow" @click="goInner('/ProcessGrindBall')"><p class="fxcol">球磨工序</p></div>
|
||||
<div class="menu-col fxrow" @click="goInner('/ProcessSpray')"><p class="fxcol">喷雾工序</p></div>
|
||||
|
||||
@@ -69,8 +69,8 @@
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">拍照</button>
|
||||
<button class="btn submit-button">报修</button>
|
||||
<button class="btn submit-button" @click="UploadPict">拍照</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': val1 === '' || active1 === '' || active2 === '' || val2 === ''}" :disabled="disabled1" @click="_repairs">报修</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -79,6 +79,7 @@
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||
import {errorType, errorLevel, repairs} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'EquipRepair',
|
||||
components: {
|
||||
@@ -99,7 +100,8 @@ export default {
|
||||
open1: false,
|
||||
option2: [],
|
||||
active2: '',
|
||||
open2: false
|
||||
open2: false,
|
||||
disabled1: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -108,6 +110,51 @@ export default {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
/** 故障类型 */
|
||||
async _errorType () {
|
||||
let res = await errorType()
|
||||
if (res.code === '1') {
|
||||
this.option1 = [...res.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 故障登记 */
|
||||
async _errorLevel () {
|
||||
let res = await errorLevel()
|
||||
if (res.code === '1') {
|
||||
this.option2 = [...res.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 报修 */
|
||||
async _repairs () {
|
||||
this.disabled1 = true
|
||||
if (this.val1 === '' || this.active1 === '' || this.active2 === '' || this.val2 === '') {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let type = this.active1 !== '' ? this.option1[this.active1].value : ''
|
||||
let level = this.active2 !== '' ? this.option2[this.active2].value : ''
|
||||
let res = await repairs(this.val1, type, this.val2, level)
|
||||
if (res.code === '1') {
|
||||
this.option2 = [...res.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
UploadPict () {
|
||||
this.$router.push({
|
||||
path: '/UploadPict',
|
||||
query: {url: 'EquipRepair'}
|
||||
})
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
@@ -122,6 +169,7 @@ export default {
|
||||
dropdownMenu1 (i) {
|
||||
this.active1 = i + ''
|
||||
this.open1 = false
|
||||
this.val3 = this.option1[i].solutions
|
||||
},
|
||||
toggleItem2 () {
|
||||
if (!this.open2) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<tr>
|
||||
<th>维修单</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<tr v-for="e in dataList" :key="e.repair_id" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
|
||||
<td>{{e.repair_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -28,21 +28,21 @@
|
||||
<th>状态</th>
|
||||
<th>计划维修日期</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<tr v-for="e in dataList" :key="e.repair_id" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<td>{{e.plan_start_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">开始维修</button>
|
||||
<button class="btn submit-button">填报</button>
|
||||
<button class="btn submit-button">委外维修</button>
|
||||
<button class="btn submit-button">结束维修</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">开始维修</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toJump">填报</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">委外维修</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled3" @click="toSure3">结束维修</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -50,6 +50,7 @@
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import { queryRepairs, repairOpeate } from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'EquipRepairExecute',
|
||||
components: {
|
||||
@@ -61,18 +62,79 @@ export default {
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
console.log(e)
|
||||
this._queryRepairs(e)
|
||||
}
|
||||
},
|
||||
/** 设备查询 */
|
||||
async _queryRepairs (e) {
|
||||
let res = await queryRepairs(e, '1')
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _repairOpeate (type) {
|
||||
try {
|
||||
let res = await repairOpeate(this.pkObj, type)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
}
|
||||
},
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._repairOpeate('1')
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._repairOpeate('2')
|
||||
},
|
||||
toSure3 () {
|
||||
this.disabled3 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
this._repairOpeate('3')
|
||||
},
|
||||
toJump () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('materObj', this.pkObj)
|
||||
this.$router.push({
|
||||
path: '/MaintainResultFill'
|
||||
})
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.repair_id ? '' : e.repair_id
|
||||
this.pkObj = this.pkId === e.repair_id ? e : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<tr>
|
||||
<th>保养单</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
|
||||
<td>{{e.maint_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -28,19 +28,19 @@
|
||||
<th>状态</th>
|
||||
<th>计划保养日期</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<td>{{e.plan_start_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">通过</button>
|
||||
<button class="btn submit-button">不通过</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">通过</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">不通过</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -48,6 +48,7 @@
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import { queryMaintenance, maintOpeate } from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'MaintainConfirm',
|
||||
components: {
|
||||
@@ -59,18 +60,60 @@ export default {
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
console.log(e)
|
||||
this._queryMaintenance(e)
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.maint_id ? '' : e.maint_id
|
||||
this.pkObj = this.pkId === e.maint_id ? e : {}
|
||||
},
|
||||
/** 设备查询 */
|
||||
async _queryMaintenance (e) {
|
||||
let res = await queryMaintenance(e, '2')
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _maintOpeate (type) {
|
||||
try {
|
||||
let res = await maintOpeate(this.pkObj, type)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._maintOpeate('3')
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._maintOpeate('4')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<tr>
|
||||
<th>是否完成</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td></td>
|
||||
<tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
|
||||
<td>{{maint_dtl_id === '0' ? '否' : '是'}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -34,19 +34,19 @@
|
||||
<th>保养内容</th>
|
||||
<th>要求</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
|
||||
<td>{{e.maint_item_name}}</td>
|
||||
<td>{{e.item_level}}</td>
|
||||
<td>{{e.contents}}</td>
|
||||
<td>{{e.requirement}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">确认</button>
|
||||
<button class="btn submit-button">取消</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure1">>确认</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled2" @click="toSure2">取消</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -54,6 +54,7 @@
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import {queryMaintenanceDtl, dtlConfirm} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'MaintainDetails',
|
||||
components: {
|
||||
@@ -62,11 +63,13 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
val1: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.device_code : '',
|
||||
val2: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.maint_code : '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -76,8 +79,48 @@ export default {
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.maint_dtl_id ? '' : e.maint_dtl_id
|
||||
this.pkObj = this.pkId === e.maint_dtl_id ? e : {}
|
||||
},
|
||||
/** 明细查询 */
|
||||
async _queryMaintenanceDtl () {
|
||||
let res = await queryMaintenanceDtl(this.$store.getters.materObj)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _dtlConfirm () {
|
||||
try {
|
||||
let res = await dtlConfirm(this.dataList)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (!this.dataList.length) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._dtlConfirm()
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (!this.dataList.length) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._dtlConfirm()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<tr>
|
||||
<th>保养单</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
|
||||
<td>{{e.maint_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -28,20 +28,20 @@
|
||||
<th>状态</th>
|
||||
<th>计划保养日期</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<td>{{e.plan_start_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">保养开始</button>
|
||||
<button class="btn submit-button">填报</button>
|
||||
<button class="btn submit-button">结束保养</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">保养开始</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toJump">填报</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">结束保养</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -49,6 +49,7 @@
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import { queryMaintenance, maintOpeate } from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'MaintainExecution',
|
||||
components: {
|
||||
@@ -60,18 +61,68 @@ export default {
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
console.log(e)
|
||||
this._queryMaintenance(e)
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.maint_id ? '' : e.maint_id
|
||||
this.pkObj = this.pkId === e.maint_id ? e : {}
|
||||
},
|
||||
/** 设备查询 */
|
||||
async _queryMaintenance (e) {
|
||||
let res = await queryMaintenance(e, '1')
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _maintOpeate (type) {
|
||||
try {
|
||||
let res = await maintOpeate(this.pkObj, type)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._maintOpeate('1')
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._maintOpeate('2')
|
||||
},
|
||||
toJump () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('materObj', this.pkObj)
|
||||
this.$router.push({
|
||||
path: '/MaintainResults'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,9 @@
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id">
|
||||
<tr v-for="e in dataList" :key="e.repair_dtl_id">
|
||||
<td>
|
||||
<for-dropdown-menu
|
||||
:value="e.is"
|
||||
:id="e.worktask_id"
|
||||
@getValue="getValue">
|
||||
</for-dropdown-menu>
|
||||
{{parseInt(i) + 1}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -46,19 +42,25 @@
|
||||
<th>维修项目名称</th>
|
||||
<th>要求</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<tr v-for="e in dataList" :key="e.repair_dtl_id" @click="toCheck(e)" :class="{'checked': e.repair_dtl_id === pkId}">
|
||||
<td>
|
||||
<for-dropdown-menu
|
||||
:value="e.isfinish"
|
||||
:id="e.repair_dtl_id"
|
||||
@getValue="getValue">
|
||||
</for-dropdown-menu>
|
||||
</td>
|
||||
<td>{{e.repair_item_code}}</td>
|
||||
<td>{{e.repair_item_name}}</td>
|
||||
<td>{{e.requirement}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">确认</button>
|
||||
<button class="btn submit-button">取消</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认</button>
|
||||
<button class="btn submit-button" @click="toCancle">取消</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -67,6 +69,7 @@
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import ForDropdownMenu from '@components/ForDropdownMenu.vue'
|
||||
import {queryRepairDtl, repaireDtlConfirm} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'MaintainResultFill',
|
||||
components: {
|
||||
@@ -76,17 +79,21 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
val1: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.device_code : '',
|
||||
val2: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.repair_code : '',
|
||||
val3: '',
|
||||
dataList: [{worktask_id: '1'}, {worktask_id: '2'}],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
option: [{value: '1', label: '是'}, {value: '2', label: '否'}],
|
||||
active: '0',
|
||||
open: false
|
||||
open: false,
|
||||
disabled1: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this._queryRepairDtl()
|
||||
},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
@@ -94,13 +101,45 @@ export default {
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.repair_dtl_id ? '' : e.repair_dtl_id
|
||||
this.pkObj = this.pkId === e.repair_dtl_id ? e : {}
|
||||
},
|
||||
/** 明细查询 */
|
||||
async _queryRepairDtl () {
|
||||
let res = await queryRepairDtl(this.$store.getters.materObj)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _repaireDtlConfirm () {
|
||||
try {
|
||||
let res = await repaireDtlConfirm(this.$store.getters.materObj, this.dataList, this.val3)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (!this.dataList.length) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._dtlConfirm()
|
||||
},
|
||||
toCancle () {
|
||||
},
|
||||
getValue (p) {
|
||||
this.dataList.map(el => {
|
||||
if (el.worktask_id === p[0]) {
|
||||
el.is = p[1]
|
||||
if (el.repair_dtl_id === p[0]) {
|
||||
el.isfinish = p[1]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
<tr>
|
||||
<th>是否完成</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id">
|
||||
<tr v-for="e in dataList" :key="e.maint_dtl_id">
|
||||
<td>
|
||||
<for-dropdown-menu
|
||||
:value="e.is"
|
||||
:id="e.worktask_id"
|
||||
:value="e.isfinish"
|
||||
:id="e.maint_dtl_id"
|
||||
@getValue="getValue">
|
||||
</for-dropdown-menu>
|
||||
</td>
|
||||
@@ -40,19 +40,19 @@
|
||||
<th>保养内容</th>
|
||||
<th>要求</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
|
||||
<td>{{e.maint_item_name}}</td>
|
||||
<td>{{e.item_level}}</td>
|
||||
<td>{{e.contents}}</td>
|
||||
<td>{{e.requirement}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">确认</button>
|
||||
<button class="btn submit-button">取消</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认</button>
|
||||
<button class="btn submit-button" @click="toCancle">取消</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -61,6 +61,7 @@
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import ForDropdownMenu from '@components/ForDropdownMenu.vue'
|
||||
import {queryMaintenanceDtl, dtlConfirm} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'MaintainResults',
|
||||
components: {
|
||||
@@ -70,13 +71,17 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
dataList: [{worktask_id: '1', is: '2', pcsn: '00000'}],
|
||||
val1: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.device_code : '',
|
||||
val2: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.maint_code : '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
disabled1: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this._queryMaintenanceDtl()
|
||||
},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
@@ -84,15 +89,49 @@ export default {
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.maint_dtl_id ? '' : e.maint_dtl_id
|
||||
this.pkObj = this.pkId === e.maint_dtl_id ? e : {}
|
||||
},
|
||||
getValue (p) {
|
||||
this.dataList.map(el => {
|
||||
if (el.worktask_id === p[0]) {
|
||||
el.is = p[1]
|
||||
if (el.maint_dtl_id === p[0]) {
|
||||
el.isfinish = p[1]
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 明细查询 */
|
||||
async _queryMaintenanceDtl () {
|
||||
let res = await queryMaintenanceDtl(this.$store.getters.materObj)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _dtlConfirm () {
|
||||
try {
|
||||
let res = await dtlConfirm(this.dataList)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (!this.dataList.length) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._dtlConfirm()
|
||||
},
|
||||
toCancle () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user