This commit is contained in:
2023-06-30 17:49:52 +08:00
12 changed files with 260 additions and 46 deletions

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单据类型下拉框
export const getBillType = () => post('api/pda/bcp/in/getBillType', {})
// 1.3物料选择页面
export const getMaterial = (code) => post('api/pda/bcp/in/getMaterial', {
material_code: code
export const getMaterial = (code, page, size) => post('api/pda/bcp/in/getMaterial', {
material_code: code,
page: page,
size: size
})
// export const getMaterial = (code) => {
// let res = {

View File

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

View File

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

View File

@@ -22,21 +22,23 @@
</div>
</div>
<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" @click="clearUp">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button>
</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">
<thead>
<tr>
<th>序号</th>
<th>物料编号</th>
<th>物料名称</th>
<th>物料规格</th>
<th>物料类别</th>
<th>单重</th>
<th>重量单位</th>
</tr>
</thead>
@@ -45,11 +47,14 @@
<td>{{ i+1 }}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{ e.material_spec }}</td>
<td>{{e.class_code}}</td>
<td>{{ e.net_weight | numeric(3) }}</td>
<td>{{e.unit_name}}</td>
</tr>
</tbody>
</table>
<div class="loading-tips">{{desc}}</div>
</div>
</div>
</template>
@@ -64,7 +69,11 @@ export default {
val1: '',
dataList: [],
pkId: '',
pkObj: {}
pkObj: {},
page: 1,
size: '30',
busy: false,
desc: ''
}
},
created () {
@@ -73,8 +82,30 @@ export default {
methods: {
// grid
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 = []
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 () {
this.$router.push('/semifinishedinstore')

View File

@@ -16,13 +16,23 @@
</div>
</div> -->
<div class="search-item">
<div class="search-label">物料</div>
<div class="search-label">货位</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="val1">
</div>
</div>
<div class="search-item_2 flexend">
<button class="button button--primary" @click="_getMaterial">快速查询</button>
<div class="search-item">
<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" @click="clearUp">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button>
@@ -62,6 +72,8 @@ export default {
options1: [],
value1: '',
val1: '',
val2: '',
val3: '',
dataList: [],
pkId: '',
pkObj: {}
@@ -96,4 +108,15 @@ export default {
</script>
<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>

View File

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

View File

@@ -124,9 +124,18 @@ export default {
let res = ''
let res1 = accMul(this.total_qty, 1000)
res = accDiv(res1, this.unit_weight)
res = Number(res).toFixed(3)
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) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
@@ -138,12 +147,13 @@ export default {
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
this.unit_weight = Number(JSON.parse(this.$store.getters.materObj).net_weight).toFixed(3)
}
},
created () {
this._getBcpStor()
this._getBillType()
this._getPoint()
},
methods: {
// 仓库下拉框
@@ -216,7 +226,11 @@ export default {
this.$router.push('/matersearch')
},
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-option
v-for="item in options1"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code">
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id">
</el-option>
</el-select>
</div>
@@ -21,77 +21,74 @@
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code">
: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">
<input type="text" class="filter-input">
<div class="filter_input_wraper pointer" @click="searchMater">
<input type="text" class="filter-input" disabled 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">
</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">
<input type="text" class="filter-input" v-model="material_spec" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">重量(kg)</div>
<div class="filter_input_wraper">
<input type="number" class="filter-input">
<input type="number" class="filter-input" v-model="total_qty">
</div>
</div>
<div class="search-item">
<div class="search-label">货位</div>
<div class="search-label">单重(g)</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input">
<input type="number" class="filter-input" v-model="unit_weight">
</div>
</div>
<div class="search-item">
<div class="search-label">载具号</div>
<div class="search-label">数量</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input">
<input type="number" class="filter-input" v-model="qty" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">库点</div>
<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.device_code"
:label="item.device_name"
:value="item.device_code">
: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 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-label">备注</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input">
<input type="text" class="filter-input" v-model="remark">
</div>
</div>
<div class="search-item_2">
<button class="button button--primary">作业查询</button>
<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" @click="toJumpSearch">作业查询</button>
</div>
</div>
</div>
@@ -99,7 +96,10 @@
</template>
<script>
import {outgetBcpStor, outgetBillType, getPoint, callVehicle, createIn} from '@config/getData2.js'
import {accMul, accDiv} from '@config/utils.js'
export default {
name: 'semifinishedoutstore',
data () {
return {
options1: [],
@@ -107,7 +107,116 @@ export default {
options2: [],
value2: '',
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
width 100%
margin-left 0
.filter_button
width 96px
height 30px
.filter_input_wraper_1
width calc(100% - 156px)
padding-right 10px
</style>

View File

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