优化
This commit is contained in:
@@ -28,13 +28,45 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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>
|
||||||
<view class="zd-row submit-bar">
|
<view class="zd-row submit-bar">
|
||||||
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
<!-- <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-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-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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -40,9 +40,9 @@
|
|||||||
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
<!-- <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" @tap="searchList">查询</button>
|
||||||
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</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-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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -55,9 +55,9 @@
|
|||||||
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
<!-- <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" @tap="searchList">查询</button>
|
||||||
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</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-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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {messageConfirm} from '@/utils/getData4.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -75,7 +76,9 @@
|
|||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initWebSocket()
|
if (this.$store.getters.saveIssend == '2') {
|
||||||
|
this.initWebSocket()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initWebSocket() {
|
initWebSocket() {
|
||||||
@@ -128,11 +131,19 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleWebSocketMessage(res) {
|
handleWebSocketMessage(res) {
|
||||||
console.log(res, 'res')
|
// console.log(res, 'res')
|
||||||
console.log(res.msg.data, 'res.msg.data')
|
console.log(res.msg.data, 'res.msg.data')
|
||||||
uni.showToast({
|
uni.showModal({
|
||||||
title: res.msg.data,
|
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()
|
this.initWebSocket()
|
||||||
}, 5000) // 5秒后重连
|
}, 5000) // 5秒后重连
|
||||||
},
|
},
|
||||||
|
async _messageConfirm (type) {
|
||||||
|
try {
|
||||||
|
let res = await messageConfirm(type)
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
},
|
||||||
toPage1 (e) {
|
toPage1 (e) {
|
||||||
if (e.sonTree.length > 0) {
|
if (e.sonTree.length > 0) {
|
||||||
this.show = true
|
this.show = true
|
||||||
|
|||||||
@@ -97,6 +97,7 @@
|
|||||||
}
|
}
|
||||||
this.$store.dispatch('saveUserInfo', JSON.stringify(res.data.user))
|
this.$store.dispatch('saveUserInfo', JSON.stringify(res.data.user))
|
||||||
this.$store.dispatch('saveToken', res.data.token)
|
this.$store.dispatch('saveToken', res.data.token)
|
||||||
|
this.$store.dispatch('saveIssend', res.data.is_send)
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/home/home'
|
url: '/pages/home/home'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ export const handLogin = (user, password) => request({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 1.2推送确认
|
||||||
|
export const messageConfirm = (type) => request({
|
||||||
|
url:'api/hand/messageConfirm',
|
||||||
|
data: {type: type}
|
||||||
|
})
|
||||||
|
|
||||||
// 公共接口
|
// 公共接口
|
||||||
|
|
||||||
// 产线叫料
|
// 产线叫料
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ const state = {
|
|||||||
setPrintName: uni.getStorageSync('setPrintName') || '',
|
setPrintName: uni.getStorageSync('setPrintName') || '',
|
||||||
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
||||||
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
||||||
saveToken: uni.getStorageSync('saveToken') || ''
|
saveToken: uni.getStorageSync('saveToken') || '',
|
||||||
|
saveIssend: uni.getStorageSync('saveIssend') || ''
|
||||||
}
|
}
|
||||||
const getters = {
|
const getters = {
|
||||||
baseUrl: state => state.baseUrl,
|
baseUrl: state => state.baseUrl,
|
||||||
@@ -21,7 +22,8 @@ const getters = {
|
|||||||
setPrintName: state => state.setPrintName,
|
setPrintName: state => state.setPrintName,
|
||||||
loginName: state => state.loginName,
|
loginName: state => state.loginName,
|
||||||
userInfo: state => state.userInfo,
|
userInfo: state => state.userInfo,
|
||||||
saveToken: state => state.saveToken
|
saveToken: state => state.saveToken,
|
||||||
|
saveIssend: state => state.saveIssend
|
||||||
}
|
}
|
||||||
const actions = {
|
const actions = {
|
||||||
setConfig ({commit}, res) {
|
setConfig ({commit}, res) {
|
||||||
@@ -47,11 +49,16 @@ const actions = {
|
|||||||
delUserInfo({commit}, res) {
|
delUserInfo({commit}, res) {
|
||||||
uni.removeStorageSync('userInfo')
|
uni.removeStorageSync('userInfo')
|
||||||
uni.removeStorageSync('saveToken')
|
uni.removeStorageSync('saveToken')
|
||||||
|
uni.removeStorageSync('saveIssend')
|
||||||
commit(types.DEL_USER_INFO, res)
|
commit(types.DEL_USER_INFO, res)
|
||||||
},
|
},
|
||||||
saveToken({commit}, res) {
|
saveToken({commit}, res) {
|
||||||
uni.setStorageSync('saveToken', res)
|
uni.setStorageSync('saveToken', res)
|
||||||
commit(types.SAVE_TOKEN, res)
|
commit(types.SAVE_TOKEN, res)
|
||||||
|
},
|
||||||
|
saveIssend({commit}, res) {
|
||||||
|
uni.setStorageSync('saveIssend', res)
|
||||||
|
commit(types.SAVE_ISSEND, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@@ -74,9 +81,13 @@ const mutations = {
|
|||||||
[types.DEL_USER_INFO] (state, res) {
|
[types.DEL_USER_INFO] (state, res) {
|
||||||
state.userInfo = res
|
state.userInfo = res
|
||||||
state.saveToken = res
|
state.saveToken = res
|
||||||
|
state.saveIssend = res
|
||||||
},
|
},
|
||||||
[types.SAVE_TOKEN] (state, res) {
|
[types.SAVE_TOKEN] (state, res) {
|
||||||
state.saveToken = res
|
state.saveToken = res
|
||||||
|
},
|
||||||
|
[types.SAVE_ISSEND] (state, res) {
|
||||||
|
state.saveIssend = res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export const COM_CONFIG = 'COM_CONFIG'
|
|||||||
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
|
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
|
||||||
export const DEL_USER_INFO = 'DEL_USER_INFO'
|
export const DEL_USER_INFO = 'DEL_USER_INFO'
|
||||||
export const SAVE_TOKEN = 'SAVE_TOKEN'
|
export const SAVE_TOKEN = 'SAVE_TOKEN'
|
||||||
|
export const SAVE_ISSEND = 'SAVE_ISSEND'
|
||||||
/**
|
/**
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user