新增二期呼叫套轴,分切上料2加功能
This commit is contained in:
@@ -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