init
This commit is contained in:
184
pages/General/distribution-box.vue
Normal file
184
pages/General/distribution-box.vue
Normal file
@@ -0,0 +1,184 @@
|
||||
<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-6">
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="vehicleCode" @handleChange="handleChange"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">所属机台</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<input type="text" v-model="deviceData.device_code" class="filter_input">
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="toJump('machine-order?title=机台工单维护')">查询</button>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label filter_input_disabled">工单</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" v-model="deviceData.bom_code" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">物料编码</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="materialInfo"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">重量</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<NumberInput v-model="qty" />
|
||||
</view>
|
||||
<view class="zd-col-2"><span class="filter_unit">KG</span></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>重量(kg)</th>
|
||||
<th>生产日期</th>
|
||||
<th>供应商编码</th>
|
||||
<th>供应商名称</th>
|
||||
<th>规格</th>
|
||||
<th>型号</th>
|
||||
<th>有效期(天)</th>
|
||||
<th>执行标准</th>
|
||||
<th>品质类型</th>
|
||||
<th>烘干次数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.qty}}</td>
|
||||
<td>{{e.produce_time}}</td>
|
||||
<td>{{e.supp_code}}</td>
|
||||
<td>{{e.supp_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.material_model}}</td>
|
||||
<td>{{e.quality_time_day}}</td>
|
||||
<td>{{e.execution_stand}}</td>
|
||||
<td>{{['', '待检', '合格', '不合格'][Number(e.quality_type)]}}</td>
|
||||
<td>{{e.bake_num}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': JSON.stringify(deviceData) === '{}'}" :disabled="disabled" @tap="_deliveryBox">确认组箱</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import NumberInput from '@/components/NumberInput.vue'
|
||||
// import {queryGroupInfo} from '@/utils/mork2.js'
|
||||
import {queryGroupInfo, deliveryBox} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox,
|
||||
NumberInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
vehicleCode: '',
|
||||
deviceData: {},
|
||||
materialInfo: '',
|
||||
qty: '',
|
||||
dataList: [],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
onShow () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.deviceData = this.$store.getters.publicObj
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._queryGroupInfo(e)
|
||||
}
|
||||
},
|
||||
async _queryGroupInfo (e) {
|
||||
try {
|
||||
let res = await queryGroupInfo(e)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toJump (name) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/General/${name}`
|
||||
})
|
||||
},
|
||||
toEmpty () {
|
||||
this.vehicleCode = ''
|
||||
this.deviceData = {}
|
||||
this.materialInfo = ''
|
||||
this.qty = ''
|
||||
this.dataList = []
|
||||
},
|
||||
async _deliveryBox () {
|
||||
this.disabled = true
|
||||
if (JSON.stringify(this.deviceData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await deliveryBox(this.deviceData.device_code, this.deviceData.bom_id, this.deviceData.bom_code, this.materialInfo, this.qty, this.dataList)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
115
pages/General/line-transfer.vue
Normal file
115
pages/General/line-transfer.vue
Normal file
@@ -0,0 +1,115 @@
|
||||
<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-6">
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="vehicleCode"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">起点</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="code1"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">终点</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="code2"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">载具类型</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !code1 || !code2 || !index}" :disabled="disabled" @tap="_createTask">生成任务</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
// import {queryVehicleType} from '@/utils/mork2.js'
|
||||
import {queryVehicleType, createTask} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
vehicleCode: null,
|
||||
code1: '',
|
||||
code2: '',
|
||||
options: [],
|
||||
index: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryVehicleType()
|
||||
},
|
||||
methods: {
|
||||
/** 下拉框*/
|
||||
async _queryVehicleType () {
|
||||
try {
|
||||
let res = await queryVehicleType()
|
||||
if (res && res.data.length > 0) {
|
||||
this.options = [...res.data]
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.vehicleCode = null
|
||||
this.code1 = ''
|
||||
this.code2 = ''
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _createTask () {
|
||||
this.disabled = true
|
||||
if (!this.code1 || !this.code2 || !this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await createTask(this.vehicleCode, this.code1, this.code2, this.index)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
130
pages/General/machine-order.vue
Normal file
130
pages/General/machine-order.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<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-6">
|
||||
<span class="filter_label">日期</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_picker">
|
||||
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
|
||||
<view class="uni-input">{{date}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-5">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-14">
|
||||
<input type="text" placeholder="输入物料关键字" class="filter_input" v-model="keyword" @focus="handleFocus">
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="_queryBomInfo">查询</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>计量单位</th>
|
||||
<th>生产日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.bom_id === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.bom_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.call_qty}}</td>
|
||||
<td>{{e.qty_unit_name}}</td>
|
||||
<td>{{e.start_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getDate} from '@/utils/utils.js'
|
||||
import {queryBomInfo} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
const currentDate = getDate({
|
||||
format: true
|
||||
})
|
||||
return {
|
||||
title: '',
|
||||
keyword: null,
|
||||
date: currentDate,
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
startDate() {
|
||||
return getDate('start');
|
||||
},
|
||||
endDate() {
|
||||
return getDate('end');
|
||||
}
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryBomInfo()
|
||||
},
|
||||
methods: {
|
||||
handleFocus () {
|
||||
this.keyword = null
|
||||
},
|
||||
bindDateChange: function(e) {
|
||||
this.date = e.detail.value
|
||||
},
|
||||
async _queryBomInfo () {
|
||||
try {
|
||||
let res = await queryBomInfo(this.date, this.keyword)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.bom_id ? '' : e.bom_id
|
||||
this.pkObj = this.pkId === e.bom_id ? e : {}
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
100
pages/General/material.vue
Normal file
100
pages/General/material.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<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-5">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-14">
|
||||
<input type="text" placeholder="输入物料关键字" class="filter_input" v-model="keyword" @focus="handleFocus">
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="_queryMaterial">查询</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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.material_model}}</td>
|
||||
<td>{{e.quality_time}}</td>
|
||||
<td>{{e.execution_stand}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryMaterial} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
keyword: null,
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryMaterial()
|
||||
},
|
||||
methods: {
|
||||
handleFocus () {
|
||||
this.keyword = null
|
||||
},
|
||||
async _queryMaterial () {
|
||||
try {
|
||||
let res = await queryMaterial(this.keyword)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.material_id ? '' : e.material_id
|
||||
this.pkObj = this.pkId === e.material_id ? e : {}
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
143
pages/General/operation.vue
Normal file
143
pages/General/operation.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<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-5">
|
||||
<span class="filter_label">日期</span>
|
||||
</view>
|
||||
<view class="zd-col-9 filter_picker">
|
||||
<picker mode="date" :value="date1" :start="startDate" :end="endDate" @change="bindDateChange1">
|
||||
<view class="uni-input">{{date1}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="zd-col-1"><span>-</span></view>
|
||||
<view class="zd-col-9 filter_picker">
|
||||
<picker mode="date" :value="date2" :start="startDate" :end="endDate" @change="bindDateChange2">
|
||||
<view class="uni-input">{{date2}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-5">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-14">
|
||||
<input type="text" placeholder="载具号/起点/终点/任务号" class="filter_input" v-model="keyword" @focus="handleFocus">
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="_queryHistoryTask">查询</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>作业类型</th>
|
||||
<th>设备号</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.task_time}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.point_code1}}</td>
|
||||
<td>{{e.point_code2}}</td>
|
||||
<td>{{['生成', '', '', '下发', '执行中', '完成'][Number(e.task_status)]}}</td>
|
||||
<td>{{e.task_code}}</td>
|
||||
<td>{{e.config_name}}</td>
|
||||
<td>{{e.car_no}}</td>
|
||||
<td>{{e.remark}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-24 button-primary" @tap="toSure">返回</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getDate} from '@/utils/utils.js'
|
||||
import {queryHistoryTask} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
const currentDate = getDate({
|
||||
format: true
|
||||
})
|
||||
return {
|
||||
title: '',
|
||||
keyword: null,
|
||||
date1: currentDate,
|
||||
date2: currentDate,
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
startDate() {
|
||||
return getDate('start');
|
||||
},
|
||||
endDate() {
|
||||
return getDate('end');
|
||||
}
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryHistoryTask()
|
||||
},
|
||||
methods: {
|
||||
handleFocus () {
|
||||
this.keyword = null
|
||||
},
|
||||
bindDateChange1: function(e) {
|
||||
this.date1 = e.detail.value
|
||||
},
|
||||
bindDateChange2: function(e) {
|
||||
this.date2 = e.detail.value
|
||||
},
|
||||
async _queryHistoryTask () {
|
||||
try {
|
||||
let res = await queryHistoryTask(this.keyword, this.date1, this.date2)
|
||||
if (res && res.data) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toSure () {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.filter_picker {
|
||||
text-align: center
|
||||
}
|
||||
</style>
|
||||
163
pages/General/ops-mgmt.vue
Normal file
163
pages/General/ops-mgmt.vue
Normal file
@@ -0,0 +1,163 @@
|
||||
<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-6">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<search-box v-model="keyword"/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="_queryTask">查询</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>设备号</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_id === pkId}">
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.point_code1}}</td>
|
||||
<td>{{e.point_code2}}</td>
|
||||
<td>{{['生成', '', '', '下发', '执行中', '完成'][Number(e.task_status)]}}</td>
|
||||
<td>{{e.task_code}}</td>
|
||||
<td>{{e.config_name}}</td>
|
||||
<td>{{e.car_no}}</td>
|
||||
<td>{{e.remark}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="_taskOperation">重新生成</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirmTask">强制完成</button>
|
||||
<button class="zd-col-6 button-primary" @tap="toJump('operation?title=历史查询')">历史查询</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryTask, taskOperation, forceConfirmTask} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
keyword: '',
|
||||
dataList: [],
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryTask()
|
||||
},
|
||||
methods: {
|
||||
toJump (name) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/General/${name}`
|
||||
})
|
||||
},
|
||||
async _queryTask () {
|
||||
try {
|
||||
let res = await queryTask(this.keyword)
|
||||
if (res && res.data) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
async _taskOperation () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await taskOperation(this.pkObj)
|
||||
if (res) {
|
||||
this._queryTask()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
}
|
||||
},
|
||||
async _forceConfirmTask () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await forceConfirmTask(this.pkObj)
|
||||
if (res) {
|
||||
this._queryTask()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.task_id ? '' : e.task_id
|
||||
this.pkObj = this.pkId === e.task_id ? e : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
192
pages/General/pick-place-goods.vue
Normal file
192
pages/General/pick-place-goods.vue
Normal file
@@ -0,0 +1,192 @@
|
||||
<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-6">
|
||||
<span class="filter_label">点位/载具</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="keyword" @handleChange="handleChange"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label filter_input_disabled">当前站点</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" v-model="currentData.point_code" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-4">
|
||||
<span class="filter_label filter_input_disabled">任务号</span>
|
||||
</view>
|
||||
<view class="zd-col-8">
|
||||
<input type="text" v-model="currentData.task_code" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
<view class="zd-col-4">
|
||||
<span class="filter_label filter_input_disabled">AGV</span>
|
||||
</view>
|
||||
<view class="zd-col-8">
|
||||
<input type="text" v-model="currentData.car_no" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-4">
|
||||
<span class="filter_label filter_input_disabled">起点</span>
|
||||
</view>
|
||||
<view class="zd-col-8">
|
||||
<input type="text" v-model="currentData.point_code1" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
<view class="zd-col-4">
|
||||
<span class="filter_label filter_input_disabled">终点</span>
|
||||
</view>
|
||||
<view class="zd-col-8">
|
||||
<input type="text" v-model="currentData.point_code2" class="filter_input filter_input_disabled" disabled>
|
||||
</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>重量(kg)</th>
|
||||
<th>生产日期</th>
|
||||
<th>供应商编码</th>
|
||||
<th>供应商名称</th>
|
||||
<th>品质类型</th>
|
||||
<th>烘干次数</th>
|
||||
<th>来源库区</th>
|
||||
<th>机台</th>
|
||||
<th>工单</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.qty}}</td>
|
||||
<td>{{e.produce_time}}</td>
|
||||
<td>{{e.supp_code}}</td>
|
||||
<td>{{e.supp_name}}</td>
|
||||
<td>{{['', '待检', '合格', '不合格'][Number(e.quality_type)]}}</td>
|
||||
<td>{{e.bake_num}}</td>
|
||||
<td>{{e.sect_code}}</td>
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.bom_code}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="_confirmGet">确认取货</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="_confirmPut">确认放货</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
// import {queryPointInfo} from '@/utils/mork2.js'
|
||||
import {queryPointInfo, confirmGet, confirmPut} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
keyword: '',
|
||||
currentData: {},
|
||||
dataList: [],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._queryPointInfo(e)
|
||||
}
|
||||
},
|
||||
async _queryPointInfo (e) {
|
||||
try {
|
||||
let res = await queryPointInfo(e)
|
||||
if (res && res.data) {
|
||||
this.currentData = res.data
|
||||
this.dataList = [...res.data.rows]
|
||||
} else {
|
||||
this.currentData = {}
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.currentData = {}
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.keyword = ''
|
||||
this.currentData = {}
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
async _confirmGet () {
|
||||
this.disabled = true
|
||||
if (JSON.stringify(this.currentData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmGet(this.currentData.point_code)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _confirmPut () {
|
||||
this.disabled = true
|
||||
if (JSON.stringify(this.currentData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmPut(this.currentData.point_code)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
146
pages/General/pt-update.vue
Normal file
146
pages/General/pt-update.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<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-6">
|
||||
<span class="filter_label">点位</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="pointCode"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<search-box v-model="vehicleCode"/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="_updatePointqueryPointInfo">查询</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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.qty}}</td>
|
||||
<td>{{e.qty_unit_name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !pointCode || !vehicleCode}" :disabled="disabled" @tap="_bindVehicle">绑定</button>
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !pointCode || !vehicleCode}" :disabled="disabled" @tap="_clearVehicle">清载具</button>
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !pointCode || !vehicleCode}" :disabled="disabled" @tap="_clearMaterial">清物料</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
// import {updatePointqueryPointInfo} from '@/utils/mork2.js'
|
||||
import {updatePointqueryPointInfo, bindVehicle, clearVehicle, clearMaterial} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
pointCode: '',
|
||||
vehicleCode: '',
|
||||
dataList: [],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
async _updatePointqueryPointInfo () {
|
||||
try {
|
||||
let res = await updatePointqueryPointInfo(this.pointCode, this.vehicleCode)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.pointCode = ''
|
||||
this.vehicleCode = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
async _bindVehicle () {
|
||||
try {
|
||||
let res = await bindVehicle(this.pointCode, this.vehicleCode)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _clearVehicle () {
|
||||
try {
|
||||
let res = await clearVehicle(this.pointCode, this.vehicleCode)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _clearMaterial () {
|
||||
try {
|
||||
let res = await clearMaterial(this.pointCode, this.vehicleCode)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
94
pages/General/supplier.vue
Normal file
94
pages/General/supplier.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<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-5">
|
||||
<span class="filter_label">关键字</span>
|
||||
</view>
|
||||
<view class="zd-col-14">
|
||||
<input type="text" placeholder="输入供应商关键字" class="filter_input" v-model="keyword" @focus="handleFocus">
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="_querySupp">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>供应商编码</th>
|
||||
<th>供应商名称</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.supp_id === pkId}" @tap="toCheck(e)">
|
||||
<td>{{e.supp_code}}</td>
|
||||
<td>{{e.supp_name}}</td>
|
||||
<td>{{e.remark}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {querySupp} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
keyword: null,
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._querySupp()
|
||||
},
|
||||
methods: {
|
||||
handleFocus () {
|
||||
this.keyword = null
|
||||
},
|
||||
async _querySupp () {
|
||||
try {
|
||||
let res = await querySupp(this.keyword)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.supp_id ? '' : e.supp_id
|
||||
this.pkObj = this.pkId === e.supp_id ? e : {}
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setFormData', this.pkObj)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
288
pages/General/warehouse-box.vue
Normal file
288
pages/General/warehouse-box.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-6">
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="vehicleCode" @handleChange="handleChange" @handleDel="handleDel"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">物料编码</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<search-box v-model="materialData.material_code"/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="toJump('material?title=物料维护')">查询</button>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label filter_input_disabled">物料名称</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_name" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">供应商编码</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<search-box v-model="suppData.supp_code"/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="toJump('supplier?title=供应商维护')">查询</button>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label filter_input_disabled">供应商名称</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" v-model="suppData.supp_name" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">批次</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" v-model="pcsn" class="filter_input">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">生产日期</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_picker">
|
||||
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
|
||||
<view class="uni-input">{{date}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">重量</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<NumberInput v-model="qty" />
|
||||
</view>
|
||||
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">品质类型</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_select">
|
||||
<uni-data-select v-model="index1" :localdata="options1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label filter_input_disabled">料箱类型</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="boxType" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">烘干次数</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="number" v-model="num" class="filter_input">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': !vehicleCode || JSON.stringify(materialData) === '{}' || JSON.stringify(suppData) === '{}'}" :disabled="disabled" @tap="_confirmBox">确认组箱</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': !vehicleCode || JSON.stringify(materialData) === '{}' || JSON.stringify(suppData) === '{}'}" :disabled="disabled1" @tap="labelPrint">标签打印</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCLodop} from '@/utils/CLodopfuncs.js'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import NumberInput from '@/components/NumberInput.vue'
|
||||
import {getDate} from '@/utils/utils.js'
|
||||
const currentDate = getDate({format: true})
|
||||
// import {queryGroupQuality, queryNowVehicle} from '@/utils/mork2.js'
|
||||
import {queryGroupQuality, queryNowVehicle, confirmBox} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox,
|
||||
NumberInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
vehicleCode: '',
|
||||
date: currentDate,
|
||||
options1: [],
|
||||
index1: '',
|
||||
boxType: null,
|
||||
materialData: {},
|
||||
suppData: {},
|
||||
pcsn: null,
|
||||
qty: null,
|
||||
num: 0,
|
||||
disabled: false,
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
startDate() {
|
||||
return getDate('start');
|
||||
},
|
||||
endDate() {
|
||||
return getDate('end');
|
||||
}
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryGroupQuality()
|
||||
},
|
||||
onShow () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.materialData = this.$store.getters.publicObj
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
if (this.$store.getters.formData !== '') {
|
||||
this.suppData = this.$store.getters.formData
|
||||
this.$store.dispatch('setFormData', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._queryNowVehicle(e)
|
||||
}
|
||||
},
|
||||
handleDel () {
|
||||
this.boxType = ''
|
||||
},
|
||||
async _queryNowVehicle (e) {
|
||||
try {
|
||||
let res = await queryNowVehicle(e)
|
||||
if (res) {
|
||||
this.boxType = res.data.box_type
|
||||
} else {
|
||||
this.boxType = ''
|
||||
}
|
||||
} catch (e) {
|
||||
this.boxType = ''
|
||||
}
|
||||
},
|
||||
toJump (name) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/General/${name}`
|
||||
})
|
||||
},
|
||||
bindDateChange: function(e) {
|
||||
this.date = e.detail.value
|
||||
},
|
||||
/** 下拉框*/
|
||||
async _queryGroupQuality () {
|
||||
try {
|
||||
let res = await queryGroupQuality()
|
||||
if (res && res.data) {
|
||||
this.options1 = [...res.data]
|
||||
} else {
|
||||
this.options1 = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options1 = []
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.vehicleCode = ''
|
||||
this.date = currentDate
|
||||
this.index1 = ''
|
||||
this.boxType = null
|
||||
this.materialData = {}
|
||||
this.suppData = {}
|
||||
this.pcsn = null
|
||||
this.qty = null
|
||||
this.num = 0
|
||||
},
|
||||
async _confirmBox () {
|
||||
this.disabled = true
|
||||
if (!this.vehicleCode || JSON.stringify(this.materialData) === '{}' || JSON.stringify(this.suppData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmBox(this.vehicleCode, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.suppData.supp_code, this.suppData.supp_name, this.pcsn, this.date, this.qty, this.index1, this.boxType, this.num)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
labelPrint () {
|
||||
this.disabled1 = true
|
||||
let data = Object.assign({}, this.materialData, this.suppData, {pcsn: this.pcsn, produce_time: this.date, bake_num: this.num})
|
||||
this.toPrint(data)
|
||||
},
|
||||
toPrint (data) {
|
||||
let iparr = this.$store.getters.printUrl.split(":")
|
||||
let printUrl = iparr[1].slice(2)
|
||||
let LODOP = getCLodop();
|
||||
if (!(LODOP.webskt && LODOP.webskt.readyState === 1)) {
|
||||
uni.showToast({
|
||||
title: '当前配置ip:' + printUrl + '网络不通,请检查',
|
||||
icon: 'none',
|
||||
duration: 5000
|
||||
})
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
LODOP.SET_LICENSES('浙江省烟草专卖局(公司)', 'C0C4A46A3A0D1F526D426018D9F11921', '', '')
|
||||
// 更换为打印服务器ip 不需要加前缀
|
||||
LODOP.PRINT_INIT(null, printUrl);
|
||||
// 打印机序号 规则为打印服务器打印机列表倒数从0开始 -1为默认打印机
|
||||
LODOP.SET_PRINTER_INDEX(-1);
|
||||
// 设置打印纸大小
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '130mm', '67mm', '');
|
||||
LODOP.ADD_PRINT_RECT('1mm', '3mm', '124mm', '61mm', 0, 1);
|
||||
LODOP.SET_PRINT_STYLE('FontSize', 12);
|
||||
LODOP.SET_PRINT_STYLE('Bold', 1);
|
||||
LODOP.ADD_PRINT_BARCODE('2mm', '4mm', '33mm', '33mm', 'QRCode', data.material_code + '##' + data.supp_code);
|
||||
LODOP.ADD_PRINT_TEXT('5mm', '35mm', '80mm', '15mm', '物料编码:' + data.material_code);
|
||||
LODOP.ADD_PRINT_TEXT('12mm', '35mm', '80mm', '15mm', '物料名称:' + data.material_name);
|
||||
LODOP.ADD_PRINT_TEXT('19mm', '35mm', '80mm', '15mm', ' 规格:' + data.material_spec);
|
||||
LODOP.ADD_PRINT_TEXT('26mm', '35mm', '80mm', '15mm', ' 型号:' + data.material_model);
|
||||
LODOP.ADD_PRINT_TEXT('34mm', '5mm', '80mm', '15mm', ' 执行标准:' + data.execution_stand)
|
||||
LODOP.ADD_PRINT_TEXT('34mm', '59mm', '80mm', '15mm', '有效期(天):' + data.quality_time)
|
||||
LODOP.ADD_PRINT_TEXT('41mm', '5mm', '80mm', '15mm', ' 批次:' + data.pcsn)
|
||||
LODOP.ADD_PRINT_TEXT('41mm', '59mm', '80mm', '15mm', ' 生产日期:' + data.produce_time)
|
||||
LODOP.ADD_PRINT_TEXT('48mm', '5mm', '80mm', '15mm', '供应商编码:' + data.supp_code)
|
||||
LODOP.ADD_PRINT_TEXT('48mm', '59mm', '80mm', '15mm', '供应商名称:' + data.supp_name)
|
||||
LODOP.ADD_PRINT_TEXT('55mm', '5mm', '80mm', '15mm', ' 烘干次数:' + data.bake_num)
|
||||
// LODOP.PRINT();
|
||||
LODOP.PREVIEW()
|
||||
uni.showToast({
|
||||
title: '打印成功',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user