opt: 优化创建任务的参数和页面
This commit is contained in:
@@ -80,15 +80,15 @@
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="formDia" :title="crud.status.title" width="520px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="formDia" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px" :inline="true">
|
||||
<el-form-item v-if="false" label="任务标识" prop="task_id">
|
||||
<el-input v-model="form.task_id" style="width: 370px;" />
|
||||
<el-input v-model="form.task_id" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型">
|
||||
<el-select
|
||||
v-model="form.material"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -104,7 +104,7 @@
|
||||
<el-form-item label="任务类型">
|
||||
<el-select
|
||||
v-model="form.task_type"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -120,7 +120,7 @@
|
||||
<el-form-item v-if="form.task_type == '7'" label="立库任务类型">
|
||||
<el-select
|
||||
v-model="form.storage_task_type"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -136,7 +136,7 @@
|
||||
<el-form-item label="agv系统">
|
||||
<el-select
|
||||
v-model="form.agv_system_type"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
@@ -153,7 +153,7 @@
|
||||
<el-form-item label="路由方案">
|
||||
<el-select
|
||||
v-model="form.route_plan_code"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
default-first-option
|
||||
@@ -170,7 +170,7 @@
|
||||
<el-form-item label="起点" prop="start_point_code">
|
||||
<el-select
|
||||
v-model="form.start_point_code"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="showStartStorage"
|
||||
@@ -186,7 +186,7 @@
|
||||
<el-form-item v-show="start_flag" label="起点-列" prop="from_y">
|
||||
<el-select
|
||||
v-model="form.from_y"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -202,7 +202,7 @@
|
||||
<el-form-item v-show="start_flag" label="起点-层" prop="from_z">
|
||||
<el-select
|
||||
v-model="form.from_z"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -218,7 +218,7 @@
|
||||
<el-form-item label="终点" prop="next_point_code">
|
||||
<el-select
|
||||
v-model="form.next_point_code"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="showEndStorage"
|
||||
@@ -234,7 +234,7 @@
|
||||
<el-form-item v-show="end_flag" label="终点-列" prop="to_y">
|
||||
<el-select
|
||||
v-model="form.to_y"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -250,7 +250,7 @@
|
||||
<el-form-item v-show="end_flag" label="终点-层" prop="to_z">
|
||||
<el-select
|
||||
v-model="form.to_z"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
@@ -267,7 +267,7 @@
|
||||
<el-form-item label="起点2" prop="start_point_code2">
|
||||
<el-select
|
||||
v-model="form.start_point_code2"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
>
|
||||
@@ -282,7 +282,7 @@
|
||||
<el-form-item label="终点2" prop="next_point_code2">
|
||||
<el-select
|
||||
v-model="form.next_point_code2"
|
||||
style="width: 370px;"
|
||||
style="width: 240px;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
>
|
||||
@@ -295,29 +295,113 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级">
|
||||
<el-input v-model="form.priority" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.priority" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="载具号">
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.vehicle_code" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.task_type === '4'" label="取货高度" prop="start_height">
|
||||
<el-input v-model="form.start_height" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.start_height" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.task_type === '4'" label="放货高度" prop="next_height">
|
||||
<el-input v-model="form.next_height" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.next_height" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="行架任务类型">
|
||||
<el-input v-model="form.truss_type" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.truss_type" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="气胀轴代数">
|
||||
<el-input v-model="form.version" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.version" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="套管数量">
|
||||
<el-input v-model="form.bushing_num" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.bushing_num" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否套轴">
|
||||
<el-input v-model="form.is_bushing" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.is_bushing" style="width: 240px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<!-- 页面中的表单项 -->
|
||||
<el-form-item label="纸管数组">
|
||||
<el-button v-if="showAddRowButton" @click="addNewRow">添加新行</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form :model="form">
|
||||
<el-table
|
||||
style="width: 100%;"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
:data="form.paperArray"
|
||||
stripe
|
||||
border
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="50" />
|
||||
<el-table-column label="设备编码" prop="device_code" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.device_code"
|
||||
style="width: 100%;"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="isDisabled=false"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_code"
|
||||
:label="item.device_code"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料编码" prop="material_code" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.material_code" style="width: 100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="qty" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-form-item
|
||||
:prop="'paperArray.'+ scope.$index + '.qty'"
|
||||
:rules="[
|
||||
{ required: true, message: '数量不能为空!', trigger: 'blur' }
|
||||
]"
|
||||
>
|
||||
<el-input-number v-model="scope.row.qty" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="danger" icon="el-icon-minus" circle @click="deleteField(scope.$index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item v-for="(item, index) in form.paperArray" :key="index" label="纸管数组">
|
||||
<el-input v-model="item.device_code" placeholder="设备编码" />
|
||||
<el-input v-model="item.material_code" placeholder="物料编码" />
|
||||
<el-input v-model="item.qty" placeholder="数量" />
|
||||
<el-button v-if="showAddRowButton" @click="addNewRow">添加新行</el-button>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item v-for="(group, groupIndex) in paperArrays" :key="groupIndex">
|
||||
<div>
|
||||
<h3>纸管数组 {{ groupIndex + 1 }}</h3>
|
||||
<el-form-item v-for="(item, index) in group" :key="index" :label="'纸管 ' + (index + 1)">
|
||||
<el-input v-model="item.device_code" placeholder="设备编码" />
|
||||
<el-input v-model="item.material_code" placeholder="物料编码" />
|
||||
<el-input v-model="item.qty" placeholder="数量" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button> -->
|
||||
<!-- <el-button type="primary" @click="addItem">添加一行</el-button>
|
||||
<el-form ref="gridFieldFrom" :model="gridFieldFrom">
|
||||
<el-table
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
class="mt-10"
|
||||
:data="gridFieldFrom.gridFieldData"
|
||||
stripe
|
||||
border
|
||||
/>
|
||||
</el-form> -->
|
||||
<el-form-item label="描述信息" prop="description">
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
@@ -491,6 +575,7 @@ export default {
|
||||
edit: ['admin', 'task:edit'],
|
||||
del: ['admin', 'task:del']
|
||||
},
|
||||
showAddRowButton: true,
|
||||
form: {
|
||||
task_id: null,
|
||||
vehicle_code: null,
|
||||
@@ -521,7 +606,18 @@ export default {
|
||||
truss_type: null,
|
||||
version: null,
|
||||
bushing_num: null,
|
||||
is_bushing: null
|
||||
is_bushing: null,
|
||||
paperArray: [{
|
||||
device_code: '',
|
||||
material_code: '',
|
||||
qty: ''
|
||||
}/* ,
|
||||
{
|
||||
device_code: '',
|
||||
material_code: '',
|
||||
qty: ''
|
||||
} */
|
||||
]
|
||||
},
|
||||
rules: {
|
||||
start_height: [
|
||||
@@ -574,10 +670,24 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
addNewRow() {
|
||||
this.form.paperArray.push({
|
||||
device_code: '',
|
||||
material_code: '',
|
||||
qty: ''
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
deleteField(index) { // 添加字段的时候删除一条数据
|
||||
console.log(index)
|
||||
if (this.form.paperArray.length > 1) {
|
||||
this.form.paperArray.splice(index, 1)
|
||||
}
|
||||
console.log(this.form.paperArray)
|
||||
},
|
||||
finish(index, row) {
|
||||
crudTask.finish(row.task_id).then(res => {
|
||||
this.crud.toQuery()
|
||||
|
||||
Reference in New Issue
Block a user