半成品入库

This commit is contained in:
2023-06-30 17:28:11 +08:00
parent a65922cc60
commit d7ec91aa0e
12 changed files with 260 additions and 46 deletions

View File

@@ -20,6 +20,7 @@
"fastclick": "^1.0.6", "fastclick": "^1.0.6",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-infinite-scroll": "^2.0.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },

8
src/config/filter.js Normal file
View File

@@ -0,0 +1,8 @@
const filter = {
numeric (value, bit) {
if (!value) return ''
return Number(value).toFixed(bit)
}
}
export default filter

View File

@@ -123,8 +123,10 @@ export const getBcpStor = () => post('api/pda/bcp/in/getBcpStor', {})
// 1.2单据类型下拉框 // 1.2单据类型下拉框
export const getBillType = () => post('api/pda/bcp/in/getBillType', {}) export const getBillType = () => post('api/pda/bcp/in/getBillType', {})
// 1.3物料选择页面 // 1.3物料选择页面
export const getMaterial = (code) => post('api/pda/bcp/in/getMaterial', { export const getMaterial = (code, page, size) => post('api/pda/bcp/in/getMaterial', {
material_code: code material_code: code,
page: page,
size: size
}) })
// export const getMaterial = (code) => { // export const getMaterial = (code) => {
// let res = { // let res = {

View File

