判断
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
</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-8 button-primary" @tap="searchList">查询</button>
|
<button class="zd-col-6 button-primary" @tap="searchList">查询</button>
|
||||||
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled" @tap="_lock">锁定</button>
|
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled" @tap="_lock">锁定</button>
|
||||||
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled2" @tap="_unlock">解锁</button>
|
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled2" @tap="_unlock">解锁</button>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -26,13 +26,13 @@
|
|||||||
<view class="zd-col-11">
|
<view class="zd-col-11">
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-4">
|
<view class="zd-col-4">
|
||||||
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">插入行</button>
|
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="toAdd">插入行</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-4">
|
<view class="zd-col-4">
|
||||||
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">删除行</button>
|
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="toDel">删除行</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-4">
|
<view class="zd-col-4">
|
||||||
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">复制行</button>
|
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="toCopy">复制行</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -50,24 +50,23 @@
|
|||||||
</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.mid === pkId}">
|
||||||
<td>{{i+1}}</td>
|
<td @tap="toCheck(e)">{{i+1}}</td>
|
||||||
<td>{{e.task_code}}</td>
|
<td><input type="text" class="sin_input" v-model="e.container_code"></td>
|
||||||
<td>{{e.vehicle_code}}</td>
|
<td @tap="toJump(e)">{{e.material_name}}</td>
|
||||||
<td>{{e.status}}</td>
|
<td><input type="text" class="sin_input" v-model="e.pscn"></td>
|
||||||
<td>{{e.point_code1}}</td>
|
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></td>
|
||||||
<td>{{e.point_code2}}</td>
|
<td>{{e.measure_unit_id}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
|
|
||||||
</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-11 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">物料绑定</button> -->
|
<!-- <button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !dataList.length || !index}" :disabled="disabled" @tap="_blanking">确认下料</button> -->
|
||||||
<button class="zd-col-22 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">确认下料</button>
|
<button class="zd-col-22 button-primary" :class="{'button-info': !val1 || !dataList.length || !index}" :disabled="disabled" @tap="_blanking">确认下料</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -75,7 +74,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {getSect, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
|
import {getRegions, selectMaterials, blanking} from '@/utils/getData4.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -86,6 +85,9 @@
|
|||||||
title: '',
|
title: '',
|
||||||
val1: '',
|
val1: '',
|
||||||
dataList: [],
|
dataList: [],
|
||||||
|
pkId: '',
|
||||||
|
pkObj: {},
|
||||||
|
currentData: {},
|
||||||
options: [],
|
options: [],
|
||||||
index: '',
|
index: '',
|
||||||
reload: false,
|
reload: false,
|
||||||
@@ -104,13 +106,25 @@
|
|||||||
onLoad (options) {
|
onLoad (options) {
|
||||||
this.title = options.title
|
this.title = options.title
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
if (this.$store.getters.publicObj !== '') {
|
||||||
|
this.currentData = this.$store.getters.publicObj
|
||||||
|
this.pkId = ''
|
||||||
|
this.dataList.map((item) => {
|
||||||
|
if (this.pkObj.mid === item.mid) {
|
||||||
|
item.material_name = this.currentData.material_name
|
||||||
|
item.measure_unit_id = this.currentData.measure_unit_id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
created () {
|
created () {
|
||||||
this._getSect()
|
this._getRegions1()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async _getSect () {
|
async _getRegions1 () {
|
||||||
try {
|
try {
|
||||||
let res = await getSect()
|
let res = await getRegions()
|
||||||
if (res) {
|
if (res) {
|
||||||
this.options = res
|
this.options = res
|
||||||
} else {
|
} else {
|
||||||
@@ -123,63 +137,111 @@
|
|||||||
selectChange (e) {
|
selectChange (e) {
|
||||||
this.index = e
|
this.index = e
|
||||||
},
|
},
|
||||||
handleAdd () {
|
toCheck (e) {
|
||||||
if (!this.val1) {
|
this.pkId = this.pkId === e.mid ? '' : e.mid
|
||||||
|
this.pkObj = this.pkId === e.mid ? e : {}
|
||||||
|
},
|
||||||
|
handleBlur (e) {
|
||||||
|
if (e.qty) {
|
||||||
|
if (e.qty < 0) {
|
||||||
|
e.qty = 0
|
||||||
|
} else {
|
||||||
|
e.qty = e.qty.replace(/[^0-9]/g, '')
|
||||||
|
e.qty = e.qty.replace(/^0+/, '') || '0'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '数量必填',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toJump (e) {
|
||||||
|
this.pkId = this.pkId === e.mid ? '' : e.mid
|
||||||
|
this.pkObj = this.pkId === e.mid ? e : {}
|
||||||
|
this.pkId = ''
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/ftdl/mater-list0?title=查询物料'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toAdd () {
|
||||||
|
let currObj = {
|
||||||
|
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||||
|
container_code: '',
|
||||||
|
material_name: '物料',
|
||||||
|
pscn: '',
|
||||||
|
qty: '1',
|
||||||
|
measure_unit_id: '单位'
|
||||||
|
}
|
||||||
|
this.dataList.push(currObj)
|
||||||
|
},
|
||||||
|
toDel () {
|
||||||
|
if (!this.pkId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dataList.push({vehicle_code: this.val1, site_code: this.val1})
|
this.dataList = this.dataList.filter(item => item.mid !== this.pkObj.mid)
|
||||||
this.dataList.map(el => {
|
},
|
||||||
this.$set(el, 'checked', false)
|
toCopy () {
|
||||||
})
|
if (!this.pkId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// let original = this.dataList.find(item => item.mid === this.pkObj.mid)
|
||||||
|
const copy = JSON.parse(JSON.stringify(this.pkObj))
|
||||||
|
// 更新mid为新生成的唯一值
|
||||||
|
copy.mid = 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9)
|
||||||
|
// 添加到原数组
|
||||||
|
this.dataList.push(copy)
|
||||||
|
this.pkId = ''
|
||||||
},
|
},
|
||||||
clearUp () {
|
clearUp () {
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
|
this.index = ''
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
},
|
},
|
||||||
searchList () {
|
searchList () {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.pageNum = 1
|
this.pageNum = 1
|
||||||
this._schBaseTask()
|
this._selectMaterials()
|
||||||
},
|
},
|
||||||
async _schBaseTask () {
|
async _selectMaterials () {
|
||||||
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.val1)
|
let res = await selectMaterials(this.val1)
|
||||||
if (res.code === '200') {
|
this.dataList = res.data
|
||||||
this.totalCount = res.totalElements
|
// this.totalCount = res.totalElements
|
||||||
if (res.totalElements > 0) {
|
// if (res.totalElements > 0) {
|
||||||
const dataMap = res.content
|
// const dataMap = res.data
|
||||||
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||||
this.reload = false
|
// this.reload = false
|
||||||
} else {
|
// } else {
|
||||||
this.dataList = []
|
// this.dataList = []
|
||||||
}
|
// }
|
||||||
if (this.totalCount == this.dataList.length) {
|
// if (this.totalCount == this.dataList.length) {
|
||||||
this.reload = false
|
// this.reload = false
|
||||||
this.status = 'noMore'
|
// this.status = 'noMore'
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onReachBottom () {
|
onReachBottom () {
|
||||||
if (this.totalCount > this.dataList.length) {
|
if (this.totalCount > this.dataList.length) {
|
||||||
this.status = 'loading'
|
this.status = 'loading'
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this._schBaseTask()
|
this._selectMaterials()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
} else { //停止加载
|
} else { //停止加载
|
||||||
this.status = 'noMore'
|
this.status = 'noMore'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async toSure (status) {
|
async _blanking () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.dataList.length) {
|
if (!this.val1 || !this.dataList.length || !this.index) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await saveCheckTask(this.dataList)
|
let res = await blanking(this.val1, this.dataList, this.index)
|
||||||
if (res.code === '200') {
|
if (res.code === '200') {
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
|
this.index = ''
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.desc,
|
title: res.desc,
|
||||||
@@ -198,4 +260,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="stylus">
|
||||||
|
.checked
|
||||||
|
background #ff0
|
||||||
|
</style>
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
<view class="zd-col-11">
|
<view class="zd-col-11">
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-4">
|
<view class="zd-col-4">
|
||||||
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">插入行</button>
|
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="toAdd">插入行</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-4">
|
<view class="zd-col-4">
|
||||||
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">删除行</button>
|
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="toDel">删除行</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-4">
|
<view class="zd-col-4">
|
||||||
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">复制行</button>
|
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="toCopy">复制行</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -42,24 +42,23 @@
|
|||||||
</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.mid === pkId}">
|
||||||
<td>{{i+1}}</td>
|
<td @tap="toCheck(e)">{{i+1}}</td>
|
||||||
<td>{{e.task_code}}</td>
|
<td><input type="text" class="sin_input" v-model="e.container_code"></td>
|
||||||
<td>{{e.vehicle_code}}</td>
|
<td @tap="toJump(e)">{{e.material_name}}</td>
|
||||||
<td>{{e.status}}</td>
|
<td><input type="text" class="sin_input" v-model="e.pscn"></td>
|
||||||
<td>{{e.point_code1}}</td>
|
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></td>
|
||||||
<td>{{e.point_code2}}</td>
|
<td>{{e.measure_unit_id}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
|
|
||||||
</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-11 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">物料绑定</button>
|
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_materialBinding">物料绑定</button>
|
||||||
<button class="zd-col-11 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">空载具绑定</button>
|
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled2" @tap="_vehicleBinding">空载具绑定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -67,7 +66,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {schBaseTask, saveCheckTask} from '@/utils/getData2.js'
|
import {selectMaterials, materialBinding, vehicleBinding} from '@/utils/getData4.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -78,6 +77,9 @@
|
|||||||
title: '',
|
title: '',
|
||||||
val1: '',
|
val1: '',
|
||||||
dataList: [],
|
dataList: [],
|
||||||
|
pkId: '',
|
||||||
|
pkObj: {},
|
||||||
|
currentData: {},
|
||||||
reload: false,
|
reload: false,
|
||||||
status: 'more',
|
status: 'more',
|
||||||
contentText: {
|
contentText: {
|
||||||
@@ -88,68 +90,128 @@
|
|||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
disabled: false
|
disabled: false,
|
||||||
|
disabled2: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad (options) {
|
onLoad (options) {
|
||||||
this.title = options.title
|
this.title = options.title
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
if (this.$store.getters.publicObj !== '') {
|
||||||
|
this.currentData = this.$store.getters.publicObj
|
||||||
|
this.pkId = ''
|
||||||
|
this.dataList.map((item) => {
|
||||||
|
if (this.pkObj.mid === item.mid) {
|
||||||
|
item.material_name = this.currentData.material_name
|
||||||
|
item.measure_unit_id = this.currentData.measure_unit_id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAdd () {
|
toCheck (e) {
|
||||||
if (!this.val1) {
|
this.pkId = this.pkId === e.mid ? '' : e.mid
|
||||||
|
this.pkObj = this.pkId === e.mid ? e : {}
|
||||||
|
},
|
||||||
|
handleBlur (e) {
|
||||||
|
if (e.qty) {
|
||||||
|
if (e.qty < 0) {
|
||||||
|
e.qty = 0
|
||||||
|
} else {
|
||||||
|
e.qty = e.qty.replace(/[^0-9]/g, '')
|
||||||
|
e.qty = e.qty.replace(/^0+/, '') || '0'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '数量必填',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toJump (e) {
|
||||||
|
this.pkId = this.pkId === e.mid ? '' : e.mid
|
||||||
|
this.pkObj = this.pkId === e.mid ? e : {}
|
||||||
|
this.pkId = ''
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/ftdl/mater-list0?title=查询物料'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toAdd () {
|
||||||
|
let currObj = {
|
||||||
|
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||||
|
container_code: '',
|
||||||
|
material_name: '物料',
|
||||||
|
pscn: '',
|
||||||
|
qty: '1',
|
||||||
|
measure_unit_id: '单位'
|
||||||
|
}
|
||||||
|
this.dataList.push(currObj)
|
||||||
|
},
|
||||||
|
toDel () {
|
||||||
|
if (!this.pkId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dataList.push({vehicle_code: this.val1, site_code: this.val1})
|
this.dataList = this.dataList.filter(item => item.mid !== this.pkObj.mid)
|
||||||
this.dataList.map(el => {
|
},
|
||||||
this.$set(el, 'checked', false)
|
toCopy () {
|
||||||
})
|
if (!this.pkId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// let original = this.dataList.find(item => item.mid === this.pkObj.mid)
|
||||||
|
const copy = JSON.parse(JSON.stringify(this.pkObj))
|
||||||
|
// 更新mid为新生成的唯一值
|
||||||
|
copy.mid = 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9)
|
||||||
|
// 添加到原数组
|
||||||
|
this.dataList.push(copy)
|
||||||
|
this.pkId = ''
|
||||||
},
|
},
|
||||||
clearUp () {
|
clearUp () {
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
|
this.disabled2 = false
|
||||||
},
|
},
|
||||||
searchList () {
|
searchList () {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.pageNum = 1
|
this.pageNum = 1
|
||||||
this._schBaseTask()
|
this._selectMaterials()
|
||||||
},
|
},
|
||||||
async _schBaseTask () {
|
async _selectMaterials () {
|
||||||
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.val1)
|
let res = await selectMaterials(this.val1)
|
||||||
if (res.code === '200') {
|
this.dataList = res.data
|
||||||
this.totalCount = res.totalElements
|
// this.totalCount = res.totalElements
|
||||||
if (res.totalElements > 0) {
|
// if (res.totalElements > 0) {
|
||||||
const dataMap = res.content
|
// const dataMap = res.data
|
||||||
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||||
this.reload = false
|
// this.reload = false
|
||||||
} else {
|
// } else {
|
||||||
this.dataList = []
|
// this.dataList = []
|
||||||
}
|
// }
|
||||||
if (this.totalCount == this.dataList.length) {
|
// if (this.totalCount == this.dataList.length) {
|
||||||
this.reload = false
|
// this.reload = false
|
||||||
this.status = 'noMore'
|
// this.status = 'noMore'
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onReachBottom () {
|
onReachBottom () {
|
||||||
if (this.totalCount > this.dataList.length) {
|
if (this.totalCount > this.dataList.length) {
|
||||||
this.status = 'loading'
|
this.status = 'loading'
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this._schBaseTask()
|
this._selectMaterials()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
} else { //停止加载
|
} else { //停止加载
|
||||||
this.status = 'noMore'
|
this.status = 'noMore'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async toSure (status) {
|
async _materialBinding () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.dataList.length) {
|
if (!this.val1 || !this.dataList.length) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await saveCheckTask(this.dataList)
|
let res = await materialBinding(this.val1, this.dataList)
|
||||||
if (res.code === '200') {
|
if (res.code === '200') {
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
@@ -167,7 +229,36 @@
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async _vehicleBinding() {
|
||||||
|
this.disabled2 = true
|
||||||
|
if (!this.val1) {
|
||||||
|
this.disabled2 = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let res = await vehicleBinding(this.val1)
|
||||||
|
if (res.code === '200') {
|
||||||
|
this.val1 = ''
|
||||||
|
uni.showToast({
|
||||||
|
title: res.desc,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.desc,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.disabled2 = false
|
||||||
|
} catch (e) {
|
||||||
|
this.disabled2 = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="stylus">
|
||||||
|
.checked
|
||||||
|
background #ff0
|
||||||
|
</style>
|
||||||
@@ -56,12 +56,12 @@
|
|||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
val1: '',
|
val1: '',
|
||||||
// dataList: [],
|
dataList: [],
|
||||||
dataList: [
|
// dataList: [
|
||||||
{material_code: 'code1', material_name: 'name1', measure_unit_id: '千克'},
|
// {material_code: 'code1', material_name: 'name1', measure_unit_id: '千克'},
|
||||||
{material_code: 'code2', material_name: 'name2', measure_unit_id: '千克'},
|
// {material_code: 'code2', material_name: 'name2', measure_unit_id: '千克'},
|
||||||
{material_code: 'code3', material_name: 'name3', measure_unit_id: '千克'},
|
// {material_code: 'code3', material_name: 'name3', measure_unit_id: '千克'},
|
||||||
],
|
// ],
|
||||||
pkId: '',
|
pkId: '',
|
||||||
pkObj: {},
|
pkObj: {},
|
||||||
reload: false,
|
reload: false,
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
},
|
},
|
||||||
onLoad (options) {
|
onLoad (options) {
|
||||||
this.title = options.title
|
this.title = options.title
|
||||||
this.searchList()
|
// this.searchList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
searchList () {
|
searchList () {
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
this._selectMaterials()
|
this._selectMaterials()
|
||||||
},
|
},
|
||||||
async _selectMaterials () {
|
async _selectMaterials () {
|
||||||
let res = await selectMaterials( this.val1)
|
let res = await selectMaterials(this.val1)
|
||||||
this.dataList = res.data
|
this.dataList = res.data
|
||||||
// this.totalCount = res.totalElements
|
// this.totalCount = res.totalElements
|
||||||
// if (res.totalElements > 0) {
|
// if (res.totalElements > 0) {
|
||||||
|
|||||||
@@ -41,11 +41,12 @@
|
|||||||
return {
|
return {
|
||||||
userName: '',
|
userName: '',
|
||||||
menuList: [
|
menuList: [
|
||||||
{title: '东丽管理', path: 'RF03', sonTree: [{title: '人工放货', path: '/pages/ftdl/man-load-goods'}, {title: '人工取货', path: '/pages/ftdl/man-get-goods'}, {title: '产线叫料', path: '/pages/ftdl/line-call-mater'}, {title: '产线下料', path: '/pages/ftdl/line-down-mater'}, {title: '库存锁定/解锁', path: '/pages/ftdl/kc-manage'}, {title: '定点作业', path: '/pages/ftdl/fixedpoint-work'}, {title: '作业管理', path: '/pages/ftdl/work-manage'}]},
|
{title: '功能管理', path: 'RF03', sonTree: [{title: '人工取货', path: '/pages/ftdl/man-get-goods'}, {title: '产线叫料', path: '/pages/ftdl/line-call-mater'}, {title: '库存锁定/解锁', path: '/pages/ftdl/kc-manage'}, {title: '定点作业', path: '/pages/ftdl/fixedpoint-work'}, {title: '作业管理', path: '/pages/ftdl/work-manage'}]},
|
||||||
{title: '预装管理', path: 'RF04', sonTree: [{title: '物料组盘', path: '/pages/entry/mater-group2'}, {title: '货架绑定', path: '/pages/outbound/shelf-bind'}]},
|
// {title: '东丽管理', path: 'RF03', sonTree: [{title: '人工放货', path: '/pages/ftdl/man-load-goods'}, {title: '人工取货', path: '/pages/ftdl/man-get-goods'}, {title: '产线叫料', path: '/pages/ftdl/line-call-mater'}, {title: '产线下料', path: '/pages/ftdl/line-down-mater'}, {title: '库存锁定/解锁', path: '/pages/ftdl/kc-manage'}, {title: '定点作业', path: '/pages/ftdl/fixedpoint-work'}, {title: '作业管理', path: '/pages/ftdl/work-manage'}]},
|
||||||
{title: '产线管理', path: 'RF07', sonTree: [{title: '产线叫料', path: '/pages/outbound/line-callmater'}, {title: '线边仓出库', path: '/pages/outbound/mater-outstore'}, {title: '产线转运', path: '/pages/outbound/line-transfer2'}]},
|
// {title: '预装管理', path: 'RF04', sonTree: [{title: '物料组盘', path: '/pages/entry/mater-group2'}, {title: '货架绑定', path: '/pages/outbound/shelf-bind'}]},
|
||||||
{title: '入库管理', path: 'RF01', sonTree: [{title: '物料组盘', path: '/pages/entry/mater-group'}, {title: '组盘入库', path: '/pages/entry/groupplate-instore'}, {title: '货架绑定', path: '/pages/outbound/shelf-bind'}, {title: '拣选余料回库', path: '/pages/entry/pick-yl-return-store'}, {title: '空载具入库', path: '/pages/entry/empty-vehicle-instore'}]},
|
// {title: '产线管理', path: 'RF07', sonTree: [{title: '产线叫料', path: '/pages/outbound/line-callmater'}, {title: '线边仓出库', path: '/pages/outbound/mater-outstore'}, {title: '产线转运', path: '/pages/outbound/line-transfer2'}]},
|
||||||
{title: '出库管理', path: 'RF02', sonTree: [{title: '产线转运', path: '/pages/outbound/line-transfer'}, {title: '空载具出库', path: '/pages/outbound/empty-vehicle-outstore'}, {title: 'CTU载具出库', path: '/pages/outbound/ctu-vehicle-outstore'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}]},
|
// {title: '入库管理', path: 'RF01', sonTree: [{title: '物料组盘', path: '/pages/entry/mater-group'}, {title: '组盘入库', path: '/pages/entry/groupplate-instore'}, {title: '货架绑定', path: '/pages/outbound/shelf-bind'}, {title: '拣选余料回库', path: '/pages/entry/pick-yl-return-store'}, {title: '空载具入库', path: '/pages/entry/empty-vehicle-instore'}]},
|
||||||
|
// {title: '出库管理', path: 'RF02', sonTree: [{title: '产线转运', path: '/pages/outbound/line-transfer'}, {title: '空载具出库', path: '/pages/outbound/empty-vehicle-outstore'}, {title: 'CTU载具出库', path: '/pages/outbound/ctu-vehicle-outstore'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}]},
|
||||||
// {title: '入库管理', path: 'RF01', sonTree: [{title: '组盘入库', path: '/pages/entry/groupplate-instore'}, {title: '拣选余料回库', path: '/pages/entry/pick-yl-return-store'}, {title: '空载具入库', path: '/pages/entry/empty-vehicle-instore'}]},
|
// {title: '入库管理', path: 'RF01', sonTree: [{title: '组盘入库', path: '/pages/entry/groupplate-instore'}, {title: '拣选余料回库', path: '/pages/entry/pick-yl-return-store'}, {title: '空载具入库', path: '/pages/entry/empty-vehicle-instore'}]},
|
||||||
// {title: '出库管理', path: 'RF02', sonTree: [{title: '产线转运', path: '/pages/outbound/line-transfer'}, {title: '空载具出库', path: '/pages/outbound/empty-vehicle-outstore'}, {title: 'CTU载具出库', path: '/pages/outbound/ctu-vehicle-outstore'}]}
|
// {title: '出库管理', path: 'RF02', sonTree: [{title: '产线转运', path: '/pages/outbound/line-transfer'}, {title: '空载具出库', path: '/pages/outbound/empty-vehicle-outstore'}, {title: 'CTU载具出库', path: '/pages/outbound/ctu-vehicle-outstore'}]}
|
||||||
// {title: '入库管理', path: 'RF01', sonTree: [{title: '物料组盘入库', path: '/pages/entry/mater-group-to-store'}, {title: '合格证入库', path: '/pages/entry/qualified-to-store'}, {title: '单据入库', path: '/pages/entry/bill-to-store'}, {title: '盘点入库', path: '/pages/entry/check-to-store'}, {title: '空托盘入库', path: '/pages/entry/empty-tray-to-store'}]},
|
// {title: '入库管理', path: 'RF01', sonTree: [{title: '物料组盘入库', path: '/pages/entry/mater-group-to-store'}, {title: '合格证入库', path: '/pages/entry/qualified-to-store'}, {title: '单据入库', path: '/pages/entry/bill-to-store'}, {title: '盘点入库', path: '/pages/entry/check-to-store'}, {title: '空托盘入库', path: '/pages/entry/empty-tray-to-store'}]},
|
||||||
|
|||||||
@@ -101,6 +101,7 @@
|
|||||||
url: '/pages/home/home'
|
url: '/pages/home/home'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
console.log(11111)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as types from '../types'
|
import * as types from '../types'
|
||||||
|
|
||||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://172.18.51.221:8011' : 'http://172.18.51.221:8011'
|
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.10.47:8011' : 'http://192.168.10.47:8011'
|
||||||
const acsUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.18.250:8012' : 'http://192.168.18.250:8012'
|
const acsUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.18.250:8012' : 'http://192.168.18.250:8012'
|
||||||
const printUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010'
|
const printUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010'
|
||||||
const state = {
|
const state = {
|
||||||
|
|||||||
Reference in New Issue
Block a user