新增二期呼叫套轴,分切上料2加功能
This commit is contained in:
222
pages/SecondPhase/slitting/CallPaperShaft.vue
Normal file
222
pages/SecondPhase/slitting/CallPaperShaft.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- <nav-bar title="呼叫套轴"></nav-bar> -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">区域</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">位置</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">左管</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="upL" :searchInput="true" :localdata="newaxis1" @handleChange="handleChange1" @showSelector="showSelector1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">右管</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="upR" :searchInput="true" :localdata="newaxis2" @handleChange="handleChange2" @showSelector="showSelector2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">尺寸</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index3" :localdata="options3" @change="selectChange3"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">代数</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index4" :localdata="options4" @change="selectChange4"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">数量</view>
|
||||
<view class="filter_input_wraper">
|
||||
<!-- <input type="number" class="filter_input" v-model="qty"> -->
|
||||
<NumberInput
|
||||
v-model="qty"
|
||||
input-class="filter_input"
|
||||
mode="integer"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submitbar">
|
||||
<button class="zd-col-6 btn-submit btn-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-15 btn-submit btn-success" :class="{'btn-info': !index1 || !index2 || (!upL && !upR) || !index3 || !index4 || !qty}" :disabled="disabled" @tap="_slitXnplan">呼叫套轴</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import NumberInput from '@/components/NumberInput.vue'
|
||||
import {queryProductArea, queryDeviceByarea} from '@/utils/getData2.js'
|
||||
import {slitXnplan, slitXnarea, paperQueryPaperMaterial} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox,
|
||||
NumberInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options1: [],
|
||||
index1: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
options3: [{text: '3寸', value: '3'}, {text: '6寸', value: '6'}],
|
||||
index3: '',
|
||||
options4: [{text: '4代', value: '4'}, {text: '5代', value: '5'}],
|
||||
index4: '',
|
||||
axis: [],
|
||||
newaxis1: [],
|
||||
newaxis2: [],
|
||||
upL: '',
|
||||
upR: '',
|
||||
qty: null,
|
||||
disabled: false,
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryProductArea()
|
||||
this._paperQueryPaperMaterial()
|
||||
},
|
||||
methods: {
|
||||
/** 生产区域下拉框查询 */
|
||||
async _queryProductArea () {
|
||||
let res = await queryProductArea()
|
||||
this.options1 = [...res.data]
|
||||
},
|
||||
async _slitXnarea (e) {
|
||||
try {
|
||||
let res = await slitXnarea(e)
|
||||
if (res) {
|
||||
const list = res.map(el => {
|
||||
return {
|
||||
text: el.label,
|
||||
value: el.value
|
||||
}
|
||||
})
|
||||
this.options2 = list
|
||||
}
|
||||
} catch (e) {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
if (e) {
|
||||
this._slitXnarea(e)
|
||||
} else {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
selectChange2(e) {
|
||||
this.index2 = e
|
||||
},
|
||||
selectChange3(e) {
|
||||
this.index3 = e
|
||||
},
|
||||
selectChange4(e) {
|
||||
this.index4 = e
|
||||
},
|
||||
async _paperQueryPaperMaterial () {
|
||||
let res = await paperQueryPaperMaterial()
|
||||
this.axis = [...res.rows]
|
||||
},
|
||||
clearUp () {
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.upL = ''
|
||||
this.upR = ''
|
||||
this.index3 = ''
|
||||
this.index4 = ''
|
||||
this.qty = null
|
||||
this.disabled = false
|
||||
this.disabled1 = false
|
||||
},
|
||||
async _slitXnplan () {
|
||||
this.disabled = true
|
||||
if (!this.index1 || !this.index2 || (!this.upL && !this.upR) || !this.index3 || !this.index4 || !this.qty) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
let upLT = ''
|
||||
let upRT = ''
|
||||
this.axis.map(el => {
|
||||
if (el.value === this.upL) {
|
||||
upLT = el.text
|
||||
}
|
||||
if (el.value === this.upR) {
|
||||
upRT = el.text
|
||||
}
|
||||
})
|
||||
try {
|
||||
let res = await slitXnplan(this.index1, this.index2, upLT, this.upL, upRT, this.upR, this.index3, this.index4, this.qty)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
/** 模糊匹配 */
|
||||
selectMatchItem (lists, keyWord) {
|
||||
let resArr = []
|
||||
lists.filter((item) => {
|
||||
if (item.text.indexOf(keyWord) > -1) {
|
||||
resArr.push(item)
|
||||
}
|
||||
})
|
||||
return resArr
|
||||
},
|
||||
handleChange1 (e) {
|
||||
if (e){
|
||||
this.upL = ''
|
||||
this.newaxis1 = this.selectMatchItem(this.axis, e)
|
||||
} else {
|
||||
this.newaxis1 = this.axis
|
||||
}
|
||||
},
|
||||
showSelector1 () {
|
||||
this.newaxis1 = this.axis
|
||||
},
|
||||
handleChange2 (e) {
|
||||
if (e){
|
||||
this.upR = ''
|
||||
this.newaxis2 = this.selectMatchItem(this.axis, e)
|
||||
} else {
|
||||
this.newaxis2 = this.axis
|
||||
}
|
||||
},
|
||||
showSelector2 () {
|
||||
this.newaxis2 = this.axis
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -73,8 +73,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submitbar">
|
||||
<button class="zd-col-6 btn-submit btn-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-15 btn-submit btn-success" :class="{'btn-info': !index || !dataList.length}" @tap="downRolls2Confirm">确认</button>
|
||||
<button class="zd-col-5 btn-submit btn-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !index || !dataList.length}" @tap="downRolls2Confirm">确认</button>
|
||||
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !index}" @tap="bindPlanDeviceConfirm">绑定</button>
|
||||
</view>
|
||||
<view class="msg_modal" :class="modalShow ? 'popshow1' : 'pophide1'">
|
||||
<view class="msg_tip">提示</view>
|
||||
@@ -88,6 +89,40 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="modalShow" class="msg_mask msg_mask_1"></view>
|
||||
<view class="msg_wrapper_2" :class="modalShow1 ? 'popshow' : 'pophide2'">
|
||||
<view class="zd-row pop-title_wraper_2">
|
||||
<text class="pop-title_2">绑定轴信息</text>
|
||||
<text class="iconfont icon_close" @tap="modalShow1 = false"></text>
|
||||
</view>
|
||||
<view class="msg_content_2">
|
||||
<view class="msg_filter">
|
||||
<view class="relative msg_tip_2 msg_tip_2_blue">上轴信息</view>
|
||||
<view class="filter_label filter_label_2">缓存架编码</view>
|
||||
<view class="filter_input_wraper_2">
|
||||
<input type="text" class="filter_input" placeholder="请输入缓存架编码" v-model="upShelf">
|
||||
</view>
|
||||
<view class="filter_label filter_label_2">绑定计划</view>
|
||||
<view class="filter_input_wraper_2">
|
||||
<uni-data-select v-model="upPlanCode" :searchInput="true" :localdata="PlanOptions1" @handleChange="handleChange1" @showSelector="showSelector1"></uni-data-select>
|
||||
</view>
|
||||
<view class="msg_fgx"></view>
|
||||
<view class="relative msg_tip_2 msg_tip_2_yellow">下轴信息</view>
|
||||
<view class="filter_label filter_label_2">缓存架编码</view>
|
||||
<view class="filter_input_wraper_2">
|
||||
<input type="text" class="filter_input" placeholder="请输入缓存架编码" v-model="downShelf">
|
||||
</view>
|
||||
<view class="filter_label filter_label_2">绑定计划</view>
|
||||
<view class="filter_input_wraper_2 filter_input_wraper_2-bottom">
|
||||
<uni-data-select v-model="downPlanCode" :searchInput="true" :localdata="PlanOptions2" @handleChange="handleChange2" @showSelector="showSelector2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submitbar">
|
||||
<button class="zd-col-11 btn-submit btn-success" :class="{'btn-info': !((upShelf && upPlanCode) || (downShelf && downPlanCode))}" :disabled="disabled" @tap="bindSure(0)">确认绑定</button>
|
||||
<button class="zd-col-11 btn-submit btn-success" :class="{'btn-info': !((upShelf && upPlanCode) || (downShelf && downPlanCode))}" :disabled="disabled" @tap="bindSure(1)">强制绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="modalShow1" class="msg_mask"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -95,7 +130,9 @@
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryProductArea} from '@/utils/getData2.js'
|
||||
import {getTubeLength, slitterDevices, downRolls2} from '@/utils/getData3.js'
|
||||
import {getTubeLength, slitterDevices, downRolls2, getUnbindPlan, dBindPlanDevice} from '@/utils/getData3.js'
|
||||
// import {getTubeLength, slitterDevices, queryProductArea, getUnbindPlan} from '@/utils/mork2.js'
|
||||
// import {downRolls2, dBindPlanDevice} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -117,7 +154,15 @@
|
||||
disabled1: false,
|
||||
modalShow: false,
|
||||
htmlContent1: [],
|
||||
htmlContent2: []
|
||||
htmlContent2: [],
|
||||
modalShow1: false,
|
||||
upShelf: '',
|
||||
upPlanCode: '',
|
||||
downShelf: '',
|
||||
downPlanCode: '',
|
||||
PlanOptions: [],
|
||||
PlanOptions1: [],
|
||||
PlanOptions2: []
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
@@ -144,8 +189,29 @@
|
||||
let res = await slitterDevices(e)
|
||||
this.options = [...res]
|
||||
},
|
||||
async _getUnbindPlan (e) {
|
||||
try {
|
||||
let res = await getUnbindPlan(e)
|
||||
if (res) {
|
||||
const list = res.map(el => {
|
||||
return {
|
||||
text: el.label,
|
||||
value: el.value
|
||||
}
|
||||
})
|
||||
this.PlanOptions = list
|
||||
}
|
||||
} catch (e) {
|
||||
this.PlanOptions = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (e) {
|
||||
this._getUnbindPlan(e)
|
||||
} else {
|
||||
this.PlanOptions = []
|
||||
}
|
||||
},
|
||||
radioChange (e) {
|
||||
this.index1 = e.detail.value
|
||||
@@ -250,6 +316,79 @@
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
this.disabled1 = false
|
||||
},
|
||||
/** 模糊匹配 */
|
||||
selectMatchItem (lists, keyWord) {
|
||||
let resArr = []
|
||||
lists.filter((item) => {
|
||||
if (item.text.indexOf(keyWord) > -1) {
|
||||
resArr.push(item)
|
||||
}
|
||||
})
|
||||
return resArr
|
||||
},
|
||||
handleChange1 (e) {
|
||||
if (e){
|
||||
this.upPlanCode = ''
|
||||
this.PlanOptions1 = this.selectMatchItem(this.PlanOptions, e)
|
||||
} else {
|
||||
this.PlanOptions1 = this.PlanOptions
|
||||
}
|
||||
},
|
||||
showSelector1 () {
|
||||
this.PlanOptions1 = this.PlanOptions
|
||||
},
|
||||
handleChange2 (e) {
|
||||
if (e){
|
||||
this.downPlanCode = ''
|
||||
this.PlanOptions2 = this.selectMatchItem(this.PlanOptions, e)
|
||||
} else {
|
||||
this.PlanOptions2 = this.PlanOptions
|
||||
}
|
||||
},
|
||||
showSelector2 () {
|
||||
this.PlanOptions2 = this.PlanOptions
|
||||
},
|
||||
bindPlanDeviceConfirm () {
|
||||
if (!this.index) {
|
||||
uni.showToast({
|
||||
title: '请先选择设备',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.modalShow1 = true
|
||||
this.upShelf = ''
|
||||
this.upPlanCode = ''
|
||||
this.downShelf = ''
|
||||
this.downPlanCode = ''
|
||||
},
|
||||
async bindSure (type) {
|
||||
this.disabled = true
|
||||
const upValid = this.upShelf && this.upPlanCode
|
||||
const downValid = this.downShelf && this.downPlanCode
|
||||
if (!upValid && !downValid) {
|
||||
uni.showToast({
|
||||
title: '请至少完整填写上轴或下轴一组信息',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await dBindPlanDevice(this.upShelf, this.upPlanCode, this.downShelf, this.downPlanCode, type, this.index)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.disabled = false
|
||||
this.modalShow1 = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
this.modalShow1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user