刻字工序
This commit is contained in:
@@ -2,28 +2,22 @@
|
||||
<div class="order-wraper">
|
||||
<div class="search-confirm-wrap">
|
||||
<div class="search-wrap">
|
||||
<div class="search-item">
|
||||
<div class="search-label">规格</div>
|
||||
<div class="filter_input_wraper">
|
||||
<input type="text" class="filter-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label">载具</div>
|
||||
<div class="filter_input_wraper">
|
||||
<input type="text" class="filter-input">
|
||||
<input type="text" class="filter-input" v-model="$route.query.code" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label">重量</div>
|
||||
<div class="filter_input_wraper">
|
||||
<input type="number" class="filter-input">
|
||||
<input type="number" class="filter-input" v-model="$route.query.weight" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item_3">
|
||||
<button class="button button--primary" @click="_washQuery">平均分配</button>
|
||||
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': checkArr.length === 0}" @click="_washSubmitWash">取消分配</button>
|
||||
<button class="button button--primary" @click="toJump">确认上料</button>
|
||||
<div class="search-item">
|
||||
<button class="button button--primary" :class="{'button--defalut': dataList.length === 0}" @click="distribute">平均分配</button>
|
||||
<button class="button button--primary" :class="{'button--defalut': dataList.length === 0}" @click="toCancle">取消分配</button>
|
||||
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': checkArr.length === 0}" @click="_kzSubmitkz">确认上料</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,8 +32,7 @@
|
||||
<th>计划数量</th>
|
||||
<th>生产数量</th>
|
||||
<th>物料规格</th>
|
||||
<th>重量(kg)</th>
|
||||
<th>数量</th>
|
||||
<th>重量(g)</th>
|
||||
<th>物料编号</th>
|
||||
<th>物料名称</th>
|
||||
</tr>
|
||||
@@ -49,13 +42,15 @@
|
||||
<td>
|
||||
<button class="iconfont select_icon select_square_icon" :class="e.checked ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{ i+1 }}</td>
|
||||
<td>{{ e.device_code }}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.deviceinstor_weight | unitskg}}</td>
|
||||
<td>{{ e.deviceinstor_qty | numeric(3) }}</td>
|
||||
<td>{{ e.task_code }}</td>
|
||||
<td>{{ e.update_time }}</td>
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.plan_qty | numeric(3)}}</td>
|
||||
<td>{{e.dq_real_qty | numeric(3)}}</td>
|
||||
<td>{{ e.material_spec }}</td>
|
||||
<td><input type="number" class="input" v-model="e.weight"></td>
|
||||
<td>{{ e.material_code }}</td>
|
||||
<td>{{ e.material_name }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -64,77 +59,83 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {dictAll, washSpecList, washQuery, washSubmitWash} from '@config/getData2.js'
|
||||
import {accDiv, accAdd} from '@config/utils.js'
|
||||
import {kzDeviceList, kzSubmitkz} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'cleaningloading',
|
||||
data () {
|
||||
return {
|
||||
options1: [],
|
||||
value1: '',
|
||||
options2: [],
|
||||
value2: '',
|
||||
dataList: [],
|
||||
checkArr: [],
|
||||
disabled1: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._dictAll()
|
||||
this._washSpecList()
|
||||
this._kzDeviceList()
|
||||
},
|
||||
methods: {
|
||||
// 车间下拉框
|
||||
async _dictAll () {
|
||||
let res = await dictAll()
|
||||
if (res.code === 200) {
|
||||
this.options1 = [...res.content]
|
||||
this.value1 = this.options1[0].value
|
||||
this._washQuery()
|
||||
}
|
||||
},
|
||||
// 规格下拉框
|
||||
async _washSpecList () {
|
||||
let res = await washSpecList()
|
||||
if (res.code === 200) {
|
||||
this.options2 = [...res.content]
|
||||
}
|
||||
},
|
||||
// grid
|
||||
async _washQuery () {
|
||||
let res = await washQuery(this.value1, this.value2)
|
||||
async _kzDeviceList () {
|
||||
let res = await kzDeviceList()
|
||||
if (res.code === 200) {
|
||||
this.checkArr = []
|
||||
res.content.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
this.$set(el, 'weight', '')
|
||||
})
|
||||
this.dataList = [...res.content]
|
||||
}
|
||||
},
|
||||
distribute () {
|
||||
let weight = accDiv(this.$route.query.weight, this.dataList.length)
|
||||
weight = Number(weight).toFixed(3)
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'weight', weight)
|
||||
})
|
||||
},
|
||||
toCancle () {
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'weight', '')
|
||||
})
|
||||
},
|
||||
// 确认上料
|
||||
async _washSubmitWash () {
|
||||
async _kzSubmitkz () {
|
||||
this.disabled1 = true
|
||||
if (this.checkArr.length === 0) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
let total = 0
|
||||
let flag = false
|
||||
this.dataList.map(el => {
|
||||
total = accAdd(total, el.weight)
|
||||
if (el.weight === '') {
|
||||
flag = true
|
||||
}
|
||||
})
|
||||
if (flag) {
|
||||
this.toast('数量不能为空')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (Number(total) > Number(this.$route.query.weight)) {
|
||||
this.toast('总重量之和不大于库存重量')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let arr = []
|
||||
this.checkArr.map(el => {
|
||||
arr.push(el.device_code)
|
||||
arr.push({device_code: el.device_code, weight: el.weight})
|
||||
})
|
||||
let res = await washSubmitWash(arr)
|
||||
let res = await kzSubmitkz(arr)
|
||||
if (res.code === 200) {
|
||||
this.toast(res.msg)
|
||||
this._washQuery()
|
||||
this._kzDeviceList()
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
toJump () {
|
||||
this.$router.push('/manpour')
|
||||
},
|
||||
toRadio (e) {
|
||||
e.checked = !e.checked
|
||||
this.checkArr = this.dataList.filter(i => { return i.checked === true })
|
||||
@@ -144,6 +145,13 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.grid_wraper
|
||||
height calc(100% - 1.1rem)
|
||||
.search-item
|
||||
&:nth-child(1), &:nth-child(2)
|
||||
width 29%
|
||||
&:nth-child(3)
|
||||
width 38%
|
||||
.search-label
|
||||
width .55rem
|
||||
.filter_input_wraper
|
||||
width calc(100% - .55rem)
|
||||
</style>
|
||||
|
||||
@@ -1,238 +1,109 @@
|
||||
<template>
|
||||
<div class="order-wraper">
|
||||
<div class="search-confirm-wrap">
|
||||
<div class="search-wrap">
|
||||
<div class="search-item">
|
||||
<div class="search-label">仓库</div>
|
||||
<div class="filter_input_wraper">
|
||||
<el-select v-model="value1" filterable clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label search-label_1">日期</div>
|
||||
<div class="filter_input_wraper filter_input_wraper_1">
|
||||
<el-date-picker
|
||||
v-model="date"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label">物料</div>
|
||||
<div class="filter_input_wraper">
|
||||
<input type="text" class="filter-input" v-model="material_code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label">载具号</div>
|
||||
<div class="filter_input_wraper">
|
||||
<input type="text" class="filter-input" v-model="storagevehicle_code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label">货位号</div>
|
||||
<div class="filter_input_wraper">
|
||||
<input type="text" class="filter-input" v-model="struct_code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-label">盘点位</div>
|
||||
<div class="filter_input_wraper">
|
||||
<el-select v-model="value2" filterable clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.point_code"
|
||||
:label="item.point_name"
|
||||
:value="item.point_code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item_3">
|
||||
<button class="button button--primary" @click="_checkGetDtlAll">查询</button>
|
||||
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': pkId === '' || value2 === ''}" @click="_checkSendTask">确认上料</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-wrap">
|
||||
<div class="search-item_3">
|
||||
<button class="button button--primary" @click="_bypda">查询</button>
|
||||
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确认上料</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_wraper">
|
||||
<table class="filter-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>货位</th>
|
||||
<th>载具号</th>
|
||||
<th>物料规格</th>
|
||||
<th>重量(kg)</th>
|
||||
<th>数量</th>
|
||||
<th>物料编号</th>
|
||||
<th>入库时间</th>
|
||||
<th>是否已挑料</th>
|
||||
<th>入库类型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.checkdtl_id}" @click="toRadio(e)">
|
||||
<td>{{ i + 1 }}</td>
|
||||
<td>{{e.struct_name}}</td>
|
||||
<td>{{e.storagevehicle_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.qty | numeric(3)}}</td>
|
||||
<td>{{e.base_qty | numeric(3)}}</td>
|
||||
<td><input type="number" class="input" v-model="e.fac_qty"></td>
|
||||
<td>{{ ['正常', '盘亏', '盘盈'][Number(e.check_result)] }}</td>
|
||||
<td>生成</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="grid_wraper" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
|
||||
<table class="filter-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>货位</th>
|
||||
<th>载具号</th>
|
||||
<th>物料规格</th>
|
||||
<th>重量(g)</th>
|
||||
<th>物料编号</th>
|
||||
<th>入库时间</th>
|
||||
<th>是否已挑料</th>
|
||||
<th>入库类型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.struct_code}" @click="toRadio(e)">
|
||||
<td>{{ i + 1 }}</td>
|
||||
<td>{{e.struct_code}}</td>
|
||||
<td>{{e.storagevehicle_code}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.canuse_qty | numeric(3)}}</td>
|
||||
<td>{{ e.material_code }}</td>
|
||||
<td>{{ e.instorage_time }}</td>
|
||||
<td>{{ e.is_pick === true ? '是' : '否' }}</td>
|
||||
<td>{{ e.instorage_type }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="loading-tips">{{desc}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { checkGetBcpStor, checkGetDtlAll, checkGetPoint, checkSendTask, checkConfirm, checkConfirmOffer, checkConfirmFinance } from '@config/getData2.js'
|
||||
import {dateTimeFtt} from '@config/utils.js'
|
||||
import { bypda } from '@config/getData2.js'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
options1: [],
|
||||
value1: '',
|
||||
date: [new Date((new Date().getTime() - 6 * 24 * 60 * 60 * 1000)), new Date((new Date().getTime()))],
|
||||
options2: [],
|
||||
value2: '',
|
||||
material_code: '',
|
||||
storagevehicle_code: '',
|
||||
struct_code: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
disabled4: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
flag () {
|
||||
let flag = false
|
||||
if (this.dataList.length) {
|
||||
this.dataList.map(el => {
|
||||
if (el.fac_qty === '' || Number(el.fac_qty) < 0) {
|
||||
flag = true
|
||||
}
|
||||
})
|
||||
}
|
||||
return flag
|
||||
page: 1,
|
||||
size: '99',
|
||||
busy: false,
|
||||
desc: ''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._checkGetBcpStor()
|
||||
this._checkGetDtlAll()
|
||||
this._checkGetPoint()
|
||||
this._bypda()
|
||||
},
|
||||
methods: {
|
||||
// 仓库下拉框
|
||||
async _checkGetBcpStor () {
|
||||
let res = await checkGetBcpStor()
|
||||
this.options1 = [...res.data]
|
||||
},
|
||||
// grid
|
||||
async _checkGetDtlAll () {
|
||||
let res = await checkGetDtlAll(this.value1, this.date !== null ? dateTimeFtt(this.date[0]) : '', this.date !== null ? dateTimeFtt(this.date[1]) : '', this.material_code, this.storagevehicle_code, this.struct_code)
|
||||
this.dataList = [...res.data]
|
||||
async _bypda () {
|
||||
this.page = 1
|
||||
this.busy = false
|
||||
this.desc = ''
|
||||
let res = await bypda(this.page + '', this.size)
|
||||
this.dataList = []
|
||||
this.dataList = [...res.content]
|
||||
if (res.content.length < 99) {
|
||||
this.busy = true
|
||||
this.desc = '已加载全部数据'
|
||||
}
|
||||
},
|
||||
// 盘点位下拉框
|
||||
async _checkGetPoint () {
|
||||
let res = await checkGetPoint()
|
||||
this.options2 = [...res.data]
|
||||
async loadMore () {
|
||||
this.busy = true
|
||||
this.page++
|
||||
let res = await bypda(this.page + '', this.size)
|
||||
this.dataList = [...this.dataList, ...res.content]
|
||||
if (res.content.length < 99) {
|
||||
this.busy = true
|
||||
this.desc = '已加载全部数据'
|
||||
} else {
|
||||
this.busy = false
|
||||
}
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.checkdtl_id ? '' : e.checkdtl_id
|
||||
this.pkObj = this.pkId === e.checkdtl_id ? e : {}
|
||||
this.pkId = this.pkId === e.struct_code ? '' : e.struct_code
|
||||
this.pkObj = this.pkId === e.struct_code ? e : {}
|
||||
},
|
||||
// 下发(按钮)
|
||||
async _checkSendTask () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId || !this.value2) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await checkSendTask(this.pkObj, this.value2)
|
||||
this.toast(res.message)
|
||||
this._checkGetDtlAll()
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
// 盘点确认
|
||||
async _checkConfirm () {
|
||||
this.disabled2 = true
|
||||
if (this.flag || this.dataList.length === 0) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await checkConfirm(this.dataList)
|
||||
this.toast(res.message)
|
||||
this._checkGetDtlAll()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
// 实盘为准
|
||||
async _checkConfirmOffer () {
|
||||
this.disabled3 = true
|
||||
toSure () {
|
||||
if (!this.pkId) {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await checkConfirmOffer(this.pkObj)
|
||||
this.toast(res.message)
|
||||
this._checkGetDtlAll()
|
||||
this.disabled3 = false
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
}
|
||||
},
|
||||
// 财务为准
|
||||
async _checkConfirmFinance () {
|
||||
this.disabled4 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled4 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await checkConfirmFinance(this.pkObj)
|
||||
this.toast(res.message)
|
||||
this._checkGetDtlAll()
|
||||
this.disabled4 = false
|
||||
} catch (e) {
|
||||
this.disabled4 = false
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/letteringmachineselect',
|
||||
query: {
|
||||
code: this.pkObj.struct_code,
|
||||
weight: this.pkObj.canuse_qty
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.zd_wrapper
|
||||
height calc(100% - 1.6rem)
|
||||
.filter_input_wraper_1
|
||||
width calc(100% - 45px)
|
||||
.search-label_1
|
||||
width 45px
|
||||
</style>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="search-item">
|
||||
<div class="search-label">车间</div>
|
||||
<div class="filter_input_wraper">
|
||||
<el-select v-model="value1" filterable clearable placeholder="请选择">
|
||||
<el-select v-model="value1" filterable clearable placeholder="请选择" disabled>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
@@ -16,9 +16,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item_2">
|
||||
<button class="button button--primary" @click="_washWashTasks">快速查询</button>
|
||||
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': value1 === ''}" @click="_washWashVechileInfo">强制完成</button>
|
||||
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': pkId === ''}" @click="_washWashFinish('1')">强制取消</button>
|
||||
<button class="button button--primary" @click="_KzTasks">查询</button>
|
||||
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': pkId === ''}" @click="toSure1">强制完成</button>
|
||||
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': pkId === ''}" @click="toSure2">强制取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,219 +32,90 @@
|
||||
<th>起点</th>
|
||||
<th>终点</th>
|
||||
<th>物料规格</th>
|
||||
<th>上料重量(kg)</th>
|
||||
<th>上料重量(g)</th>
|
||||
<th>分配重量</th>
|
||||
<th>任务状态</th>
|
||||
<th>执行步骤</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="e in dataList" :key="e.task_id" :class="{'selected_icon': pkId === e.task_id}" @click="toRadio(e)">
|
||||
<td>{{ e.sep_on }}</td>
|
||||
<td>{{ e.create_time }}</td>
|
||||
<td>{{e.task_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<tr v-for="(e, i) in dataList" :key="e.task_id" :class="{'selected_icon': pkId === e.task_id}" @click="toRadio(e)">
|
||||
<td>{{ i+1 }}</td>
|
||||
<td>{{ e.create_tie }}</td>
|
||||
<td>{{ e.task_code }}</td>
|
||||
<td>{{e.point_code1}}</td>
|
||||
<td>{{e.point_code3}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.material_qty | unitskg}}</td>
|
||||
<td>{{ e.material_name }}</td>
|
||||
<td>{{e.material_qty | numeric}}</td>
|
||||
<td>{{ e.qtyArr | numeric }}</td>
|
||||
<td>{{ ['生成', '任务异常', '确定终点', '起点和终点确认', '下发', '运行', '完成', '取消'][Number(e.task_status) - 1] }}</td>
|
||||
<td>{{ e.task_step }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<jxDialog
|
||||
ref="child"
|
||||
title="提示"
|
||||
:type="type"
|
||||
@toSure="toSureDialog"
|
||||
@toCancle="toCancle"
|
||||
>
|
||||
<div class="form_wraper">当前任务号不是第一个任务是否确认下料?</div>
|
||||
</jxDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import jxDialog from '@components/dialog.vue'
|
||||
import {dictAll, washWashTasks, washWashVechileInfo, washWashFinish, washWashTaskFinish, washWashQzFinish, bcpInCallVehicle} from '@config/getData2.js'
|
||||
import {KzTasks, operation} from '@config/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
jxDialog
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
options1: [],
|
||||
value1: '',
|
||||
weight: '',
|
||||
vechile_code: '',
|
||||
options1: [{value: 'A1', label: 'A1'}],
|
||||
value1: 'A1',
|
||||
dataList: [],
|
||||
sep_on: '',
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
type: '',
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
disabled4: false,
|
||||
disabled5: false
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._dictAll()
|
||||
this._KzTasks()
|
||||
},
|
||||
methods: {
|
||||
// 车间下拉框
|
||||
async _dictAll () {
|
||||
let res = await dictAll()
|
||||
if (res.code === 200) {
|
||||
this.options1 = [...res.content]
|
||||
this.value1 = this.options1[0].value
|
||||
this._washWashTasks()
|
||||
}
|
||||
},
|
||||
// grid
|
||||
async _washWashTasks () {
|
||||
let res = await washWashTasks(this.value1)
|
||||
async _KzTasks () {
|
||||
let res = await KzTasks()
|
||||
if (res.code === 200) {
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.dataList = [...res.content]
|
||||
if (this.dataList.length > 0) {
|
||||
this.sep_on = this.dataList[0].sep_on
|
||||
}
|
||||
}
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.task_id ? '' : e.task_id
|
||||
this.pkObj = this.pkId === e.task_id ? e : {}
|
||||
},
|
||||
// 获取信息
|
||||
async _washWashVechileInfo () {
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (this.value1 === '') {
|
||||
if (this.pkId === '') {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await washWashVechileInfo(this.value1)
|
||||
if (res.code === 200) {
|
||||
if (res.content.length > 0) {
|
||||
this.weight = res.content[0].weight
|
||||
this.vechile_code = res.content[0].vechile_code
|
||||
}
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
this._operation('forceFinish')
|
||||
},
|
||||
// 确认下料
|
||||
async _washWashFinish (type) {
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (this.pkId === '') {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
if (this.pkObj.sep_on !== this.sep_on) {
|
||||
this.type = type
|
||||
this.$refs.child.active = true
|
||||
return
|
||||
}
|
||||
this.__washWashFinish()
|
||||
this._operation('cancel')
|
||||
},
|
||||
async __washWashFinish () {
|
||||
async _operation (type) {
|
||||
try {
|
||||
let res = await washWashFinish(this.pkId, this.weight, this.vechile_code)
|
||||
let res = await operation(this.pkId, type)
|
||||
if (res.code === 200) {
|
||||
this.toast(res.msg)
|
||||
this._washWashTasks()
|
||||
this._KzTasks()
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.$refs.child.active = false
|
||||
}
|
||||
},
|
||||
// 强制完成
|
||||
async _washWashTaskFinish (type) {
|
||||
this.disabled3 = true
|
||||
if (this.pkId === '') {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
if (this.pkObj.sep_on !== this.sep_on) {
|
||||
this.type = type
|
||||
this.$refs.child.active = true
|
||||
return
|
||||
}
|
||||
this.__washWashTaskFinish()
|
||||
},
|
||||
async __washWashTaskFinish () {
|
||||
try {
|
||||
let res = await washWashTaskFinish(this.pkId)
|
||||
if (res.code === 200) {
|
||||
this.toast(res.msg)
|
||||
this._washWashTasks()
|
||||
}
|
||||
this.disabled3 = false
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
this.$refs.child.active = false
|
||||
}
|
||||
},
|
||||
// 强制下料
|
||||
async _washWashQzFinish (type) {
|
||||
this.disabled4 = true
|
||||
if (this.pkId === '') {
|
||||
this.disabled4 = false
|
||||
return
|
||||
}
|
||||
if (this.pkObj.sep_on !== this.sep_on) {
|
||||
this.type = type
|
||||
this.$refs.child.active = true
|
||||
return
|
||||
}
|
||||
this.__washWashQzFinish()
|
||||
},
|
||||
async __washWashQzFinish () {
|
||||
try {
|
||||
let res = await washWashQzFinish(this.pkId, this.weight, this.vechile_code)
|
||||
if (res.code === 200) {
|
||||
this.toast(res.msg)
|
||||
this._washWashTasks()
|
||||
}
|
||||
this.disabled4 = false
|
||||
} catch (e) {
|
||||
this.disabled4 = false
|
||||
this.$refs.child.active = false
|
||||
}
|
||||
},
|
||||
toSureDialog (type) {
|
||||
switch (type) {
|
||||
case '1':
|
||||
this.__washWashFinish()
|
||||
break
|
||||
case '2':
|
||||
this.__washWashTaskFinish()
|
||||
break
|
||||
case '3':
|
||||
this.__washWashQzFinish()
|
||||
}
|
||||
},
|
||||
toCancle () {
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
this.disabled4 = false
|
||||
},
|
||||
async _bcpInCallVehicle () {
|
||||
this.disabled5 = true
|
||||
try {
|
||||
let res = await bcpInCallVehicle()
|
||||
if (res.code === 200) {
|
||||
this.toast(res.msg)
|
||||
}
|
||||
this.disabled5 = false
|
||||
} catch (e) {
|
||||
this.disabled5 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user