修改订单工序

This commit is contained in:
2024-09-01 16:21:54 +08:00
parent 70a073cecf
commit 2f0b9b40bc
23 changed files with 4158 additions and 510 deletions

View File

@@ -23,43 +23,41 @@
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">订单号</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="val3" @input="_handheldGetRegionCode">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">物料号</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="val4">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">物料数量</span>
</view>
<view class="zd-col-19">
<input type="number" class="filter_input" v-model="val5">
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">目的地</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="val6">
<input type="text" class="filter_input" v-model="val3">
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>操作</th>
<th>订单号</th>
<th>物料号</th>
<th>物料数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="addRow"><uni-icons type="plus-filled" size="30" color="#4e6ef2"></uni-icons></td>
<td><input type="text" class="td_input" v-model="e.order_code"></td>
<td><input type="text" class="td_input" v-model="e.material_code"></td>
<td><input type="number" class="td_input" v-model="e.material_qty"></td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val6 || !val2 || !val3 || !val4 || !val5}" :disabled="disabled" @tap="_handheldBlanking">入库确认</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val2 || !val3}" :disabled="disabled" @tap="_handheldBlanking">入库确认</button>
</view>
</view>
</template>
@@ -67,7 +65,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {handheldGetRegionCode, handheldBlanking} from '@/utils/getData2.js'
import {handheldBlanking} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -79,39 +77,32 @@
val1: '',
val2: '',
val3: '',
val4: '',
val5: '',
val6: '',
disabled: false
disabled: false,
dataList: [{order_code: '', material_code: '', material_qty: 0}]
};
},
onLoad (options) {
this.title = options.title
},
methods: {
async _handheldGetRegionCode () {
let res = await handheldGetRegionCode(this.val3)
if (res.content.length > 0) {
this.val6 = res.content[0].region_code
}
addRow () {
this.dataList.push({order_code: '', material_code: '', material_qty: 0})
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.val4 = ''
this.val5 = ''
this.val6 = ''
this.dataList = [{order_code: '', material_code: '', material_qty: 0}]
this.disabled = false
},
async _handheldBlanking () {
this.disabled = true
if (!this.val1 || !this.val6 || !this.val2 || !this.val3 || !this.val4 || !this.val5) {
if (!this.val1 || !this.val2 || !this.val3) {
this.disabled = false
return
}
try {
let res = await handheldBlanking(this.val1, this.val6, this.val2, {order_code: this.val3, material_code: this.val4, material_qty: this.val5})
let res = await handheldBlanking(this.val1, this.val3, this.val2, this.dataList)
this.clearUp()
} catch (e) {
this.disabled = false

View File

@@ -0,0 +1,116 @@
<template>
<view class="zd_container">
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<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">
<td>{{e.order_code}}</td>
<td>
<view class="td_select">
<uni-data-select v-model="e.process" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</td>
<td>
<uni-datetime-picker
type="datetime"
v-model="e.time"
@change="changeLog"
/>
</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="_handheldBlanking">入库确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {regionList, modifyProcess} from '@/utils/mork2.js'
import {handheldBlanking} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
options: [],
index: '',
disabled: false,
dataList: [],
show: false
};
},
onLoad (options) {
this.title = options.title
this._regionList()
},
methods: {
async _regionList () {
let res = await regionList()
this.options = [...res.content]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
this._modifyProcess()
},
async _modifyProcess () {
let res = await modifyProcess()
this.dataList = [...res]
},
selectChange (val) {
console.log(val)
},
changeLog (e) {
console.log(e)
},
clearUp () {
this.dataList = []
this.disabled = false
},
async _handheldBlanking () {
this.disabled = true
if (!this.dataList.length) {
this.disabled = false
return
}
try {
let res = await handheldBlanking(this.dataList)
this.clearUp()
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus" scoped>
.zd_content
height: calc(100% - var(--status-bar-height) - 212rpx);
padding: 20rpx 14rpx 0 14rpx;
.grid-wraper
height: 100%;
overflow: auto;
.slide_new table td, .slide_new table th
overflow: visible;
</style>