@@ -3,7 +3,7 @@ import { Dialog } from './utils.js'
import store from '../vuex/store' import store from '../vuex/store'
import router from '@/router' import router from '@/router'
axios.defaults.timeout = 50000 axios.defaults.timeout = 5000
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
axios.interceptors.request.use( axios.interceptors.request.use(

View File

@@ -7,13 +7,16 @@ import store from './vuex/store'
import '@style/reset.css' import '@style/reset.css'
import '@style/layout.styl' import '@style/layout.styl'
import fastClick from 'fastclick' import fastClick from 'fastclick'
import infiniteScroll from 'vue-infinite-scroll'
import { DatePicker, Select, Option } from 'element-ui' import { DatePicker, Select, Option } from 'element-ui'
import '@config/rem.js' import '@config/rem.js'
import {post} from '@config/http.js' import {post} from '@config/http.js'
import { Dialog, toast } from '@config/utils.js' import { Dialog, toast } from '@config/utils.js'
import filter from '@config/filter.js'
import JSEncrypt from 'jsencrypt' import JSEncrypt from 'jsencrypt'
fastClick.attach(document.body) fastClick.attach(document.body)
Vue.use(infiniteScroll)
Vue.use(DatePicker) Vue.use(DatePicker)
Vue.use(Select) Vue.use(Select)
Vue.use(Option) Vue.use(Option)
@@ -21,6 +24,9 @@ Vue.prototype.$post = post
Vue.prototype.Dialog = Dialog Vue.prototype.Dialog = Dialog
Vue.prototype.toast = toast Vue.prototype.toast = toast
Vue.config.productionTip = false Vue.config.productionTip = false
for (let k in filter) {
Vue.filter(k, filter[k])
}
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' + const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ==' '2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ=='

View File

@@ -22,21 +22,23 @@
</div> </div>
</div> </div>
<div class="search-item_2 flexend"> <div class="search-item_2 flexend">
<button class="button button--primary" @click="_getMaterial">快速查询</button> <button class="button button--primary" @click="_getMaterial">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button> <button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
<button class="button button--primary" @click="clearUp">清除</button> <button class="button button--primary" @click="clearUp">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button> <button class="button button--primary" @click="colseUp">关闭</button>
</div> </div>
</div> </div>
</div> </div>
<div class="grid_wraper"> <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"> <table class="filter-table">
<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>
</tr> </tr>
</thead> </thead>
@@ -45,11 +47,14 @@
<td>{{ i+1 }}</td> <td>{{ i+1 }}</td>
<td>{{e.material_code}}</td> <td>{{e.material_code}}</td>
<td>{{e.material_name}}</td> <td>{{e.material_name}}</td>
<td>{{ e.material_spec }}</td>
<td>{{e.class_code}}</td> <td>{{e.class_code}}</td>
<td>{{ e.net_weight | numeric(3) }}</td>
<td>{{e.unit_name}}</td> <td>{{e.unit_name}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="loading-tips">{{desc}}</div>
</div> </div>
</div> </div>
</template> </template>
@@ -64,7 +69,11 @@ export default {
val1: '', val1: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {},
page: 1,
size: '30',
busy: false,
desc: ''
} }
}, },
created () { created () {
@@ -73,8 +82,30 @@ export default {
methods: { methods: {
// grid // grid
async _getMaterial () { async _getMaterial () {
let res = await getMaterial(this.val1) this.page = 1
this.busy = false
this.desc = ''
let res = await getMaterial(this.val1, this.page + '', this.size)
this.dataList = [...res.data] this.dataList = [...res.data]
this.dataList = []
this.dataList = [...res.data]
if (res.data.length < 30) {
this.busy = true
this.desc = '已加载全部数据'
}
},
async loadMore () {
this.busy = true
this.page++
let res = await getMaterial(this.val1, this.page + '', this.size)
this.dataList = [...this.dataList, ...res.data]
if (res.data.length < 30) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
}, },
colseUp () { colseUp () {
this.$router.push('/semifinishedinstore') this.$router.push('/semifinishedinstore')

View File

@@ -16,13 +16,23 @@
</div> </div>
</div> --> </div> -->
<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">
<input type="text" class="filter-input" v-model="val1"> <input type="text" class="filter-input" v-model="val1">
</div> </div>
</div> </div>
<div class="search-item_2 flexend"> <div class="search-item">
<button class="button button--primary" @click="_getMaterial">快速查询</button> <div class="search-label">物料</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="val2">
</div>
</div>
<div class="search-item flexend">
<div class="filter_radius">
<button class="iconfont select_icon select_square_icon selected_icon unselect_icon"></button>
<div class="filter_radius_label">已挑料</div>
</div>
<button class="button button--primary" @click="_getMaterial">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button> <button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
<button class="button button--primary" @click="clearUp">清除</button> <button class="button button--primary" @click="clearUp">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button> <button class="button button--primary" @click="colseUp">关闭</button>
@@ -62,6 +72,8 @@ export default {
options1: [], options1: [],
value1: '', value1: '',
val1: '', val1: '',
val2: '',
val3: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {}
@@ -96,4 +108,15 @@ export default {
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@import '~@style/mixin.styl'
.search-item
width 27%
&:nth-child(3)
width 42%
.filter_radius
_fj()
margin-right 15px
.filter_radius_label
margin-left 5px
_font(12px, 30px, #fff,,)
</style> </style>

View File

@@ -122,6 +122,11 @@ export default {
pkObj: {} pkObj: {}
} }
}, },
created () {
this._getBcpStor()
this._getBillType()
this._getAll()
},
methods: { methods: {
// 仓库下拉框 // 仓库下拉框
async _getBcpStor () { async _getBcpStor () {

View File

@@ -124,9 +124,18 @@ export default {
let res = '' let res = ''
let res1 = accMul(this.total_qty, 1000) let res1 = accMul(this.total_qty, 1000)
res = accDiv(res1, this.unit_weight) res = accDiv(res1, this.unit_weight)
res = Number(res).toFixed(3)
return res return res
} }
}, },
watch: {
total_qty () {
this.total_qty = this.total_qty.indexOf('.') > -1 ? this.total_qty.slice(0, this.total_qty.indexOf('.') + 4) : this.total_qty
},
unit_weight () {
this.unit_weight = this.unit_weight.indexOf('.') > -1 ? this.unit_weight.slice(0, this.unit_weight.indexOf('.') + 4) : this.unit_weight
}
},
beforeRouteLeave (to, from, next) { beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') { if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', []) this.$store.dispatch('setKeepAlive', [])
@@ -138,12 +147,13 @@ export default {
this.material_id = JSON.parse(this.$store.getters.materObj).material_id this.material_id = JSON.parse(this.$store.getters.materObj).material_id
this.material_code = JSON.parse(this.$store.getters.materObj).material_code this.material_code = JSON.parse(this.$store.getters.materObj).material_code
this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec
this.unit_weight = JSON.parse(this.$store.getters.materObj).net_weight this.unit_weight = Number(JSON.parse(this.$store.getters.materObj).net_weight).toFixed(3)
} }
}, },
created () { created () {
this._getBcpStor() this._getBcpStor()
this._getBillType() this._getBillType()
this._getPoint()
}, },
methods: { methods: {
// 仓库下拉框 // 仓库下拉框
@@ -216,7 +226,11 @@ export default {
this.$router.push('/matersearch') this.$router.push('/matersearch')
}, },
toJumpSearch () { toJumpSearch () {
this.$router.push('/semifinishedinstoresearch') console.log(this.unit_weight)
// this.$router.push('/semifinishedinstoresearch')
},
handleBlur ($event) {
$event.target.value = Number($event.target.value).toFixed(3)
} }
} }
} }

View File

@@ -8,9 +8,9 @@
<el-select v-model="value1" filterable clearable placeholder="请选择"> <el-select v-model="value1" filterable clearable placeholder="请选择">
<el-option <el-option
v-for="item in options1" v-for="item in options1"
:key="item.device_code" :key="item.stor_id"
:label="item.device_name" :label="item.stor_name"
:value="item.device_code"> :value="item.stor_id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@@ -21,77 +21,74 @@
<el-select v-model="value2" filterable clearable placeholder="请选择"> <el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option <el-option
v-for="item in options2" v-for="item in options2"
:key="item.device_code" :key="item.value"
:label="item.device_name" :label="item.label"
:value="item.device_code"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<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 pointer" @click="searchMater">
<input type="text" class="filter-input"> <input type="text" class="filter-input" disabled v-model="material_code">
</div> </div>
</div> </div>
<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">
<input type="text" class="filter-input"> <input type="text" class="filter-input" v-model="material_spec" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">数量</div>
<div class="filter_input_wraper">
<input type="number" class="filter-input">
</div>
</div>
<div class="search-item">
<div class="search-label">单重(g)</div>
<div class="filter_input_wraper">
<input type="number" class="filter-input">
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-label">重量(kg)</div> <div class="search-label">重量(kg)</div>
<div class="filter_input_wraper"> <div class="filter_input_wraper">
<input type="number" class="filter-input"> <input type="number" class="filter-input" v-model="total_qty">
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-label">货位</div> <div class="search-label">单重(g)</div>
<div class="filter_input_wraper"> <div class="filter_input_wraper">
<input type="text" class="filter-input"> <input type="number" class="filter-input" v-model="unit_weight">
</div> </div>
</div> </div>
<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">
<input type="text" class="filter-input"> <input type="number" class="filter-input" v-model="qty" disabled>
</div> </div>
</div> </div>
<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="value3" filterable clearable placeholder="请选择"> <el-select v-model="value3" filterable clearable placeholder="请选择">
<el-option <el-option
v-for="item in options3" v-for="item in options3"
:key="item.device_code" :key="item.point_code"
:label="item.device_name" :label="item.point_name"
:value="item.device_code"> :value="item.point_code">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="search-item">
<div class="search-label">载具号</div>
<div class="filter_input_wraper filter_input_wraper_1">
<input type="text" class="filter-input" v-model="storagevehicle_code">
</div>
<div class="filter_button">
<button class="button button--primary" :disabled="disabled1" @click="_callVehicle">呼叫空载具</button>
</div>
</div>
<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">
<input type="text" class="filter-input"> <input type="text" class="filter-input" v-model="remark">
</div> </div>
</div> </div>
<div class="search-item_2"> <div class="search-item_2">
<button class="button button--primary">作业查询</button> <button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': value1 === '' || value2 === '' || value3 === '' || material_code === '' || total_qty === '' || unit_weight === '' || storagevehicle_code === ''}" @click="toSure">确认入库</button>
<button class="button button--primary">确认出库</button> <button class="button button--primary" @click="toJumpSearch">作业查询</button>
</div> </div>
</div> </div>
</div> </div>
@@ -99,7 +96,10 @@
</template> </template>
<script> <script>
import {outgetBcpStor, outgetBillType, getPoint, callVehicle, createIn} from '@config/getData2.js'
import {accMul, accDiv} from '@config/utils.js'
export default { export default {
name: 'semifinishedoutstore',
data () { data () {
return { return {
options1: [], options1: [],
@@ -107,7 +107,116 @@ export default {
options2: [], options2: [],
value2: '', value2: '',
options3: [], options3: [],
value3: '' value3: '',
material_id: '',
material_code: '',
material_spec: '',
total_qty: '',
unit_weight: '',
storagevehicle_code: '',
remark: '',
disabled1: false,
disabled2: false
}
},
computed: {
qty () {
let res = ''
let res1 = accMul(this.total_qty, 1000)
res = accDiv(res1, this.unit_weight)
return res
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
if (this.$store.getters.materObj !== '') {
this.material_id = JSON.parse(this.$store.getters.materObj).material_id
this.material_code = JSON.parse(this.$store.getters.materObj).material_code
this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec
this.unit_weight = JSON.parse(this.$store.getters.materObj).net_weight
}
},
created () {
this._outgetBcpStor()
this._outgetBillType()
},
methods: {
// 仓库下拉框
async _outgetBcpStor () {
let res = await outgetBcpStor()
this.options1 = [...res.data]
},
// 单据类型下拉框
async _outgetBillType () {
let res = await outgetBillType()
this.options2 = [...res.data]
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options3 = [...res.data]
},
// 呼叫空载具
async _callVehicle () {
this.disabled1 = true
try {
let res = await callVehicle()
this.toast(res.message)
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
// 确认入库
async toSure () {
this.disabled2 = true
if (this.value1 === '' || this.value2 === '' || this.value3 === '' || this.material_code === '' || this.total_qty === '' || this.unit_weight === '' || this.storagevehicle_code === '') {
this.disabled2 = false
return
}
try {
let from = {
stor_id: this.value1,
bill_type: this.value2,
material_id: this.material_id,
material_code: this.material_code,
material_spec: this.material_spec,
total_qty: this.total_qty,
unit_weight: this.unit_weight,
qty: this.qty,
point_code: this.value3,
storagevehicle_code: this.storagevehicle_code,
remark: this.remark
}
let res = await createIn(from)
this.toast(res.message)
this.value1 = ''
this.value2 = ''
this.value3 = ''
this.material_id = ''
this.material_code = ''
this.material_spec = ''
this.total_qty = ''
this.unit_weight = ''
this.storagevehicle_code = ''
this.remark = ''
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
} catch (e) {
this.disabled2 = false
}
},
searchMater () {
this.$store.dispatch('setMaterObj', '')
this.$router.push('/outmatersearch')
},
toJumpSearch () {
this.$router.push('/semifinishedinstoresearch')
} }
} }
} }
@@ -124,4 +233,10 @@ export default {
.search-item_2 .search-item_2
width 100% width 100%
margin-left 0 margin-left 0
.filter_button
width 96px
height 30px
.filter_input_wraper_1
width calc(100% - 156px)
padding-right 10px
</style> </style>

View File

@@ -434,6 +434,10 @@ input::-webkit-input-placeholder
margin-left 5px margin-left 5px
.flexend .flexend
justify-content flex-end justify-content flex-end
.loading-tips
_font(12px,30px,#fff,,center)
height 30px
overflow hidden
// //
.overall_orange .overall_orange

View File

@@ -8811,6 +8811,11 @@ vue-hot-reload-api@^2.2.0:
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz#2756f46cb3258054c5f4723de8ae7e87302a1ccf" resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz#2756f46cb3258054c5f4723de8ae7e87302a1ccf"
integrity sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g== integrity sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==
vue-infinite-scroll@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/vue-infinite-scroll/-/vue-infinite-scroll-2.0.2.tgz#ca37a91fe92ee0ad3b74acf8682c00917144b711"
integrity sha512-n+YghR059YmciANGJh9SsNWRi1YZEBVlODtmnb/12zI+4R72QZSWd+EuZ5mW6auEo/yaJXgxzwsuhvALVnm73A==
vue-jest@^1.0.2: vue-jest@^1.0.2:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/vue-jest/-/vue-jest-1.4.0.tgz#1d6b4d2774b0aec06cfe5d39789039d3381bc528" resolved "https://registry.yarnpkg.com/vue-jest/-/vue-jest-1.4.0.tgz#1d6b4d2774b0aec06cfe5d39789039d3381bc528"