包装机选择

This commit is contained in:
2023-08-08 18:22:24 +08:00
parent a401dd9504
commit c08f0eb83e
2 changed files with 52 additions and 332 deletions

View File

@@ -2,56 +2,9 @@
<div class="order-wraper"> <div class="order-wraper">
<div class="search-confirm-wrap"> <div class="search-confirm-wrap">
<div class="search-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">单据类型</div>
<div class="filter_input_wraper">
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">入库点</div>
<div class="filter_input_wraper">
<el-select v-model="value3" filterable clearable placeholder="请选择">
<el-option
v-for="item in options3"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">备注</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="remark">
</div>
</div>
<div class="search-item_2 flexend"> <div class="search-item_2 flexend">
<button class="button button--primary" @click="toAddBillMater">添加单据物料</button> <button class="button button--primary" @click="toSelect">刻字暂存位选择</button>
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': this.value1 === '' || this.value2 === '' || this.value3 === '' || this.dataList === [] || flag}" @click="showDialog">确认入库</button> <button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': !this.pkId}" @click="_confirmIn">空框送回</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="delRow">删除一行</button>
<button class="button button--primary" @click="toSearch">作业查询</button>
</div> </div>
</div> </div>
</div> </div>
@@ -60,76 +13,39 @@
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th>物料编</th> <th>设备</th>
<th>物料名称</th> <th>工单号</th>
<th>生产数量</th>
<th>物料规格</th> <th>物料规格</th>
<th>入库数量</th> <th>物料编码</th>
<th>订单号</th>
<th>客户</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.sale_code}" @click="toRadio(e)"> <tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.sale_code}" @click="toRadio(e)">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{e.material_code}}</td> <td>{{e.device_code}}</td>
<td>{{e.material_name}}</td> <td>{{e.workorder_code}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.material_spec}}</td> <td>{{e.material_spec}}</td>
<td><input type="number" class="input" v-model="e.sale_qty"></td> <td>{{e.material_code}}</td>
<!-- <td><input type="number" class="input" :min="0" v-model="el.sale_qty" @blur="e => {if (e.target.value === '') {el.sale_qty=0}}" v-enter-number></td> -->
<td>{{e.sale_code}}</td>
<td>{{e.remark}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<jxDialog
ref="child"
:title="title"
:type="type"
@toSure="toSureDialog"
>
<div class="form_wraper">确定继续操作吗</div>
</jxDialog>
</div> </div>
</template> </template>
<script> <script>
import { getBcpStor, getBillType, getPoint, confirmIn } from '../../../config/getData1.js' import { confirmIn } from '../../../config/getData1.js'
import jxDialog from '@components/dialog.vue'
export default { export default {
name: 'finishedinstore', name: 'bzjselect',
components: {
jxDialog
},
data () { data () {
return { return {
title: '提示',
type: '2',
options1: [],
value1: '',
options2: [],
value2: '',
options3: [],
value3: '',
remark: '',
dataList: [], dataList: [],
// dataList: [{material_code: '24007845L', material_spec: '23xcds', material_name: '垫片活接直通\DPHJS22\EHJA0703009B', sale_qty: '1000', sale_code: '0022060927', remark: '222'}], // dataList: [{material_code: '24007845L', material_spec: '23xcds', material_name: '垫片活接直通\DPHJS22\EHJA0703009B', sale_qty: '1000', sale_code: '0022060927', remark: '222'}],
pkId: '', pkId: '',
pkObj: {}, pkObj: {},
disabled2: false disabled1: false
}
},
computed: {
flag () {
let flag = false
if (this.dataList.length) {
this.dataList.map(el => {
if (el.sale_qty === '' || Number(el.sale_qty) < 0) {
flag = true
}
})
}
return flag
} }
}, },
beforeRouteLeave (to, from, next) { beforeRouteLeave (to, from, next) {
@@ -138,92 +54,33 @@ export default {
} }
next() next()
}, },
activated () {
if (this.$store.getters.materArr.length > 0) {
this.dataList = [...this.dataList, ...this.$store.getters.materArr]
}
},
created () { created () {
this._getBcpStor() this._outgetAll()
this._getBillType()
this._getPoint()
}, },
methods: { methods: {
toSureDialog () { async _confirmIn () {
this.toSure() this.disabled1 = true
}, if (!this.pkId) {
showDialog () { this.disabled1 = false
if (this.flag || this.value1 === '' || this.value2 === '' || this.value3 === '' || this.dataList === []) {
// this.toast('请填写完整!')
return
}
this.$refs.child.active = true
},
// 仓库下拉框
async _getBcpStor () {
let res = await getBcpStor()
this.options1 = [...res.data]
},
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options2 = [...res.data]
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options3 = [...res.data]
},
// 确认入库
async toSure () {
this.$refs.child.disabled = true
this.disabled2 = true
if (this.value1 === '' || this.value2 === '' || this.value3 === '' || this.dataList === []) {
this.disabled2 = false
return return
} }
try { try {
let from = { let res = await confirmIn(this.pkObj)
stor_id: this.value1,
bill_type: this.value2,
point_code: this.value3,
remark: this.remark,
rows: this.dataList
}
let res = await confirmIn(from)
this.toast(res.message) this.toast(res.message)
this.value1 = '' this.disabled1 = false
this.value2 = '' this.pkId = ''
this.value3 = '' this.pkObj = {}
this.remark = '' this._outgetAll()
this.dataList = []
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
this.$refs.child.active = false
this.$refs.child.disabled = false
} catch (e) { } catch (e) {
this.disabled2 = false this.disabled1 = false
this.$refs.child.active = false
this.$refs.child.disabled = false
} }
}, },
toAddBillMater () { toSelect () {
this.$store.dispatch('setMaterArr', [])
this.$router.push('/selectfinishedmater')
},
toSearch () {
this.$router.push('/finishedinstoresearch') this.$router.push('/finishedinstoresearch')
}, },
toRadio (e) { toRadio (e) {
this.pkId = this.pkId === e.sale_code ? '' : e.sale_code this.pkId = this.pkId === e.sale_code ? '' : e.sale_code
this.pkObj = this.pkId === e.sale_code ? e : {} this.pkObj = this.pkId === e.sale_code ? e : {}
},
delRow () {
if (!this.pkId) {
return
}
this.dataList = this.dataList.filter(el => el.sale_code !== this.pkId)
this.$store.dispatch('setMaterArr', this.dataList)
} }
} }
} }

