刻字暂存位选择

This commit is contained in:
2023-08-09 10:58:09 +08:00
parent 8d73f4da43
commit cc6635e5d5
2 changed files with 30 additions and 42 deletions

View File

@@ -4,7 +4,7 @@
<div class="search-wrap"> <div class="search-wrap">
<div class="search-item_2 flexend"> <div class="search-item_2 flexend">
<button class="button button--primary" @click="toSelect">刻字暂存位选择</button> <button class="button button--primary" @click="toSelect">刻字暂存位选择</button>
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': !this.pkId}" @click="_confirmIn">空框送回</button> <button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': !this.pkId}" @click="_sendVechile">空框送回</button>
</div> </div>
</div> </div>
</div> </div>
@@ -21,7 +21,7 @@
</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.device_code}" @click="toRadio(e)">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{e.device_code}}</td> <td>{{e.device_code}}</td>
<td>{{e.workorder_code}}</td> <td>{{e.workorder_code}}</td>
@@ -36,51 +36,47 @@
</template> </template>
<script> <script>
import { confirmIn } from '../../../config/getData1.js' import { packageList, sendVechile } from '../../../config/getData1.js'
export default { export default {
name: 'bzjselect', name: 'bzjselect',
data () { data () {
return { return {
dataList: [], dataList: [],
// dataList: [{material_code: '24007845L', material_spec: '23xcds', material_name: '垫片活接直通\DPHJS22\EHJA0703009B', sale_qty: '1000', sale_code: '0022060927', remark: '222'}], // dataList: [{device_code: '24007845L', workorder_code: '23xcds', material_spec: '垫片活接直通\DPHJS22\EHJA0703009B', plan_qty: '1000', material_code: '0022060927'}],
pkId: '', pkId: '',
pkObj: {}, pkObj: {},
disabled1: false disabled1: false
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
created () { created () {
this._outgetAll() this._packageList()
}, },
methods: { methods: {
async _confirmIn () { async _sendVechile () {
this.disabled1 = true this.disabled1 = true
if (!this.pkId) { if (!this.pkId) {
this.disabled1 = false this.disabled1 = false
return return
} }
try { try {
let res = await confirmIn(this.pkObj) let res = await sendVechile(this.pkId)
this.toast(res.message) this.toast(res.message)
this.disabled1 = false this.disabled1 = false
this.pkId = '' this.pkId = ''
this.pkObj = {} this.pkObj = {}
this._outgetAll() this.$store.dispatch('setMaterObj', '')
this._packageList()
} catch (e) { } catch (e) {
this.disabled1 = false this.disabled1 = false
} }
}, },
toSelect () { toSelect () {
this.$store.dispatch('setMaterObj', JSON.stringify(this.pkObj))
this.$router.push('/letterbufferselect') this.$router.push('/letterbufferselect')
}, },
toRadio (e) { toRadio (e) {
this.pkId = this.pkId === e.sale_code ? '' : e.sale_code this.pkId = this.pkId === e.device_code ? '' : e.device_code
this.pkObj = this.pkId === e.sale_code ? e : {} this.pkObj = this.pkId === e.device_code ? e : {}
} }
} }
} }

View File

@@ -9,7 +9,7 @@
</div> </div>
</div> </div>
<div class="search-item_2 flexend"> <div class="search-item_2 flexend">
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': !this.pkId}" @click="_confirmIn">确认上料</button> <button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': !this.pkId}" @click="_confirmUp">确认上料</button>
</div> </div>
</div> </div>
</div> </div>
@@ -18,21 +18,19 @@
<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>
</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.point_code}" @click="toRadio(e)">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{e.device_code}}</td> <td>{{e.point_code}}</td>
<td>{{e.workorder_code}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.material_spec}}</td> <td>{{e.material_spec}}</td>
<td>{{e.material_code}}</td> <td>{{e.material_code}}</td>
<td>{{e.qty}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -41,52 +39,44 @@
</template> </template>
<script> <script>
import { confirmIn } from '../../../config/getData1.js' import { cachepoint, confirmUp } from '../../../config/getData1.js'
export default { export default {
name: 'letterbufferselect', name: 'letterbufferselect',
data () { data () {
return { return {
val1: '', val1: '',
dataList: [], dataList: [],
// dataList: [{material_code: '24007845L', material_spec: '23xcds', material_name: '垫片活接直通\DPHJS22\EHJA0703009B', sale_qty: '1000', sale_code: '0022060927', remark: '222'}], // dataList: [{point_code: '1111', material_code: '24007845L', material_spec: '23xcds', qty: '1000'}],
pkId: '', pkId: '',
pkObj: {}, pkObj: {},
disabled1: false disabled1: false
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
created () { created () {
this._outgetAll() this.val1 = this.$store.getters.setMaterObj.device_code
this._cachepoint()
}, },
methods: { methods: {
async _confirmIn () { async _confirmUp () {
this.disabled1 = true this.disabled1 = true
if (!this.pkId) { if (!this.pkId) {
this.disabled1 = false this.disabled1 = false
return return
} }
try { try {
let res = await confirmIn(this.pkObj) let res = await confirmUp(this.val1, this.pkId)
this.toast(res.message) this.toast(res.message)
this.disabled1 = false this.disabled1 = false
this.pkId = '' this.pkId = ''
this.pkObj = {} this.pkObj = {}
this._outgetAll() this._cachepoint()
} catch (e) { } catch (e) {
this.disabled1 = false this.disabled1 = false
} }
}, },
toSelect () {
this.$router.push('/finishedinstoresearch')
},
toRadio (e) { toRadio (e) {
this.pkId = this.pkId === e.sale_code ? '' : e.sale_code this.pkId = this.pkId === e.point_code ? '' : e.point_code
this.pkObj = this.pkId === e.sale_code ? e : {} this.pkObj = this.pkId === e.point_code ? e : {}
} }
} }
} }
@@ -105,4 +95,6 @@ export default {
width auto width auto
text-indent 0 text-indent 0
text-align center text-align center
.search-label
width .9rem
</style> </style>