This commit is contained in:
2026-01-04 15:33:01 +08:00
parent 245f3c07b8
commit d661432ab1
8 changed files with 84 additions and 12 deletions

View File

@@ -28,13 +28,45 @@
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<!-- <th>序号</th>
<th>卷号</th>
<th>物料编码</th>
<th>物料品种</th>
<th>数量</th>
<th>单位</th> -->
<th>{{$t('grid.number')}}</th>
<th>{{$t('grid.roll-number')}}</th>
<th>{{$t('grid.material-code')}}</th>
<th>{{$t('grid.material-name')}}</th>
<th>{{$t('grid.quantity')}}</th>
<th>{{$t('grid.unit')}}</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.container_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.qty}}</td>
<td>{{e.measure_unit_id}}</td>
</tr>
</tbody>
</table>
</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 || !val2}" :disabled="disabled" @tap="_materialTransfer">确认</button> -->
<button class="zd-col-8 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
<button class="zd-col-7 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm')}}</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm')}}</button>
</view>
</view>
</template>

View File

@@ -40,9 +40,9 @@
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-8 button-primary" @tap="searchList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button> -->
<button class="zd-col-8 button-default" @tap="toEmpty">{{$t('button.clear')}}</button>
<button class="zd-col-7 button-default" @tap="toEmpty">{{$t('button.clear')}}</button>
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" @tap="toSure">{{$t('button.confirm')}}</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">{{$t('button.confirm')}}</button>
</view>
</view>
</template>

View File

@@ -55,9 +55,9 @@
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-8 button-primary" @tap="searchList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button> -->
<button class="zd-col-8 button-default" @tap="toEmpty">{{$t('button.clear')}}</button>
<button class="zd-col-7 button-default" @tap="toEmpty">{{$t('button.clear')}}</button>
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" @tap="toSure">{{$t('button.confirm')}}</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">{{$t('button.confirm')}}</button>
</view>
</view>
</template>

View File

@@ -37,6 +37,7 @@
</template>
<script>
import {messageConfirm} from '@/utils/getData4.js'
export default {
data() {
return {
@@ -75,7 +76,9 @@
// }
// },
mounted() {
this.initWebSocket()
if (this.$store.getters.saveIssend == '2') {
this.initWebSocket()
}
},
methods: {
initWebSocket() {
@@ -128,11 +131,19 @@
},
handleWebSocketMessage(res) {
console.log(res, 'res')
// console.log(res, 'res')
console.log(res.msg.data, 'res.msg.data')
uni.showToast({
uni.showModal({
title: res.msg.data,
icon: 'none'
cancelText: '关闭',
confirmText: '稍后提醒',
success: res => {
if (res.confirm) {
this._messageConfirm('1')
} else if (res.cancel) {
this._messageConfirm('2')
}
}
})
},
@@ -156,6 +167,16 @@
this.initWebSocket()
}, 5000) // 5秒后重连
},
async _messageConfirm (type) {
try {
let res = await messageConfirm(type)
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
}
},
toPage1 (e) {
if (e.sonTree.length > 0) {
this.show = true

View File

@@ -97,6 +97,7 @@
}
this.$store.dispatch('saveUserInfo', JSON.stringify(res.data.user))
this.$store.dispatch('saveToken', res.data.token)
this.$store.dispatch('saveIssend', res.data.is_send)
uni.redirectTo({
url: '/pages/home/home'
})

View File

@@ -21,6 +21,12 @@ export const handLogin = (user, password) => request({
}
})
// 1.2推送确认
export const messageConfirm = (type) => request({
url:'api/hand/messageConfirm',
data: {type: type}
})
// 公共接口
// 产线叫料

View File

@@ -11,7 +11,8 @@ const state = {
setPrintName: uni.getStorageSync('setPrintName') || '',
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
saveToken: uni.getStorageSync('saveToken') || ''
saveToken: uni.getStorageSync('saveToken') || '',
saveIssend: uni.getStorageSync('saveIssend') || ''
}
const getters = {
baseUrl: state => state.baseUrl,
@@ -21,7 +22,8 @@ const getters = {
setPrintName: state => state.setPrintName,
loginName: state => state.loginName,
userInfo: state => state.userInfo,
saveToken: state => state.saveToken
saveToken: state => state.saveToken,
saveIssend: state => state.saveIssend
}
const actions = {
setConfig ({commit}, res) {
@@ -47,11 +49,16 @@ const actions = {
delUserInfo({commit}, res) {
uni.removeStorageSync('userInfo')
uni.removeStorageSync('saveToken')
uni.removeStorageSync('saveIssend')
commit(types.DEL_USER_INFO, res)
},
saveToken({commit}, res) {
uni.setStorageSync('saveToken', res)
commit(types.SAVE_TOKEN, res)
},
saveIssend({commit}, res) {
uni.setStorageSync('saveIssend', res)
commit(types.SAVE_ISSEND, res)
}
}
const mutations = {
@@ -74,9 +81,13 @@ const mutations = {
[types.DEL_USER_INFO] (state, res) {
state.userInfo = res
state.saveToken = res
state.saveIssend = res
},
[types.SAVE_TOKEN] (state, res) {
state.saveToken = res
},
[types.SAVE_ISSEND] (state, res) {
state.saveIssend = res
}
}

View File

@@ -7,6 +7,7 @@ export const COM_CONFIG = 'COM_CONFIG'
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
export const DEL_USER_INFO = 'DEL_USER_INFO'
export const SAVE_TOKEN = 'SAVE_TOKEN'
export const SAVE_ISSEND = 'SAVE_ISSEND'
/**
* data
*/