半成品入库

This commit is contained in:
2023-06-30 14:48:20 +08:00
parent 59caf057ae
commit 418fff67b6
8 changed files with 146 additions and 26 deletions

View File

@@ -23,8 +23,8 @@
</div>
<div class="search-item_2 flexend">
<button class="button button--primary" @click="_getMaterial">快速查询</button>
<button class="button button--primary">确定</button>
<button class="button button--primary">清除</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>
@@ -62,7 +62,7 @@ export default {
options1: [],
value1: '',
val1: '',
dataList: [{material_code: '1'}],
dataList: [],
pkId: '',
pkObj: {}
}
@@ -71,10 +71,10 @@ export default {
this._getMaterial()
},
methods: {
// 仓库下拉框
// grid
async _getMaterial () {
let res = await getMaterial(this.val1)
this.options1 = [...res.data]
this.dataList = [...res.data]
},
colseUp () {
this.$router.push('/semifinishedinstore')
@@ -82,6 +82,14 @@ export default {
toRadio (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
},
toSure () {
this.$store.dispatch('setMaterObj', JSON.stringify(this.pkObj))
this.colseUp()
},
clearUp () {
this.pkId = ''
this.pkObj = {}
}
}
}

View File

@@ -31,31 +31,31 @@
<div class="search-item">
<div class="search-label">物料</div>
<div class="filter_input_wraper pointer" @click="searchMater">
<input type="text" class="filter-input" disabled v-model="val1">
<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" v-model="val2">
<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">单重(g)</div>
<div class="filter_input_wraper">
<input type="number" 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="filter_input_wraper">
<input type="number" class="filter-input">
<input type="number" class="filter-input" v-model="qty" disabled>
</div>
</div>
<div class="search-item">
@@ -64,9 +64,9 @@
<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>
@@ -74,21 +74,21 @@
<div class="search-item">
<div class="search-label">载具号</div>
<div class="filter_input_wraper filter_input_wraper_1">
<input type="text" class="filter-input">
<input type="text" class="filter-input" v-model="storagevehicle_code">
</div>
<div class="filter_button">
<button class="button button--primary">呼叫空载具</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>
@@ -96,7 +96,8 @@
</template>
<script>
import {getBcpStor, getBillType} from '@config/getData2.js'
import {getBcpStor, getBillType, getPoint, callVehicle, createIn} from '@config/getData2.js'
import {accMul, accDiv} from '@config/utils.js'
export default {
name: 'semifinishedinstore',
data () {
@@ -107,8 +108,23 @@ export default {
value2: '',
options3: [],
value3: '',
val1: '',
val2: ''
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) {
@@ -118,7 +134,12 @@ export default {
next()
},
activated () {
// this.val2 = this.$store.getters.materObj.material_name
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._getBcpStor()
@@ -133,10 +154,69 @@ export default {
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options3 = [...res.data]
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options2 = [...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('/matersearch')
},
toJumpSearch () {
this.$router.push('/semifinishedinstoresearch')
}
}
}