acs
This commit is contained in:
143
pages/manage/area-lock.vue
Normal file
143
pages/manage/area-lock.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-5">
|
||||
<span class="filter_label">区域</span>
|
||||
</view>
|
||||
<view class="zd-col-19 filter_select">
|
||||
<!-- <zxz-uni-data-select
|
||||
v-model="index"
|
||||
:localdata="options"
|
||||
:multiple="true"
|
||||
:collapseTags="true"
|
||||
/> -->
|
||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-show="dataList.length > 0" class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)">
|
||||
<td><uni-icons :type="e.checked ? 'checkbox-filled' : 'circle'" size="26" color="#4e6ef2"></uni-icons></td>
|
||||
<td>{{e.point_name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view> -->
|
||||
<view v-show="dataList.length > 0" class="zd_wrapper grid-wraper">
|
||||
<view class="zd-row point-wraper">
|
||||
<view class="zd-row point-item" v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'point-item_n5': index === 'QTJGSLZCQ', 'cgreen': e.point_status === '0', 'cyellow': e.point_status === '1'}">
|
||||
<text>{{e.point_name}}</text>
|
||||
<uni-icons class="item-checked" type="checkbox-filled" size="22" :color="e.checked ? '#4e6ef2' : 'transparent'"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<view class="zd-col-4 zd-row flexcol" @tap="allCheck">
|
||||
<uni-icons :type="allChecked ? 'checkbox-filled' : 'circle'" size="26" color="#4e6ef2"></uni-icons>
|
||||
<view class="checkbox-text">全选</view>
|
||||
</view>
|
||||
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
// import {selectPointByRegion} from '@/utils/mork2.js'
|
||||
import {selectPointByRegion, handheldLock} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [{value: 'NBJGZCQ', text: '内部加工暂存区'}, {value: '111-22', text: '其他加工送料暂存区'}, {value: 'WXJGZCQ', text: '外协加工暂存区'}],
|
||||
index: '',
|
||||
multiple: true,
|
||||
disabled: false,
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
allChecked: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
selectChange (e) {
|
||||
if (e) {
|
||||
this._selectPointByRegion(e)
|
||||
}
|
||||
},
|
||||
async _selectPointByRegion (e) {
|
||||
let res = await selectPointByRegion(e)
|
||||
this.dataList = [...res]
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
},
|
||||
toCheck (e) {
|
||||
e.checked = !e.checked
|
||||
let arr = this.dataList.filter(el => el.checked === true)
|
||||
if (arr.length === this.dataList.length) {
|
||||
this.allChecked = true
|
||||
} else {
|
||||
this.allChecked = false
|
||||
}
|
||||
},
|
||||
allCheck () {
|
||||
if (!this.dataList.length) return
|
||||
this.allChecked = !this.allChecked
|
||||
this.dataList.map(el => {
|
||||
el.checked = this.allChecked
|
||||
})
|
||||
},
|
||||
async _handheldLock (type) {
|
||||
this.disabled = true
|
||||
if (!this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let arr = null
|
||||
if (type === '0') {
|
||||
arr = this.dataList.filter(el => el.checked === true)
|
||||
}
|
||||
let res = await handheldLock(this.index, type, arr)
|
||||
this.clearUp()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
</style>
|
||||
Reference in New Issue
Block a user