This commit is contained in:
蔡玲
2024-12-25 13:19:46 +08:00
parent 332d0ab3d0
commit 0b9457dc43
5 changed files with 109 additions and 54 deletions

View File

@@ -24,8 +24,9 @@ export const sendWork = (code) => post('api/pda/sendWork', {
work_code: code
})
// 补发配料作业
export const reSendWork = (code) => post('api/pda/reSendWork', {
work_code: code
export const reSendWork = (code, num) => post('api/pda/reSendWork', {
work_code: code,
require_num: num
})
// 完成配料作业
export const finishWork = (code) => post('api/pda/finishWork', {

View File

@@ -7,15 +7,17 @@ import store from './vuex/store'
import '@config/rem.js'
import '@style/reset.css'
import '@style/layout.styl'
import { MessageBox, Message, Select, Option } from 'element-ui'
import { Dialog, Button, Message, Select, Option, InputNumber } from 'element-ui'
import scroll from 'vue-seamless-scroll'
import JSEncrypt from 'jsencrypt'
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$message = Message
Vue.use(Dialog)
Vue.use(Button)
Vue.use(Select)
Vue.use(Option)
Vue.use(scroll)
Vue.use(InputNumber)
Vue.config.productionTip = false
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +

View File

@@ -42,9 +42,9 @@
<td>{{ e.status }}</td>
<td>
<div class="zd-row btn_wraper">
<button v-show="e.status === '开始'" class="grid_button" :disabled="disabled" @click="_startOrder(e)">开始</button>
<button v-show="e.status === '执行中'" class="grid_button" @click="toJump(e)">执行中</button>
<button class="grid_button" :disabled="disabled" @click="_forceFinish(e)">强制完成</button>
<button v-if="e.status === '执行中'" class="grid_button" @click="toJump(e)">执行中</button>
<button v-else class="grid_button" :class="{'grid_button_disabled': e.checked && disabled1}" :disabled="disabled1" @click="_startOrder(e)">开始</button>
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled2}" :disabled="disabled2" @click="_forceFinish(e)">强制完成</button>
</div>
</td>
</tr>
@@ -69,7 +69,8 @@ export default {
value: '',
options: [],
dataList: [],
disabled: false
disabled1: false,
disabled2: false
}
},
beforeRouteLeave (to, from, next) {
@@ -94,6 +95,9 @@ export default {
async _queryOrders (e) {
let res = await queryOrders(e)
this.dataList = [...res]
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
},
selectChange (e) {
if (e) {
@@ -101,11 +105,13 @@ export default {
}
},
async _startOrder (e) {
this.disabled = true
this.disabled1 = true
e.checked = true
try {
let res = await startOrder(this.value, e.mfg_order_name)
if (res.message) {
this.disabled = false
this.disabled1 = false
e.checked = false
this.$store.dispatch('setKeepAlive', ['index'])
this.$router.push({
path: '/task',
@@ -113,7 +119,8 @@ export default {
})
}
} catch (e) {
this.disabled = false
this.disabled1 = false
e.checked = false
}
},
toJump (e) {
@@ -124,7 +131,8 @@ export default {
})
},
async _forceFinish (e) {
this.disabled = true
this.disabled2 = true
e.checked = true
try {
let res = await forceFinish(e.mfg_order_name)
this._queryOrders(this.value)
@@ -132,9 +140,11 @@ export default {
message: res.message,
type: 'success'
})
this.disabled = false
this.disabled2 = false
e.checked = false
} catch (e) {
this.disabled = false
this.disabled2 = false
e.checked = false
}
}
}

View File

@@ -31,11 +31,10 @@
<td>{{ e.status }}</td>
<td>
<div class="zd-row btn_wraper">
<button class="grid_button" :disabled="disabled" @click="_sendWork(e)">下发</button>
<!-- <button class="grid_button" :disabled="disabled">执行中</button> -->
<button class="grid_button" :disabled="disabled" @click="_reSendWork(e)">补发</button>
<button class="grid_button" :disabled="disabled" @click="_pdaPause(e)">暂停</button>
<button class="grid_button" :disabled="disabled" @click="_finishWork(e)">完成</button>
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled1}" :disabled="disabled1" @click="_sendWork(e)">下发</button>
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled2}" :disabled="disabled2" @click="openDialog(e)">补发</button>
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled3}" :disabled="disabled3" @click="_pdaPause(e)">暂停</button>
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled4}" :disabled="disabled4" @click="_finishWork(e)">完成</button>
</div>
</td>
</tr>
@@ -43,6 +42,16 @@
</div>
</div>
</div>
<el-dialog :visible.sync="dialogVisible">
<div class="zd-row filter-item">
<div class="zd-col-6 filter-label">补发桶数</div>
<el-input-number class="zd-col-17" v-model="inputNumber" :min="1" label="请输入数字"></el-input-number>
</div>
<div class="zd-row jccenter button-wrap">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -59,8 +68,13 @@ export default {
return {
timer: null,
dataList: [],
pkId: '',
disabled: false
pkObj: '',
disabled1: false,
disabled2: false,
disabled3: false,
disabled4: false,
dialogVisible: false,
inputNumber: 1
}
},
mounted () {
@@ -70,9 +84,13 @@ export default {
async _queryWorks () {
let res = await queryWorks(this.$route.query.order)
this.dataList = [...res]
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
},
async _sendWork (e) {
this.disabled = true
this.disabled1 = true
e.checked = true
try {
let res = await sendWork(e.work_code)
this._queryWorks()
@@ -80,27 +98,33 @@ export default {
message: res.message,
type: 'success'
})
this.disabled = false
this.disabled1 = false
e.checked = false
} catch (e) {
this.disabled = false
this.disabled1 = false
e.checked = false
}
},
async _reSendWork (e) {
this.disabled = true
async _reSendWork (e, num) {
this.disabled2 = true
e.checked = true
try {
let res = await reSendWork(e.work_code)
let res = await reSendWork(e.work_code, num)
this._queryWorks()
this.$message({
message: res.message,
type: 'success'
})
this.disabled = false
this.disabled2 = false
e.checked = false
} catch (e) {
this.disabled = false
this.disabled2 = false
e.checked = false
}
},
async _pdaPause (e) {
this.disabled = true
this.disabled3 = true
e.checked = true
try {
let res = await pdaPause(e.work_code)
this._queryWorks()
@@ -108,13 +132,16 @@ export default {
message: res.message,
type: 'success'
})
this.disabled = false
this.disabled3 = false
e.checked = false
} catch (e) {
this.disabled = false
this.disabled3 = false
e.checked = false
}
},
async _finishWork (e) {
this.disabled = true
this.disabled4 = true
e.checked = true
try {
let res = await finishWork(e.work_code)
this._queryWorks()
@@ -122,10 +149,21 @@ export default {
message: res.message,
type: 'success'
})
this.disabled = false
this.disabled4 = false
e.checked = false
} catch (e) {
this.disabled = false
this.disabled4 = false
e.checked = false
}
},
openDialog (e) {
this.dialogVisible = true
this.inputNumber = 1
this.pkObj = e
},
handleConfirm () {
this.dialogVisible = false
this._reSendWork(this.pkObj, this.inputNumber)
}
}
}

