Files
hht-ynhl-one-uni/pages/SecondPhase/slitting/TubeStock.vue

196 lines
5.4 KiB
Vue
Raw Normal View History

2025-05-30 10:03:32 +08:00
<template>
<view class="zd_container">
<!-- <nav-bar title="管芯备货"></nav-bar> -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
2025-07-01 14:47:32 +08:00
<view class="filter_item is-required">
2025-06-19 15:45:01 +08:00
<view class="filter_label">{{$t('filter.area')}}</view>
2025-05-30 10:03:32 +08:00
<view class="filter_input_wraper">
2025-06-19 15:45:01 +08:00
<uni-data-select v-model="index1" :placeholder="$t('uni.dataSelect.placeholder')" :localdata="options1" @change="selectChange1"></uni-data-select>
2025-05-30 10:03:32 +08:00
</view>
</view>
2025-07-01 11:18:01 +08:00
<view class="filter_item is-required">
2025-05-30 10:03:32 +08:00
<view class="filter_label_wraper">
2025-06-19 15:45:01 +08:00
<span class="filter_label">{{$t('filter.corespecifications')}}</span>
2025-05-30 10:03:32 +08:00
</view>
<view class="filter_input_wraper">
2025-06-19 15:45:01 +08:00
<uni-data-select v-model="index2" :placeholder="$t('uni.dataSelect.placeholder')" :localdata="options2" @change="selectChange2"></uni-data-select>
2025-05-30 10:03:32 +08:00
</view>
</view>
2025-07-01 14:47:32 +08:00
<view class="filter_item is-required">
<view class="filter_label">{{$t('filter.quantity')}}</view>
<view class="filter_input_wraper">
<NumberInput
v-model="val1"
input-class="filter_input"
mode="integer"
/>
</view>
</view>
2025-05-30 10:03:32 +08:00
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
2025-06-19 15:45:01 +08:00
<th>{{$t('grid.number')}}</th>
<th class="th_2">{{$t('filter.pallet-number')}}</th>
<th>{{$t('grid.coretype')}}</th>
<th>{{$t('grid.corename')}}</th>
<th>{{$t('filter.quantity')}}</th>
2025-07-01 14:47:32 +08:00
<th>{{$t('grid.signnum')}}</th>
2025-06-19 15:45:01 +08:00
<th>{{$t('filter.point')}}</th>
<th>{{$t('filter.area')}}</th>
<th>{{$t('grid.areaname')}}</th>
2025-05-30 10:03:32 +08:00
</tr>
</thead>
<tbody>
2025-06-23 10:22:08 +08:00
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.material_code === pkId}">
2025-05-30 10:03:32 +08:00
<td>{{Number(i) + 1}}</td>
<td class="td_2">{{e.vehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.total_num}}</td>
2025-07-01 14:47:32 +08:00
<td>{{e.sign_num}}</td>
2025-05-30 10:03:32 +08:00
<td>{{e.point_code}}</td>
<td>{{e.product_area}}</td>
<td>{{e.product_area_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submitbar">
2025-06-19 15:45:01 +08:00
<button class="zd-col-5 btn-submit btn-default letter-30" @tap="clearUp">{{$t('button.clear')}}</button>
2025-07-01 14:47:32 +08:00
<button class="zd-col-8 btn-submit btn-success letter-30" :class="{'btn-info': !val1 || !index1 || !index2}" :disabled="disabled" @tap="handleConfirm">{{$t('button.stockup')}}</button>
2025-06-19 15:45:01 +08:00
<button class="zd-col-8 btn-submit btn-success" @tap="_showPapervehicleView">{{$t('button.refresh')}}</button>
2025-05-30 10:03:32 +08:00
</view>
<up-top ref="UT" :scrollTop="top"></up-top>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2025-05-30 17:36:59 +08:00
import NumberInput from '@/components/NumberInput.vue'
2025-07-01 11:18:01 +08:00
import { confirmAction } from '@/utils/utils.js'
2025-05-30 10:03:32 +08:00
import {showPapervehicleView, moveStock, queryProductArea, queryPaperMaterial} from '@/utils/getData4.js'
export default {
components: {
NavBar,
2025-05-30 17:36:59 +08:00
SearchBox,
NumberInput
2025-05-30 10:03:32 +08:00
},
data() {
return {
2025-07-01 14:47:32 +08:00
val1: '',
2025-06-23 10:22:08 +08:00
pkId: '',
pkObj: {},
2025-05-30 17:36:59 +08:00
// val3: '',
2025-05-30 10:03:32 +08:00
title: '',
top: 0,
options1: [],
index1: '',
options2: [],
index2: '',
disabled: false,
dataList: []
};
},
onLoad (options) {
this.title = options.title
this._queryProductArea()
this._queryPaperMaterial()
this._showPapervehicleView()
},
onPageScroll(e) {
this.$refs.UT.topData(e.scrollTop)
},
methods: {
/** 区域下拉框查询 */
async _queryProductArea () {
let res = await queryProductArea()
2025-06-13 17:46:05 +08:00
this.options1 = [...res.rows]
2025-05-30 10:03:32 +08:00
},
selectChange1(e) {
this.index1 = e
if (e) {
this._queryPaperMaterial(e)
} else {
this.index2 = ''
}
},
/** 管芯规格下拉框 */
async _queryPaperMaterial (e) {
let res = await queryPaperMaterial(e)
2025-06-13 17:46:05 +08:00
this.options2 = [...res.rows]
2025-05-30 10:03:32 +08:00
},
selectChange2(e) {
this.index2 = e
},
2025-06-23 10:22:08 +08:00
toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
},
2025-05-30 10:03:32 +08:00
async _paperQueryPaperMaterial () {
let res = await paperQueryPaperMaterial()
this.dataList = [...res.rows]
},
2025-07-01 11:18:01 +08:00
async handleConfirm() {
2025-07-01 14:47:32 +08:00
if (this.val1 || !this.index1 || !this.index2) {
2025-05-30 10:03:32 +08:00
return
}
2025-07-01 11:18:01 +08:00
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
if (isConfirmed) {
this._moveStock()
}
},
async _moveStock () {
this.disabled = true
2025-05-30 10:03:32 +08:00
try {
2025-06-23 10:22:08 +08:00
let res = await moveStock(this.pkObj)
2025-05-30 10:03:32 +08:00
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
2025-06-23 10:22:08 +08:00
this.pkId = ''
this.pkObj = {}
this.dataList = []
2025-05-30 10:03:32 +08:00
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.index1 = ''
this.index2 = ''
this.options2 = []
this.upL = ''
this.upR = ''
this.lowL = ''
this.lowR = ''
this.disabled = false
},
async _showPapervehicleView () {
2025-07-01 14:47:32 +08:00
let res = await showPapervehicleView(this.index1, this.index2, this.val1)
2025-05-30 10:03:32 +08:00
if (res) {
2025-06-23 10:22:08 +08:00
this.dataList = [...res.rows]
2025-05-30 10:03:32 +08:00
}
}
}
}
2025-05-30 17:36:59 +08:00
</script>
<style>
.custom-input {
border: 1px solid #ccc;
border-radius: 4px;
/* padding: 8px 12px; */
font-size: 16px;
width: 100%;
height: 30px;
line-height: 30px;
}
</style>