接口修改 交互功能修改
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import {post} from '@config/http.js'
|
import {post, get} from '@config/http.js'
|
||||||
|
|
||||||
/** 手持登陆 */
|
/** 手持登陆 */
|
||||||
export const handLogin = (user, password) => post('mobile/auth/login', {
|
export const handLogin = (user, password) => post('mobile/auth/login', {
|
||||||
@@ -30,11 +30,9 @@ export const openStart = (id, code) => post('api/produceshiftorder/openStart', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 4.设备报工
|
// 4.设备报工
|
||||||
export const saveReport = (id, qty, nqty, rqty) => post('api/produceshiftorder/saveReport', {
|
export const saveReport = (id, qty) => post('api/produceshiftorder/saveReport', {
|
||||||
workorder_id: id,
|
workorder_id: id,
|
||||||
report_qty: qty,
|
report_qty: qty
|
||||||
nok_qty: nqty,
|
|
||||||
repare_qty: rqty
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 5.设备完工
|
// 5.设备完工
|
||||||
@@ -107,3 +105,13 @@ export const getOrderList2 = (code, val, d1, d2) => post('api/produceshiftorder/
|
|||||||
|
|
||||||
// return res
|
// return res
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// 残次品报工
|
||||||
|
export const unqualReport = (id, nqty, rqty) => post('api/produceshiftorder/unqualReport', {
|
||||||
|
workorder_id: id,
|
||||||
|
nok_qty: nqty,
|
||||||
|
repare_qty: rqty
|
||||||
|
})
|
||||||
|
|
||||||
|
// 状态查询
|
||||||
|
export const orderStatus = () => get('api/produceshiftorder/orderStatus', '')
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
|
|||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
let token = ''
|
let token = ''
|
||||||
if (store.getters.userInfo !== '') {
|
if (store.getters.saveToken !== '') {
|
||||||
token = JSON.parse(store.getters.userInfo).token
|
token = store.getters.saveToken
|
||||||
}
|
}
|
||||||
token && (config.headers.Authorization = token)
|
token && (config.headers.Authorization = token)
|
||||||
if (config.method === 'post') {
|
if (config.method === 'post') {
|
||||||
@@ -64,24 +64,9 @@ export const post = (sevmethod, params) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const post2 = (sevmethod, params) => {
|
export const get = (sevmethod, params) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.post(`${store.getters.imgip}/` + sevmethod, params)
|
axios.get(`${store.getters.baseUrl}/` + sevmethod + params)
|
||||||
.then(response => {
|
|
||||||
resolve(response.data)
|
|
||||||
}, error => {
|
|
||||||
Dialog(error.message)
|
|
||||||
reject(error.message)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const post3 = (sevmethod, params) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
axios.post(sevmethod, params)
|
|
||||||
.then(response => {
|
.then(response => {
|
||||||
resolve(response.data)
|
resolve(response.data)
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|||||||
@@ -55,11 +55,11 @@
|
|||||||
<input type="text" class="inputStyle inputStyle1" v-model="baseUrl">
|
<input type="text" class="inputStyle inputStyle1" v-model="baseUrl">
|
||||||
<div v-show="closeIcon3" class="iconfont close_icon" @click="clearData(3)"></div>
|
<div v-show="closeIcon3" class="iconfont close_icon" @click="clearData(3)"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="inputOuter">
|
<!-- <div class="inputOuter">
|
||||||
<div class="label label1">图片域名地址</div>
|
<div class="label label1">图片域名地址</div>
|
||||||
<input type="text" class="inputStyle inputStyle1" v-model="imgBaseUrl">
|
<input type="text" class="inputStyle inputStyle1" v-model="imgBaseUrl">
|
||||||
<div v-show="closeIcon4" class="iconfont close_icon" @click="clearData(4)"></div>
|
<div v-show="closeIcon4" class="iconfont close_icon" @click="clearData(4)"></div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="inputOuter">
|
<div class="inputOuter">
|
||||||
<div class="label label1">锁屏时间(分钟)</div>
|
<div class="label label1">锁屏时间(分钟)</div>
|
||||||
<div class="select select1">
|
<div class="select select1">
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{e.create_time}}</td>
|
<td>{{e.create_time}}</td>
|
||||||
<td>{{e.workorder_code}}</td>
|
<td>{{e.workorder_code}}</td>
|
||||||
<td>{{['创建','下发','生产中','暂停', '完成', '强制完成'][Number(e.workorder_status) - 1]}}</td>
|
<td>{{e.workorder_status_name}}</td>
|
||||||
<td>{{e.device_code}}</td>
|
<td>{{e.device_code}}</td>
|
||||||
<td>{{e.material_name}}</td>
|
<td>{{e.material_name}}</td>
|
||||||
<td>{{e.material_spec}}</td>
|
<td>{{e.material_spec}}</td>
|
||||||
@@ -71,21 +71,21 @@
|
|||||||
<input type="number" class="form_item__input" v-model="reportQty">
|
<input type="number" class="form_item__input" v-model="reportQty">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form_item">
|
<!-- <div class="form_item">
|
||||||
<div class="form_item__label">报废数量</div>
|
<div class="form_item__label">报废数量</div>
|
||||||
<div class="form_item__content">
|
<div class="form_item__content">
|
||||||
<input type="number" class="form_item__input" v-model="nokQty">
|
<input type="number" class="form_item__input" v-model="nokQty">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="form">
|
<!-- <div class="form">
|
||||||
<div class="form_item">
|
<div class="form_item">
|
||||||
<div class="form_item__label">报修数量</div>
|
<div class="form_item__label">报修数量</div>
|
||||||
<div class="form_item__content">
|
<div class="form_item__content">
|
||||||
<input type="number" class="form_item__input" v-model="repareQty">
|
<input type="number" class="form_item__input" v-model="repareQty">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div v-if="type === '2'" class="form_wraper">当前操作为强制确认,确定继续操作吗?</div>
|
<div v-if="type === '2'" class="form_wraper">当前操作为强制确认,确定继续操作吗?</div>
|
||||||
</jxDialog>
|
</jxDialog>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { deviceList, getOrderList2, openStart, tofinish, saveReport } from '../../../config/getData2.js'
|
import { deviceList, getOrderList2, openStart, tofinish, saveReport, orderStatus } from '../../../config/getData2.js'
|
||||||
import jxDialog from '@components/dialog.vue'
|
import jxDialog from '@components/dialog.vue'
|
||||||
import {accSubtract} from '@config/utils.js'
|
import {accSubtract} from '@config/utils.js'
|
||||||
export default {
|
export default {
|
||||||
@@ -113,8 +113,9 @@ export default {
|
|||||||
title: '',
|
title: '',
|
||||||
type: '',
|
type: '',
|
||||||
reportQty: '',
|
reportQty: '',
|
||||||
nokQty: '',
|
// nokQty: '',
|
||||||
repareQty: ''
|
// repareQty: '',
|
||||||
|
status: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -131,7 +132,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._deviceList()
|
this._deviceList()
|
||||||
this.getDatas()
|
this._orderStatus()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async _deviceList () {
|
async _deviceList () {
|
||||||
@@ -140,16 +141,28 @@ export default {
|
|||||||
this.options = [...res.content]
|
this.options = [...res.content]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async _orderStatus () {
|
||||||
|
let res = await orderStatus()
|
||||||
|
this.status = [...res]
|
||||||
|
this.getDatas()
|
||||||
|
},
|
||||||
async getDatas () {
|
async getDatas () {
|
||||||
let res = await getOrderList2(this.value)
|
let res = await getOrderList2(this.value)
|
||||||
res.content.map(el => {
|
if (res.code === 200) {
|
||||||
let qty = '0'
|
res.content.map(el => {
|
||||||
if (Number(accSubtract(el.plan_qty, el.real_qty)) > 0) {
|
let qty = '0'
|
||||||
qty = accSubtract(el.plan_qty, el.real_qty)
|
if (Number(accSubtract(el.plan_qty, el.real_qty)) > 0) {
|
||||||
}
|
qty = accSubtract(el.plan_qty, el.real_qty)
|
||||||
this.$set(el, 'report_qty', qty)
|
}
|
||||||
})
|
this.$set(el, 'report_qty', qty)
|
||||||
this.dataList = [...res.content]
|
this.status.map(e => {
|
||||||
|
if (e.value === Number(el.workorder_status)) {
|
||||||
|
this.$set(el, 'workorder_status_name', e.label)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.dataList = [...res.content]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 开工
|
// 开工
|
||||||
async _openStart () {
|
async _openStart () {
|
||||||
@@ -184,7 +197,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await saveReport(this.pkId, this.reportQty, this.nokQty, this.repareQty)
|
let res = await saveReport(this.pkId, this.reportQty)
|
||||||
this.toast(res.message)
|
this.toast(res.message)
|
||||||
this.disabled2 = false
|
this.disabled2 = false
|
||||||
this.pkId = ''
|
this.pkId = ''
|
||||||
@@ -207,8 +220,8 @@ export default {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case '1':
|
case '1':
|
||||||
this.reportQty = ''
|
this.reportQty = ''
|
||||||
this.nokQty = ''
|
// this.nokQty = ''
|
||||||
this.repareQty = ''
|
// this.repareQty = ''
|
||||||
this.$refs.child.active = true
|
this.$refs.child.active = true
|
||||||
break
|
break
|
||||||
case '2':
|
case '2':
|
||||||
|
|||||||
@@ -30,18 +30,20 @@
|
|||||||
<div class="filter_item">
|
<div class="filter_item">
|
||||||
<div class="filter_label filter_label_z3">关键字</div>
|
<div class="filter_label filter_label_z3">关键字</div>
|
||||||
<div class="filter-input-wrap filter-input-wrap_z3">
|
<div class="filter-input-wrap filter-input-wrap_z3">
|
||||||
<input type="text" class="filter-input filter-input_1" v-model="keyValue" placeholder="请输入工单号、物料编码">
|
<input type="text" class="filter-input filter-input_1" v-model="keyValue" placeholder="工单号、物料编码">
|
||||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap-buttons">
|
<div class="wrap-buttons">
|
||||||
<button class="button button--primary" @click="getDatas">查询</button>
|
<button class="button button--primary" @click="getDatas">查询</button>
|
||||||
|
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled1" @click="showDialog">残次品报工</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid_wraper">
|
<div class="grid_wraper">
|
||||||
<table class="filter-table">
|
<table class="filter-table">
|
||||||
<tr>
|
<tr>
|
||||||
|
<th width="4%"></th>
|
||||||
<th width="8%">工单日期</th>
|
<th width="8%">工单日期</th>
|
||||||
<th width="8%">工单号</th>
|
<th width="8%">工单号</th>
|
||||||
<th width="7%">设备</th>
|
<th width="7%">设备</th>
|
||||||
@@ -57,10 +59,13 @@
|
|||||||
<th width="8%">开始时间</th>
|
<th width="8%">开始时间</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="e in dataList" :key="e.workorder_id">
|
<tr v-for="e in dataList" :key="e.workorder_id">
|
||||||
|
<td>
|
||||||
|
<button class="iconfont select_icon" :class="{'selected_icon': pkId === e.workorder_id}" @click="toRadio(e)"></button>
|
||||||
|
</td>
|
||||||
<td>{{e.create_time}}</td>
|
<td>{{e.create_time}}</td>
|
||||||
<td>{{e.workorder_code}}</td>
|
<td>{{e.workorder_code}}</td>
|
||||||
<td>{{e.device_code}}</td>
|
<td>{{e.device_code}}</td>
|
||||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.workorder_status) - 1]}}</td>
|
<td>{{e.workorder_status_name}}</td>
|
||||||
<td>{{ e.material_name }}</td>
|
<td>{{ e.material_name }}</td>
|
||||||
<td>{{e.material_spec}}</td>
|
<td>{{e.material_spec}}</td>
|
||||||
<td>{{e.workprocedure_name}}</td>
|
<td>{{e.workprocedure_name}}</td>
|
||||||
@@ -73,13 +78,39 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<jxDialog
|
||||||
|
ref="child"
|
||||||
|
title="请输入数量"
|
||||||
|
@toSure="toSureDialog"
|
||||||
|
>
|
||||||
|
<div class="form_wraper">
|
||||||
|
<div class="form">
|
||||||
|
<div class="form_item">
|
||||||
|
<div class="form_item__label">报废数量</div>
|
||||||
|
<div class="form_item__content">
|
||||||
|
<input type="number" class="form_item__input" v-model="nokQty">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form_item">
|
||||||
|
<div class="form_item__label">报修数量</div>
|
||||||
|
<div class="form_item__content">
|
||||||
|
<input type="number" class="form_item__input" v-model="repareQty">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</jxDialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {dateFtt} from '@config/utils.js'
|
import {dateFtt} from '@config/utils.js'
|
||||||
import { deviceList, getTable } from '../../../config/getData2.js'
|
import jxDialog from '@components/dialog.vue'
|
||||||
|
import { deviceList, getTable, unqualReport, orderStatus } from '../../../config/getData2.js'
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
jxDialog
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
value1: [],
|
value1: [],
|
||||||
@@ -87,11 +118,12 @@ export default {
|
|||||||
value: '',
|
value: '',
|
||||||
keyValue: '',
|
keyValue: '',
|
||||||
disabled1: false,
|
disabled1: false,
|
||||||
disabled2: false,
|
|
||||||
disabled3: false,
|
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
pkId: '',
|
||||||
pkObj: {}
|
pkObj: {},
|
||||||
|
nokQty: '',
|
||||||
|
repareQty: '',
|
||||||
|
status: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -107,6 +139,7 @@ export default {
|
|||||||
created () {
|
created () {
|
||||||
this._deviceList()
|
this._deviceList()
|
||||||
this.debouncedgetDatas = this.debounce(this.getDatas, 500)
|
this.debouncedgetDatas = this.debounce(this.getDatas, 500)
|
||||||
|
this._orderStatus()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
debounce (fn, delay = 500) {
|
debounce (fn, delay = 500) {
|
||||||
@@ -127,8 +160,23 @@ export default {
|
|||||||
this.options = [...res.content]
|
this.options = [...res.content]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async _orderStatus () {
|
||||||
|
let res = await orderStatus()
|
||||||
|
this.status = [...res]
|
||||||
|
this.getDatas()
|
||||||
|
},
|
||||||
async getDatas () {
|
async getDatas () {
|
||||||
let res = await getTable(this.value, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '')
|
let res = await getTable(this.value, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '')
|
||||||
|
if (res.code === 200) {
|
||||||
|
res.content.map(el => {
|
||||||
|
this.status.map(e => {
|
||||||
|
if (e.value === Number(el.workorder_status)) {
|
||||||
|
this.$set(el, 'workorder_status_name', e.label)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.dataList = [...res.content]
|
||||||
|
}
|
||||||
this.dataList = [...res.content]
|
this.dataList = [...res.content]
|
||||||
},
|
},
|
||||||
clearData (e) {
|
clearData (e) {
|
||||||
@@ -141,6 +189,42 @@ export default {
|
|||||||
toRadio (e) {
|
toRadio (e) {
|
||||||
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
|
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
|
||||||
this.pkObj = this.pkId === e.workorder_id ? e : {}
|
this.pkObj = this.pkId === e.workorder_id ? e : {}
|
||||||
|
},
|
||||||
|
showDialog () {
|
||||||
|
if (!this.pkId) {
|
||||||
|
this.toast('请选择一行')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.nokQty = ''
|
||||||
|
this.repareQty = ''
|
||||||
|
this.$refs.child.active = true
|
||||||
|
},
|
||||||
|
toSureDialog () {
|
||||||
|
this._unqualReport()
|
||||||
|
},
|
||||||
|
// 残次品报工
|
||||||
|
async _unqualReport () {
|
||||||
|
this.$refs.child.disabled = true
|
||||||
|
this.disabled1 = true
|
||||||
|
if (!this.pkId) {
|
||||||
|
this.toast('请选择一行')
|
||||||
|
this.disabled1 = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let res = await unqualReport(this.pkId, this.nokQty, this.repareQty)
|
||||||
|
this.toast(res.message)
|
||||||
|
this.disabled1 = false
|
||||||
|
this.pkId = ''
|
||||||
|
this.pkObj = {}
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
this.getDatas()
|
||||||
|
} catch (e) {
|
||||||
|
this.disabled1 = false
|
||||||
|
this.$refs.child.active = false
|
||||||
|
this.$refs.child.disabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,9 +232,9 @@ export default {
|
|||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.wrap-filters
|
.wrap-filters
|
||||||
width calc(100% - 60px)
|
width calc(100% - 160px)
|
||||||
.wrap-buttons
|
.wrap-buttons
|
||||||
width 60px
|
width 160px
|
||||||
.filter_label_z2
|
.filter_label_z2
|
||||||
width 32px
|
width 32px
|
||||||
.filter-input-wrap_z2
|
.filter-input-wrap_z2
|
||||||
@@ -161,9 +245,11 @@ export default {
|
|||||||
width calc(100% - 43px)
|
width calc(100% - 43px)
|
||||||
.filter_item
|
.filter_item
|
||||||
&:nth-child(1)
|
&:nth-child(1)
|
||||||
width 55%
|
width 37%
|
||||||
&:nth-child(2)
|
&:nth-child(2)
|
||||||
width calc(45% - 10px)
|
width calc(30% - 10px)
|
||||||
|
&:nth-child(3)
|
||||||
|
width calc(33% - 10px)
|
||||||
.filter-input_1
|
.filter-input_1
|
||||||
padding-right 30px
|
padding-right 30px
|
||||||
.close_icon
|
.close_icon
|
||||||
|
|||||||
@@ -234,9 +234,10 @@ header
|
|||||||
font-weight bold
|
font-weight bold
|
||||||
background-color #8B90A6
|
background-color #8B90A6
|
||||||
th,td
|
th,td
|
||||||
line-height 18px
|
line-height 15px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #fff
|
color #fff
|
||||||
|
word-break break-all
|
||||||
td
|
td
|
||||||
border 1px solid #8B90A6
|
border 1px solid #8B90A6
|
||||||
padding 5px
|
padding 5px
|
||||||
|
|||||||
Reference in New Issue
Block a user