View File

@@ -3,55 +3,13 @@
<div class="search-confirm-wrap"> <div class="search-confirm-wrap">
<div class="search-wrap"> <div class="search-wrap">
<div class="search-item"> <div class="search-item">
<div class="search-label">仓库</div> <div class="search-label">包装机编号</div>
<div class="filter_input_wraper"> <div class="filter_input_wraper">
<el-select v-model="value1" filterable clearable placeholder="请选择"> <input type="text" class="filter-input" v-model="val1">
<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">单据类型</div>
<div class="filter_input_wraper">
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">入库点</div>
<div class="filter_input_wraper">
<el-select v-model="value3" filterable clearable placeholder="请选择">
<el-option
v-for="item in options3"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">备注</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="remark">
</div> </div>
</div> </div>
<div class="search-item_2 flexend"> <div class="search-item_2 flexend">
<button class="button button--primary" @click="toAddBillMater">添加单据物</button> <button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': !this.pkId}" @click="_confirmIn">确认上</button>
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': this.value1 === '' || this.value2 === '' || this.value3 === '' || this.dataList === [] || flag}" @click="showDialog">确认入库</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="delRow">删除一行</button>
<button class="button button--primary" @click="toSearch">作业查询</button>
</div> </div>
</div> </div>
</div> </div>
@@ -60,76 +18,40 @@
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th>物料编</th> <th>设备</th>
<th>物料名称</th> <th>工单号</th>
<th>生产数量</th>
<th>物料规格</th> <th>物料规格</th>
<th>入库数量</th> <th>物料编码</th>
<th>订单号</th>
<th>客户</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.sale_code}" @click="toRadio(e)"> <tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.sale_code}" @click="toRadio(e)">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{e.material_code}}</td> <td>{{e.device_code}}</td>
<td>{{e.material_name}}</td> <td>{{e.workorder_code}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.material_spec}}</td> <td>{{e.material_spec}}</td>
<td><input type="number" class="input" v-model="e.sale_qty"></td> <td>{{e.material_code}}</td>
<!-- <td><input type="number" class="input" :min="0" v-model="el.sale_qty" @blur="e => {if (e.target.value === '') {el.sale_qty=0}}" v-enter-number></td> -->
<td>{{e.sale_code}}</td>
<td>{{e.remark}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<jxDialog
ref="child"
:title="title"
:type="type"
@toSure="toSureDialog"
>
<div class="form_wraper">确定继续操作吗</div>
</jxDialog>
</div> </div>
</template> </template>
<script> <script>
import { getBcpStor, getBillType, getPoint, confirmIn } from '../../../config/getData1.js' import { confirmIn } from '../../../config/getData1.js'
import jxDialog from '@components/dialog.vue'
export default { export default {
name: 'finishedinstore', name: 'letterbufferselect',
components: {
jxDialog
},
data () { data () {
return { return {
title: '提示', val1: '',
type: '2',
options1: [],
value1: '',
options2: [],
value2: '',
options3: [],
value3: '',
remark: '',
dataList: [], dataList: [],
// dataList: [{material_code: '24007845L', material_spec: '23xcds', material_name: '垫片活接直通\DPHJS22\EHJA0703009B', sale_qty: '1000', sale_code: '0022060927', remark: '222'}], // dataList: [{material_code: '24007845L', material_spec: '23xcds', material_name: '垫片活接直通\DPHJS22\EHJA0703009B', sale_qty: '1000', sale_code: '0022060927', remark: '222'}],
pkId: '', pkId: '',
pkObj: {}, pkObj: {},
disabled2: false disabled1: false
}
},
computed: {
flag () {
let flag = false
if (this.dataList.length) {
this.dataList.map(el => {
if (el.sale_qty === '' || Number(el.sale_qty) < 0) {
flag = true
}
})
}
return flag
} }
}, },
beforeRouteLeave (to, from, next) { beforeRouteLeave (to, from, next) {
@@ -138,92 +60,33 @@ export default {
} }
next() next()
}, },
activated () {
if (this.$store.getters.materArr.length > 0) {
this.dataList = [...this.dataList, ...this.$store.getters.materArr]
}
},
created () { created () {
this._getBcpStor() this._outgetAll()
this._getBillType()
this._getPoint()
}, },
methods: { methods: {
toSureDialog () { async _confirmIn () {
this.toSure() this.disabled1 = true
}, if (!this.pkId) {
showDialog () { this.disabled1 = false
if (this.flag || this.value1 === '' || this.value2 === '' || this.value3 === '' || this.dataList === []) {
// this.toast('请填写完整!')
return
}
this.$refs.child.active = true
},
// 仓库下拉框
async _getBcpStor () {
let res = await getBcpStor()
this.options1 = [...res.data]
},
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options2 = [...res.data]
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options3 = [...res.data]
},
// 确认入库
async toSure () {
this.$refs.child.disabled = true
this.disabled2 = true
if (this.value1 === '' || this.value2 === '' || this.value3 === '' || this.dataList === []) {
this.disabled2 = false
return return
} }
try { try {
let from = { let res = await confirmIn(this.pkObj)
stor_id: this.value1,
bill_type: this.value2,
point_code: this.value3,
remark: this.remark,
rows: this.dataList
}
let res = await confirmIn(from)
this.toast(res.message) this.toast(res.message)
this.value1 = '' this.disabled1 = false
this.value2 = '' this.pkId = ''
this.value3 = '' this.pkObj = {}
this.remark = '' this._outgetAll()
this.dataList = []
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
this.$refs.child.active = false
this.$refs.child.disabled = false
} catch (e) { } catch (e) {
this.disabled2 = false this.disabled1 = false
this.$refs.child.active = false
this.$refs.child.disabled = false
} }
}, },
toAddBillMater () { toSelect () {
this.$store.dispatch('setMaterArr', [])
this.$router.push('/selectfinishedmater')
},
toSearch () {
this.$router.push('/finishedinstoresearch') this.$router.push('/finishedinstoresearch')
}, },
toRadio (e) { toRadio (e) {
this.pkId = this.pkId === e.sale_code ? '' : e.sale_code this.pkId = this.pkId === e.sale_code ? '' : e.sale_code
this.pkObj = this.pkId === e.sale_code ? e : {} this.pkObj = this.pkId === e.sale_code ? e : {}
},
delRow () {
if (!this.pkId) {
return
}
this.dataList = this.dataList.filter(el => el.sale_code !== this.pkId)
this.$store.dispatch('setMaterArr', this.dataList)
} }
} }
} }