接口
This commit is contained in:
@@ -419,6 +419,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
,{
|
||||||
|
"path" : "pages/hdyy/tygn/supplier",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
}
|
||||||
,{
|
,{
|
||||||
"path" : "pages/hdyy/wrcdj/wrc-load",
|
"path" : "pages/hdyy/wrcdj/wrc-load",
|
||||||
"style" :
|
"style" :
|
||||||
|
|||||||
@@ -201,10 +201,8 @@
|
|||||||
})
|
})
|
||||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.dataList = []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChange (e) {
|
handleChange (e) {
|
||||||
|
|||||||
@@ -168,10 +168,8 @@
|
|||||||
}
|
}
|
||||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.dataList = []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async _confirmPalletAssemblyIn () {
|
async _confirmPalletAssemblyIn () {
|
||||||
|
|||||||
@@ -189,10 +189,8 @@
|
|||||||
})
|
})
|
||||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.dataList = []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async _directlyOutConfirm () {
|
async _directlyOutConfirm () {
|
||||||
|
|||||||
94
pages/hdyy/tygn/supplier.vue
Normal file
94
pages/hdyy/tygn/supplier.vue
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<view class="zd_container">
|
||||||
|
<!-- 供应商维护 -->
|
||||||
|
<nav-bar :title="title" :inner="true"></nav-bar>
|
||||||
|
<view class="zd_content">
|
||||||
|
<view class="zd_wrapper">
|
||||||
|
<view class="zd-row border-bottom">
|
||||||
|
<view class="zd-col-5">
|
||||||
|
<span class="filter_label">关键字</span>
|
||||||
|
</view>
|
||||||
|
<view class="zd-col-14">
|
||||||
|
<input type="text" placeholder="输入供应商关键字" class="filter_input" v-model="keyword" @focus="handleFocus">
|
||||||
|
</view>
|
||||||
|
<button class="mini-btn" type="primary" @tap="_querySupp">查询</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zd_wrapper grid-wraper">
|
||||||
|
<view class="slide_new">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>供应商编码</th>
|
||||||
|
<th>供应商名称</th>
|
||||||
|
<th>备注</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.supp_code === pkId}" @tap="toCheck(e)">
|
||||||
|
<td>{{e.supp_code}}</td>
|
||||||
|
<td>{{e.supp_name}}</td>
|
||||||
|
<td>{{e.remark}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zd-row submit-bar">
|
||||||
|
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import NavBar from '@/components/NavBar.vue'
|
||||||
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
|
import {querySupp} from '@/utils/getData3.js'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
NavBar,
|
||||||
|
SearchBox
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '',
|
||||||
|
keyword: null,
|
||||||
|
dataList: [],
|
||||||
|
pkId: '',
|
||||||
|
pkObj: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad (options) {
|
||||||
|
this.title = options.title
|
||||||
|
this._querySupp()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleFocus () {
|
||||||
|
this.keyword = null
|
||||||
|
},
|
||||||
|
async _querySupp () {
|
||||||
|
try {
|
||||||
|
let res = await querySupp(this.keyword)
|
||||||
|
if (res && res.data.length > 0) {
|
||||||
|
this.dataList = [...res.data]
|
||||||
|
} else {
|
||||||
|
this.dataList = []
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.dataList = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toCheck (e) {
|
||||||
|
this.pkId = this.pkId === e.supp_code ? '' : e.supp_code
|
||||||
|
this.pkObj = this.pkId === e.supp_code ? e : {}
|
||||||
|
},
|
||||||
|
toSure () {
|
||||||
|
if (this.pkId) {
|
||||||
|
this.$store.dispatch('setFormData', this.pkObj)
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<view class="zd-col-13">
|
<view class="zd-col-13">
|
||||||
<search-box v-model="suppData.supp_code"/>
|
<search-box v-model="suppData.supp_code"/>
|
||||||
</view>
|
</view>
|
||||||
<button class="mini-btn" type="primary" @tap="toJump('supplier?title=供应商维护')">查询</button>
|
<button class="mini-btn" type="primary" @tap="toJump2('supplier?title=供应商维护')">查询</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-row border-bottom">
|
<view class="zd-row border-bottom">
|
||||||
<view class="zd-col-6">
|
<view class="zd-col-6">
|
||||||
@@ -140,6 +140,11 @@
|
|||||||
url: `/pages/hdyy/wbc/${name}`
|
url: `/pages/hdyy/wbc/${name}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
toJump2 (name) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hdyy/tygn/${name}`
|
||||||
|
})
|
||||||
|
},
|
||||||
toEmpty () {
|
toEmpty () {
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
this.index1 = ''
|
this.index1 = ''
|
||||||
|
|||||||
@@ -14,6 +14,16 @@
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="zd-row border-bottom">
|
||||||
|
<view class="zd-col-7">
|
||||||
|
<span class="filter_label">袋码</span>
|
||||||
|
</view>
|
||||||
|
<view class="zd-col-24 filter_select">
|
||||||
|
<search-box
|
||||||
|
v-model="bagCode"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="zd-row">
|
<view class="zd-row">
|
||||||
<button class="zd-col-11 button-primary ftsize1" @tap="toScanAdd">扫码插入</button>
|
<button class="zd-col-11 button-primary ftsize1" @tap="toScanAdd">扫码插入</button>
|
||||||
<button class="zd-col-11 button-primary ftsize1" @tap="toDel">删除行</button>
|
<button class="zd-col-11 button-primary ftsize1" @tap="toDel">删除行</button>
|
||||||
@@ -36,7 +46,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(e, i) in dataList" :key="i">
|
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.bag_code === pkId}" @tap="toCheck(e)">
|
||||||
<td>{{i+1}}</td>
|
<td>{{i+1}}</td>
|
||||||
<td>{{e.bag_code}}</td>
|
<td>{{e.bag_code}}</td>
|
||||||
<td>{{e.material_code}}</td>
|
<td>{{e.material_code}}</td>
|
||||||
@@ -72,6 +82,9 @@
|
|||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
val1: '',
|
val1: '',
|
||||||
|
bagCode: '',
|
||||||
|
pkId: '',
|
||||||
|
pkObj: {},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||||
disabled: false
|
disabled: false
|
||||||
@@ -82,71 +95,32 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toScanAdd () {
|
toScanAdd () {
|
||||||
uni.scanCode({
|
if (this.bagCode) {
|
||||||
success: (res) => {
|
this._getBagAssembly2(this.bagCode)
|
||||||
// console.log('扫码成功:', res.result);
|
|
||||||
if (res.result.includes(';')) {
|
|
||||||
const parts = res.result.split(';')
|
|
||||||
if (parts.length !== 5) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '二维码格式不正确,请扫描符合格式的二维码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
let currObj = {
|
// uni.scanCode({
|
||||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
// success: (res) => {
|
||||||
container_code: parts[0],
|
// // console.log('扫码成功:', res.result);
|
||||||
material_code: parts[1],
|
// this._getPalletAssembly(res.result)
|
||||||
material_name: parts[2],
|
// },
|
||||||
qty: parts[3],
|
// fail: (err) => {
|
||||||
measure_unit_id: parts[4],
|
// console.log('扫码失败:', err)
|
||||||
}
|
// // uni.showToast({
|
||||||
// 检查是否已存在相同卷号
|
// // title: err + '扫码失败',
|
||||||
const exists = this.dataList.some(item => item.container_code === currObj.container_code)
|
// // icon: 'none'
|
||||||
if (exists) {
|
// // })
|
||||||
uni.showToast({
|
// }
|
||||||
title: '已存在',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.dataList.push(currObj)
|
|
||||||
} else {
|
|
||||||
let currObj = {
|
|
||||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
|
||||||
container_code: res.result,
|
|
||||||
material_code: '',
|
|
||||||
material_name: '',
|
|
||||||
qty: '',
|
|
||||||
measure_unit_id: ''
|
|
||||||
}
|
|
||||||
// 检查是否已存在相同卷号
|
|
||||||
const exists = this.dataList.some(item => item.container_code === currObj.container_code)
|
|
||||||
if (exists) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '已存在',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.dataList.push(currObj)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.log('扫码失败:', err)
|
|
||||||
// uni.showToast({
|
|
||||||
// title: err + '扫码失败',
|
|
||||||
// icon: 'none'
|
|
||||||
// })
|
// })
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
toDel () {
|
toDel () {
|
||||||
if (!this.pkId) {
|
if (!this.pkId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dataList = this.dataList.filter(item => item.mid !== this.pkObj.mid)
|
this.dataList = this.dataList.filter(item => item.bag_code !== this.pkObj.bag_code)
|
||||||
|
},
|
||||||
|
toCheck (e) {
|
||||||
|
this.pkId = this.pkId === e.bag_code ? '' : e.bag_code
|
||||||
|
this.pkObj = this.pkId === e.bag_code ? e : {}
|
||||||
},
|
},
|
||||||
toEmpty () {
|
toEmpty () {
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
@@ -165,6 +139,24 @@
|
|||||||
this.dataList = []
|
this.dataList = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async _getBagAssembly2 () {
|
||||||
|
try {
|
||||||
|
let res = await getBagAssembly(this.bagCode)
|
||||||
|
if (res) {
|
||||||
|
const existingItem = this.dataList.find(item => item.bag_code === res.data.bag_code)
|
||||||
|
if (existingItem) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '袋码已存在,不能重复插入',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.dataList.push(res.data)
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
},
|
||||||
async _confirmPalletAssembly () {
|
async _confirmPalletAssembly () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.val1 || !this.dataList.length) {
|
if (!this.val1 || !this.dataList.length) {
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ export const queryRegionDropdown = (rcode) => request({
|
|||||||
url:'api/pda/publicInterface/queryRegionDropdown',
|
url:'api/pda/publicInterface/queryRegionDropdown',
|
||||||
data: {region_code: rcode}
|
data: {region_code: rcode}
|
||||||
})
|
})
|
||||||
|
// 查询供应商
|
||||||
|
export const querySupp = (supcode) => request({
|
||||||
|
url:'api/pda/publicInterface/querySupp',
|
||||||
|
data: {supp_code: supcode}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外包材收货(外包材管理)
|
* 外包材收货(外包材管理)
|
||||||
@@ -297,7 +301,7 @@ export const getBucketGroupInfo = (mid, pcsn) => request({
|
|||||||
})
|
})
|
||||||
// 确认叫料
|
// 确认叫料
|
||||||
export const confirmCallBucketMaterial = (pcode, rows) => request({
|
export const confirmCallBucketMaterial = (pcode, rows) => request({
|
||||||
url:'/api/pdaProduction/confirmCallBucketMaterial',
|
url:'api/pdaProduction/confirmCallBucketMaterial',
|
||||||
data: {point_code: pcode, rows: rows}
|
data: {point_code: pcode, rows: rows}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -357,12 +361,12 @@ export const forceConfirmTask = (obj) => request({
|
|||||||
// 库存查询(通用功能)共 (2) 个
|
// 库存查询(通用功能)共 (2) 个
|
||||||
// 查询物料维护信息
|
// 查询物料维护信息
|
||||||
export const queryMaterial = (search) => request({
|
export const queryMaterial = (search) => request({
|
||||||
url:'/api/queryIvt/queryMaterial',
|
url:'api/queryIvt/queryMaterial',
|
||||||
data: {search: search}
|
data: {search: search}
|
||||||
})
|
})
|
||||||
// 主页面库存查询
|
// 主页面库存查询
|
||||||
export const queryIvt = (scode, pcode, mcode, pcsn) => request({
|
export const queryIvt = (scode, pcode, mcode, pcsn) => request({
|
||||||
url:'/api/queryIvt/queryIvt',
|
url:'api/queryIvt/queryIvt',
|
||||||
data: {sect_code: scode, point_code: pcode, material_code: mcode, pcsn: pcsn}
|
data: {sect_code: scode, point_code: pcode, material_code: mcode, pcsn: pcsn}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user