ftdlDTY
This commit is contained in:
176
pages/ftdlDTY/fixedpoint-work.vue
Normal file
176
pages/ftdlDTY/fixedpoint-work.vue
Normal file
@@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 定点作业 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">起点区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.start-area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">起点</span> -->
|
||||
<span class="filter_label">{{$t('filter.start-point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index3" :localdata="options3" placeholder="" @change="selectChange3"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">终点区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.end-area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index2" :localdata="options2" placeholder="" @change="selectChange2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">终点</span> -->
|
||||
<span class="filter_label">{{$t('filter.end-point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index4" :localdata="options4" placeholder="" @change="selectChange4"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-8 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !index3 || !index4}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getStartRegions, getEndRegions, getPointnByRegion, sendPointTask} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
options3: [],
|
||||
index3: '',
|
||||
options4: [],
|
||||
index4: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._getStartRegions()
|
||||
this._getEndRegions()
|
||||
},
|
||||
methods: {
|
||||
async _getStartRegions () {
|
||||
try {
|
||||
let res = await getStartRegions()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
this._getPointnByRegion1()
|
||||
},
|
||||
async _getEndRegions () {
|
||||
try {
|
||||
let res = await getEndRegions()
|
||||
if (res) {
|
||||
this.options2 = res.data
|
||||
} else {
|
||||
this.options2 =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
selectChange2 (e) {
|
||||
this.index2 = e
|
||||
this._getPointnByRegion2()
|
||||
},
|
||||
async _getPointnByRegion1 () {
|
||||
try {
|
||||
let res = await getPointnByRegion(this.index)
|
||||
if (res) {
|
||||
this.options3 = res.data
|
||||
} else {
|
||||
this.options3 =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options3 = []
|
||||
}
|
||||
},
|
||||
async _getPointnByRegion2 () {
|
||||
try {
|
||||
let res = await getPointnByRegion(this.index2)
|
||||
if (res) {
|
||||
this.options4 = res.data
|
||||
} else {
|
||||
this.options4 =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options4 = []
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.index = ''
|
||||
this.index2 = ''
|
||||
this.index3 = ''
|
||||
this.index4 = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.index3 || !this.index4) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._sendPointTask()
|
||||
}
|
||||
},
|
||||
async _sendPointTask () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await sendPointTask(this.index3, this.index4)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
</style>
|
||||
204
pages/ftdlDTY/inout-area-mark.vue
Normal file
204
pages/ftdlDTY/inout-area-mark.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 进出区域登记 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">管制区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.control-area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
|
||||
</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>{{$t('grid.number')}}</th>
|
||||
<th>{{$t('grid.enter-time')}}</th>
|
||||
<th>{{$t('grid.enter-man')}}</th>
|
||||
<th>{{$t('grid.enter-area')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.create_name === pkId}">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_name}}</td>
|
||||
<td>{{e.region_name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-6 button-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="_inArea">进入</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_outArea">退出</button> -->
|
||||
<button class="zd-col-7 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="handleConfirm">{{$t('button.enter')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="handleConfirm2">{{$t('button.quit')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getChargeRegions, selectRegionInfo, inArea, outArea} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
dataList: [],
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false,
|
||||
disabled2: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._getChargeRegions()
|
||||
},
|
||||
methods: {
|
||||
async _getChargeRegions () {
|
||||
try {
|
||||
let res = await getChargeRegions()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
this.searchList()
|
||||
},
|
||||
clearUp () {
|
||||
this.index = ''
|
||||
this.pkId = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
this.disabled2 = false
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._selectRegionInfo()
|
||||
},
|
||||
async _selectRegionInfo () {
|
||||
let res = await selectRegionInfo(this.index)
|
||||
if (res.code === '200') {
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.content
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
}
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._selectRegionInfo()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = e.create_name === this.pkId ? '' : e.create_name
|
||||
this.pkObj = this.pkId === e.create_name ? e : {}
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.index) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._inArea()
|
||||
}
|
||||
},
|
||||
async _inArea () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await inArea(this.index)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async handleConfirm2() {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._outArea()
|
||||
}
|
||||
},
|
||||
async _outArea () {
|
||||
this.disabled2 = true
|
||||
try {
|
||||
let res = await outArea(this.pkObj)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
237
pages/ftdlDTY/kc-manage.vue
Normal file
237
pages/ftdlDTY/kc-manage.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 库存锁定/解锁 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">点位</span> -->
|
||||
<span class="filter_label">{{$t('filter.point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">物料</span> -->
|
||||
<span class="filter_label">{{$t('filter.material')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
|
||||
<!-- <th>状态</th>
|
||||
<th>点位</th>
|
||||
<th>物料编码</th>
|
||||
<th>物料品种</th>
|
||||
<th>数量</th>
|
||||
<th>单位</th>
|
||||
<th>卷号</th> -->
|
||||
<th>{{$t('grid.status')}}</th>
|
||||
<th>{{$t('grid.point')}}</th>
|
||||
<th>{{$t('grid.material-code')}}</th>
|
||||
<th>{{$t('grid.material-name')}}</th>
|
||||
<th>{{$t('grid.quantity')}}</th>
|
||||
<th>{{$t('grid.unit')}}</th>
|
||||
<th>{{$t('grid.roll-number')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
|
||||
<td>{{e.is_used}}</td>
|
||||
<td>{{e.point_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.qty}}</td>
|
||||
<td>{{e.measure_unit_id}}</td>
|
||||
<td>{{e.containers.join(',')}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <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="disabled2" @tap="_unlock">解锁</button> -->
|
||||
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled" @tap="handleConfirm">{{$t('button.lock')}}</button>
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled2" @tap="handleConfirm2">{{$t('button.unlock')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getRegions, getPointInfo, lock, unlock} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '1',
|
||||
currentData: {},
|
||||
dataList: [],
|
||||
allCheck: false,
|
||||
checkedArr: [],
|
||||
options: [],
|
||||
index: '',
|
||||
disabled: false,
|
||||
disabled2: false,
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._getRegions()
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.currentData = this.$store.getters.publicObj
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this._getPointInfo()
|
||||
},
|
||||
toAllCheck () {
|
||||
this.allCheck = !this.allCheck
|
||||
this.dataList.map(el => {
|
||||
el.checked = this.allCheck
|
||||
})
|
||||
},
|
||||
toCheck (e) {
|
||||
e.checked = !e.checked
|
||||
this.checkedArr = this.dataList.filter(el => el.checked === true)
|
||||
this.allCheck = this.checkedArr.length === this.dataList.length
|
||||
},
|
||||
toJump () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/mater-list2?title=查询物料'
|
||||
})
|
||||
},
|
||||
async _getPointInfo () {
|
||||
let mcode = this.currentData.material_code || ''
|
||||
let res = await getPointInfo( this.index, this.val1, mcode)
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.data
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
},
|
||||
async _getRegions () {
|
||||
try {
|
||||
let res = await getRegions()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.index = ''
|
||||
this.index2 = ''
|
||||
this.disabled = false
|
||||
this.disabled2 = false
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.checkedArr.length) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._lock()
|
||||
}
|
||||
},
|
||||
async _lock () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await lock(this.checkedArr)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async handleConfirm2() {
|
||||
if (!this.checkedArr.length) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._unlock()
|
||||
}
|
||||
},
|
||||
async _unlock () {
|
||||
this.disabled2 = true
|
||||
try {
|
||||
let res = await unlock(this.checkedArr)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
</style>
|
||||
157
pages/ftdlDTY/line-call-mater.vue
Normal file
157
pages/ftdlDTY/line-call-mater.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 产线叫料 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<!-- <span class="filter_label">区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">物料</span> -->
|
||||
<span class="filter_label">{{$t('filter.material')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-10">
|
||||
<!-- <span class="filter_label">叫料托盘数</span> -->
|
||||
<span class="filter_label">{{$t('filter.callmater-pallet-number')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-14">
|
||||
<input type="number" class="filter_input" v-model="val2">
|
||||
</view>
|
||||
</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="_loading">确认</button> -->
|
||||
<button class="zd-col-8 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
|
||||
<button class="zd-col-14 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getRegionByPoint, selectMaterialByRegion, loading} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '1',
|
||||
currentData: {},
|
||||
options: [],
|
||||
pointCode: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.currentData = this.$store.getters.publicObj
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async _selectMaterialByRegion () {
|
||||
try {
|
||||
let res = await selectMaterialByRegion(this.val1)
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
toJump () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/ftdlDTY/mater-list-cxjl?title=查询物料'
|
||||
})
|
||||
},
|
||||
handleChange1 (e) {
|
||||
if (e) {
|
||||
this._getRegionByPoint(e)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: 'scan',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
async _getRegionByPoint (e) {
|
||||
try {
|
||||
let res = await getRegionByPoint(e)
|
||||
if (res) {
|
||||
this.pointCode = this.val1
|
||||
this.val1 = res.region_code
|
||||
this._selectMaterialByRegion()
|
||||
}
|
||||
} catch (e) {
|
||||
this.val1 = ''
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = '1'
|
||||
this.pointCode = ''
|
||||
this.currentData = {}
|
||||
this.disabled = false
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.val1 || !this.val2) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._loading()
|
||||
}
|
||||
},
|
||||
async _loading () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await loading(this.pointCode, this.val1, this.currentData.material_code, this.val2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.currentData = {}
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
</style>
|
||||
288
pages/ftdlDTY/line-down-mater.vue
Normal file
288
pages/ftdlDTY/line-down-mater.vue
Normal file
@@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 产线下料 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">点位</span> -->
|
||||
<span class="filter_label">{{$t('filter.point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-9">
|
||||
<!-- <span class="filter_label">送往区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.send-area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<button class="zd-col-6 button-primary ftsize1" @tap="toScanAdd">{{$t('button.scan-add')}}</button>
|
||||
<button class="zd-col-5 button-primary ftsize1" @tap="toAdd">{{$t('button.add-row')}}</button>
|
||||
<button class="zd-col-5 button-primary ftsize1" @tap="toDel">{{$t('button.del-row')}}</button>
|
||||
<button class="zd-col-6 button-primary ftsize1" @tap="toCopy">{{$t('button.copy-row')}}</button>
|
||||
</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" :class="{'checked': e.mid === pkId}">
|
||||
<td @tap="toCheck(e)">{{i+1}}</td>
|
||||
<td><input type="text" class="sin_input" style="width: 135px;" v-model="e.container_code"></td>
|
||||
<td @tap="toJump(e)">{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></td>
|
||||
<td>{{e.measure_unit_id}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-22 button-primary" :class="{'button-info': !val1 || !dataList.length || !index}" :disabled="disabled" @tap="_blanking">确认下料</button> -->
|
||||
<button class="zd-col-22 button-primary" :class="{'button-info': !val1 || !dataList.length || !index}" :disabled="disabled" @tap="_blanking">{{$t('button.confirm-down-material')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getNextRegions, selectMaterials, blanking} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
currentData: {},
|
||||
options: [],
|
||||
index: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
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.material_code = this.currentData.material_code
|
||||
item.measure_unit_id = this.currentData.measure_unit_id
|
||||
}
|
||||
})
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._getNextRegions()
|
||||
},
|
||||
methods: {
|
||||
async _getNextRegions () {
|
||||
try {
|
||||
let res = await getNextRegions()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
toCheck (e) {
|
||||
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/ftdlDTY/mater-list0?title=查询物料'
|
||||
})
|
||||
},
|
||||
toScanAdd () {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
// 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 = {
|
||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||
container_code: parts[0],
|
||||
material_code: parts[1],
|
||||
material_name: parts[2],
|
||||
qty: parts[3],
|
||||
measure_unit_id: parts[4],
|
||||
}
|
||||
// 检查是否已存在相同卷号
|
||||
const exists = this.dataList.some(item => item.container_code === currObj.container_code)
|
||||
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'
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
toAdd () {
|
||||
let currObj = {
|
||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||
container_code: '',
|
||||
material_code: '编码',
|
||||
material_name: '名称',
|
||||
qty: '1',
|
||||
measure_unit_id: '单位'
|
||||
}
|
||||
this.dataList.push(currObj)
|
||||
},
|
||||
toDel () {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
this.dataList = this.dataList.filter(item => item.mid !== this.pkObj.mid)
|
||||
},
|
||||
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 () {
|
||||
this.val1 = ''
|
||||
this.index = ''
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.currentData = {}
|
||||
this.disabled = false
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.val1 || !this.dataList.length || !this.index) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._blanking()
|
||||
}
|
||||
},
|
||||
async _blanking () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await blanking(this.val1, this.dataList, this.index)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.checked
|
||||
background #ff0
|
||||
</style>
|
||||
166
pages/ftdlDTY/man-get-goods.vue
Normal file
166
pages/ftdlDTY/man-get-goods.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 人工取货 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">点位</span> -->
|
||||
<span class="filter_label">{{$t('filter.point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</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>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-7 button-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_comfirmGetting">确认取货</button> -->
|
||||
<button class="zd-col-8 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
|
||||
<button class="zd-col-7 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm-quhuo')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getMaterialInfoByPoint, comfirmGetting} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this.searchList()
|
||||
}
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._getMaterialInfoByPoint()
|
||||
},
|
||||
async _getMaterialInfoByPoint () {
|
||||
let res = await getMaterialInfoByPoint(this.val1)
|
||||
if (res.code === '200') {
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.content
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
}
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._getMaterialInfoByPoint()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.val1) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._comfirmGetting()
|
||||
}
|
||||
},
|
||||
async _comfirmGetting () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await comfirmGetting(this.val1, this.dataList)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
334
pages/ftdlDTY/man-load-goods.vue
Normal file
334
pages/ftdlDTY/man-load-goods.vue
Normal file
@@ -0,0 +1,334 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 人工放货 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<!-- <span class="filter_label">点位</span> -->
|
||||
<span class="filter_label">{{$t('filter.point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<button class="zd-col-6 button-primary ftsize1" @tap="toScanAdd">{{$t('button.scan-add')}}</button>
|
||||
<button class="zd-col-5 button-primary ftsize1" @tap="toAdd">{{$t('button.add-row')}}</button>
|
||||
<button class="zd-col-5 button-primary ftsize1" @tap="toDel">{{$t('button.del-row')}}</button>
|
||||
<button class="zd-col-6 button-primary ftsize1" @tap="toCopy">{{$t('button.copy-row')}}</button>
|
||||
</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" :class="{'checked': e.mid === pkId}">
|
||||
<td @tap="toCheck(e)">{{i+1}}</td>
|
||||
<td><input type="text" class="sin_input" style="width: 135px;" v-model="e.container_code"></td>
|
||||
<td @tap="toJump(e)">{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></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-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_materialBinding">物料绑定</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1}" :disabled="disabled2" @tap="_vehicleBinding">空载具绑定</button> -->
|
||||
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="handleConfirm">{{$t('button.material-bind')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1}" :disabled="disabled2" @tap="handleConfirm2">{{$t('button.empty-vehicle-bind')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {selectMaterialByPointCode, materialBinding, vehicleBinding} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
currentData: {},
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false,
|
||||
disabled2: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
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.material_code = this.currentData.material_code
|
||||
item.measure_unit_id = this.currentData.measure_unit_id
|
||||
}
|
||||
})
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toCheck (e) {
|
||||
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/ftdlDTY/mater-list0?title=查询物料'
|
||||
})
|
||||
},
|
||||
toScanAdd () {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
// 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 = {
|
||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||
container_code: parts[0],
|
||||
material_code: parts[1],
|
||||
material_name: parts[2],
|
||||
qty: parts[3],
|
||||
measure_unit_id: parts[4],
|
||||
}
|
||||
// 检查是否已存在相同卷号
|
||||
const exists = this.dataList.some(item => item.container_code === currObj.container_code)
|
||||
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'
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
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
|
||||
}
|
||||
this.dataList = this.dataList.filter(item => item.mid !== this.pkObj.mid)
|
||||
},
|
||||
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 () {
|
||||
this.val1 = ''
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.disabled = false
|
||||
this.disabled2 = false
|
||||
},
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this.searchList()
|
||||
}
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._selectMaterialByPointCode()
|
||||
},
|
||||
async _selectMaterialByPointCode () {
|
||||
let res = await selectMaterialByPointCode(this.val1)
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.data
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._selectMaterialByPointCode()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.val1 || !this.dataList.length) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._materialBinding()
|
||||
}
|
||||
},
|
||||
async _materialBinding () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await materialBinding(this.val1, this.dataList)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async handleConfirm2() {
|
||||
if (!this.val1) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._vehicleBinding()
|
||||
}
|
||||
},
|
||||
async _vehicleBinding() {
|
||||
this.disabled2 = true
|
||||
try {
|
||||
let res = await vehicleBinding(this.val1)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.checked
|
||||
background #ff0
|
||||
</style>
|
||||
157
pages/ftdlDTY/mater-list-cxjl.vue
Normal file
157
pages/ftdlDTY/mater-list-cxjl.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<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-9">
|
||||
<!-- <span class="filter_label">区域</span> -->
|
||||
<span class="filter_label">{{$t('filter.area')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- <th>物料编码</th>
|
||||
<th>物料品种</th> -->
|
||||
<th>{{$t('grid.material-code')}}</th>
|
||||
<th>{{$t('grid.material-name')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <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-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>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {selectFullMaterials, getCallRegions} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
dataList: [],
|
||||
// dataList: [
|
||||
// {material_code: 'code1', material_name: 'name1', measure_unit_id: '千克'},
|
||||
// {material_code: 'code2', material_name: 'name2', measure_unit_id: '千克'},
|
||||
// {material_code: 'code3', material_name: 'name3', measure_unit_id: '千克'},
|
||||
// ],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
// this.searchList()
|
||||
this._getCallRegions()
|
||||
},
|
||||
methods: {
|
||||
async _getCallRegions () {
|
||||
try {
|
||||
let res = await getCallRegions()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (this.index) {
|
||||
this.searchList()
|
||||
}
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._selectFullMaterials()
|
||||
},
|
||||
async _selectFullMaterials () {
|
||||
let res = await selectFullMaterials(this.index)
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.data
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._selectFullMaterials()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.material_code ? '' : e.material_code
|
||||
this.pkObj = this.pkId === e.material_code ? e : {}
|
||||
},
|
||||
toEmpty () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this.pkId = ''
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
174
pages/ftdlDTY/mater-list0.vue
Normal file
174
pages/ftdlDTY/mater-list0.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<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-7">
|
||||
<!-- <span class="filter_label">物料</span> -->
|
||||
<span class="filter_label">{{$t('filter.material')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24">
|
||||
<input type="text" class="filter_input" v-model="val1">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-9">
|
||||
<!-- <span class="filter_label">物料类型</span> -->
|
||||
<span class="filter_label">{{$t('filter.wltype')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
|
||||
</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>{{$t('grid.material-code')}}</th>
|
||||
<th>{{$t('grid.material-name')}}</th>
|
||||
<th>{{$t('grid.unit')}}</th>
|
||||
<th>{{$t('grid.wltype')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.measure_unit_id}}</td>
|
||||
<td>{{e.material_type}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <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-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>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {rgfhSelectMaterials, getMaterialTypes} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
// dataList: [
|
||||
// {material_code: 'code1', material_name: 'name1', measure_unit_id: '千克'},
|
||||
// {material_code: 'code2', material_name: 'name2', measure_unit_id: '千克'},
|
||||
// {material_code: 'code3', material_name: 'name3', measure_unit_id: '千克'},
|
||||
// ],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
// this.searchList()
|
||||
this._getMaterialTypes()
|
||||
},
|
||||
methods: {
|
||||
async _getMaterialTypes () {
|
||||
try {
|
||||
let res = await getMaterialTypes()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (this.val1 && this.index) {
|
||||
this.searchList()
|
||||
}
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._rgfhSelectMaterials()
|
||||
},
|
||||
async _rgfhSelectMaterials () {
|
||||
let res = await rgfhSelectMaterials(this.val1, this.index)
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.data
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._rgfhSelectMaterials()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.material_code ? '' : e.material_code
|
||||
this.pkObj = this.pkId === e.material_code ? e : {}
|
||||
},
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this.pkId = ''
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
193
pages/ftdlDTY/work-manage.vue
Normal file
193
pages/ftdlDTY/work-manage.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 作业管理 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-12">
|
||||
<!-- <span class="filter_label">载具编码</span> -->
|
||||
<span class="filter_label">{{$t('filter.vehicle-code')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</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>{{$t('grid.task-number')}}</th>
|
||||
<th>{{$t('grid.start-point')}}</th>
|
||||
<th>{{$t('grid.end-point')}}</th>
|
||||
<th>{{$t('grid.status')}}</th>
|
||||
<th>{{$t('grid.vehicle-code')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
|
||||
<td>{{e.task_code}}</td>
|
||||
<td>{{e.point_code1}}</td>
|
||||
<td>{{e.point_code2}}</td>
|
||||
<td>{{e.task_status}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-6 button-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_againTask">重新下发</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirm">强制完成</button> -->
|
||||
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<!-- <button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="handleConfirm">{{$t('button.reissue')}}</button> -->
|
||||
<!-- <button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="handleConfirm2">{{$t('button.force-complete')}}</button> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {queryTask, againTask, forceConfirm} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false,
|
||||
disabled2: false,
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this.searchList()
|
||||
}
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._queryTask()
|
||||
},
|
||||
async _queryTask () {
|
||||
let res = await queryTask(this.val1)
|
||||
if (res.code === '200') {
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.content
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
}
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._queryTask()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = e.task_code === this.pkId ? '' : e.task_code
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.pkId = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
this.disabled2 = false
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._againTask()
|
||||
}
|
||||
},
|
||||
async _againTask () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await againTask(this.pkId)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async handleConfirm2() {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._forceConfirm()
|
||||
}
|
||||
},
|
||||
async _forceConfirm () {
|
||||
this.disabled2 = true
|
||||
try {
|
||||
let res = await forceConfirm(this.pkId)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user