View File

@@ -170,7 +170,7 @@ header
margin 0 .1rem;
background: transparent;
border: 0;
&:disabled
.grid_button_disabled
color: #ff803c
//
@@ -235,22 +235,26 @@ header
font-size: .28rem
}
//
.el-message-box {
background-color: rgba(7, 22, 69, .85);
border-color: #0b5deb;
}
.el-message-box__title, .el-message-box__headerbtn .el-message-box__close, .el-message-box__content {
//
.el-dialog
background linear-gradient(45deg, rgba(28, 95, 161, 70%), rgba(20, 67, 120, 70%))
border 1px solid #6fc4e2
.el-dialog__headerbtn
font-size .32rem
.el-dialog__headerbtn .el-dialog__close
color #fff
.el-dialog__body
padding .3rem .4rem
.button-wrap
margin-top .6rem
.el-input-number__decrease, .el-input-number__increase
width .8rem
font-size: 0.3rem;
height: 0.8rem;
line-height: .8rem;
background: #0489c0;
color: #fff;
}
.scroll-tab
_font(.14rem, .34rem, #fff,,center)
font-family YouSheBiaoTiHei;
background-color #1F438A
.scroll-container
height calc(100% - .34rem)
overflow hidden
.scroll-item
_font(.14rem, .34rem, #fff,,center)
background: rgba(31,46,73,0.9)
border 1px solid rgba(122,159,224,0.17)
.el-button
font-size .34rem
.el-button+.el-button
margin-left .4rem