点位设置

This commit is contained in:
2025-09-10 17:16:34 +08:00
parent 6cd801410e
commit ebfcbdd82f
2 changed files with 92 additions and 9 deletions

View File

@@ -14,19 +14,43 @@
/>
</view>
</view>
<view class="zd-row border-bottom">
<!-- <view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位属性</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view> -->
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>点位</th>
<th>属性</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, i) in dataList" :key="i">
<td>{{item.point_code}}</td>
<td><span class="span1" :class="{'hightlight': item.point_type === '1'}" @tap="setpoint_type(item, '1')">入库点</span><span class="span1" :class="{'hightlight': item.point_type === '2'}" @tap="setpoint_type(item, '2')">出库点</span></td>
<!-- <uni-data-select
v-model="item.point_type"
:localdata="options"
@change="handleTypeChange(item, $event)">
</uni-data-select> -->
</tr>
</tbody>
</table>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_updatePointType">确认</button>
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
<button class="zd-col-7 button-primary" @tap="seachList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="_updatepoint_type">确认</button>
</view>
</view>
</template>
@@ -34,7 +58,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {updatePointType} from '@/utils/getData4.js'
import {getInBillPointList, updatepoint_type} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -46,6 +70,12 @@
val1: '',
options: [{text:'入库点', value:'1'},{text:'出库点',value: '2'}],
index: '',
dataList: [
{ point_code: 'P-1001', point_type: '2' },
{ point_code: 'P-1002', point_type: '1' },
{ point_code: 'P-1003', point_type: '2' },
{ point_code: 'P-1004', point_type: '2' }
],
disabled: false
};
},
@@ -53,24 +83,55 @@
this.title = options.title
},
created () {
// this.seachList()
},
methods: {
seachList () {
this.dataList = []
this._getInBillPointList()
},
handleTypeChange (e, item) {
console.log(item, 666)
console.log(e, 222)
this.dataList.map((el) => {
if (el === e) {
el.point_type = e.point_type
}
})
},
selectChange (e) {
this.index = e
},
clearUp () {
this.val1 = ''
this.index = ''
this.dataList = []
this.disabled = false
},
async _updatePointType () {
setpoint_type(item, type) {
// 如果已经是当前类型,则不执行操作
if (item.point_type === type) return;
// 更新UI
item.point_type = type;
this.dataList.map((el) => {
if (el === item) {
el.point_type = type
}
})
},
async _getInBillPointList () {
let res = await getInBillPointList(this.val1)
if (res.code === '200') {
this.dataList = res.data
}
},
async _updatepoint_type () {
this.disabled = true
if (!this.val1 || !this.index) {
if (!dataList.length) {
this.disabled = false
return
}
try {
let res = await updatePointType(this.val1, this.index)
let res = await updatepoint_type(this.dataList)
if (res.code === '200') {
uni.showToast({
title: res.message,
@@ -93,5 +154,22 @@
</script>
<style lang="stylus">
.slide_new table td {
font-size: 17px;
line-height: 62px;
color: #323232;
text-align: center;
box-sizing: border-box;
overflow: none;
white-space: none;
text-overflow: none;
white-space: none;
padding: 0 12px;
background: #fff;
}
.span1
display inline-block
width 50%
.hightlight
color orange
</style>

View File

@@ -298,6 +298,11 @@ export const updatePointType = (code, type) => request({
url:'api/schBasePoint/updatePointType',
data: {point_code: code, point_type: type}
})
// 查询入库点位清单
export const getInBillPointList = (code) => request({
url:'api/schBasePoint/getInBillPointList',
data: {point_code: code}
})
// 组盘入库
// 物料组盘(带单据)