update
This commit is contained in:
139
src/views/common/order-auto-add.vue
Normal file
139
src/views/common/order-auto-add.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!row ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" v-loading="formLoading" :rules="dataRule" ref="dataForm" label-width="80px">
|
||||
<el-form-item label="标识卡号" prop="idenCardNum">
|
||||
<el-input v-model="dataForm.idenCardNum" @change="setIdenCardNum" ref="idenCardNum" placeholder="标识卡号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="dataForm.customerName" disabled placeholder="客户名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="材料牌号" prop="materialDes">
|
||||
<el-input v-model="dataForm.materialDes" disabled placeholder="材料牌号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderNo">
|
||||
<el-input v-model="dataForm.orderNo" disabled placeholder="订单号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="dataForm.productName" disabled placeholder="产品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input v-model="dataForm.quantity" placeholder="数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="dataForm.unit" disabled placeholder="单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input v-model="dataForm.weight" placeholder="重量"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
idenCardNum: null,
|
||||
customerName: null,
|
||||
materialDes: null,
|
||||
orderNo: null,
|
||||
productName: null,
|
||||
quantity: null,
|
||||
unit: null,
|
||||
weight: null
|
||||
},
|
||||
dataRule: {
|
||||
idenCardNum: [
|
||||
{ required: true, message: '标识卡号不能为空', trigger: 'blur' }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
weight: [
|
||||
{ required: true, message: '重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
formLoading: false,
|
||||
row: null,
|
||||
editIndex: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (row, idx) {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (row) {
|
||||
this.row = row
|
||||
this.dataForm = row
|
||||
this.editIndex = idx
|
||||
}
|
||||
this.$refs['idenCardNum'].focus()
|
||||
})
|
||||
},
|
||||
setIdenCardNum () {
|
||||
this.formLoading = true
|
||||
if (this.dataForm.idenCardNum) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/orderInfo/getTaskInfoByIdenCardNum`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'idenCardNum': this.dataForm.idenCardNum
|
||||
})
|
||||
}).then(({data}) => {
|
||||
console.log(data)
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm = data.data
|
||||
this.dataForm.targetQuantity = data.data.quantity
|
||||
this.dataForm.targetWeight = data.data.weight
|
||||
this.dataForm.weight = null
|
||||
this.dataForm.quantity = null
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
this.formLoading = false
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请输入标识卡号')
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.editIndex) {
|
||||
const taskList = JSON.parse(sessionStorage.getItem('autoTaskList'))
|
||||
taskList.splice(this.editIndex, 1, this.dataForm)
|
||||
sessionStorage.setItem('autoTaskList', JSON.stringify(taskList))
|
||||
} else if (sessionStorage.getItem('autoTaskList')) {
|
||||
const taskList = JSON.parse(sessionStorage.getItem('autoTaskList'))
|
||||
taskList.push(this.dataForm)
|
||||
sessionStorage.setItem('autoTaskList', JSON.stringify(taskList))
|
||||
} else {
|
||||
const arr = [this.dataForm]
|
||||
sessionStorage.setItem('autoTaskList', JSON.stringify(arr))
|
||||
}
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
0
src/views/common/order-auto-detail.vue
Normal file
0
src/views/common/order-auto-detail.vue
Normal file
268
src/views/common/order-auto-submit.vue
Normal file
268
src/views/common/order-auto-submit.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-04 10:22:13
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-05 12:09:38
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-qj-wms-ui\src\views\common\order-auto-submit.vue
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!row ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" v-loading="formLoading" :rules="dataRule" ref="dataForm" label-width="120px">
|
||||
<el-form-item label="自动任务类型" prop="autoTaskType">
|
||||
<el-select v-model="dataForm.autoTaskType" clearable @change="changeAutoTaskType">
|
||||
<el-option :value="1" label="淡化炉加工"></el-option>
|
||||
<el-option :value="2" label="多功能炉加工"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工类型" prop="processType">
|
||||
<el-select v-model="dataForm.processType" clearable>
|
||||
<el-option :value="0" label="初始加工" />
|
||||
<el-option :value="1" label="复加工" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="dataForm.autoTaskType === 2" label="开始加工炉">
|
||||
<el-form-item label="加工起点" prop="startPosition" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.startPosition" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option value="YYT003" label="液压台3"></el-option>
|
||||
<el-option value="YYT004" label="液压台4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工炉" prop="firstPosition" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.firstPosition" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option v-for="item in kilnList" :key="item.id" :value="item.id + ',' + item.code" :label="item.kilnName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺" prop="firstProcess" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.firstProcess" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option v-for="item in processList" :key="item.id" :value="item.code" :label="item.craftCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="清洗炉">
|
||||
<el-form-item label="加工起点" v-if="dataForm.autoTaskType !== 2" prop="startPosition" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.startPosition" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option value="YYT003" label="液压台3"></el-option>
|
||||
<el-option value="YYT004" label="液压台4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工炉" prop="secPosition" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.secPosition" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option v-for="item in kilnList" :key="item.id" :value="item.id + ',' + item.code" :label="item.kilnName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺" prop="secProcess" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.secProcess" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option v-for="item in processList" :key="item.id" :value="item.code" :label="item.craftCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束加工炉">
|
||||
<el-form-item label="加工炉" prop="thirdPosition" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.thirdPosition" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option v-for="item in kilnList" :key="item.id" :value="item.id + ',' + item.code" :label="item.kilnName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺" prop="thirdProcess" style="margin-bottom: 24px">
|
||||
<el-select v-model="dataForm.thirdProcess" :disabled="!(dataForm.autoTaskType)">
|
||||
<el-option v-for="item in processList" :key="item.id" :value="item.code" :label="item.craftCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
kilnList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
processList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
autoTaskType: null,
|
||||
processType: null,
|
||||
startPosition: null,
|
||||
firstPosition: null,
|
||||
firstProcess: null,
|
||||
secPosition: null,
|
||||
secProcess: null,
|
||||
thirdPosition: null,
|
||||
thirdProcess: null
|
||||
},
|
||||
dataRule: {
|
||||
autoTaskType: [
|
||||
{ required: true, message: '自动任务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
processType: [
|
||||
{ required: true, message: '加工类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
startPosition: [
|
||||
{ required: true, message: '加工起点不能为空', trigger: 'blur' }
|
||||
],
|
||||
firstPosition: [
|
||||
{ required: true, message: '加工炉不能为空', trigger: 'blur' }
|
||||
],
|
||||
firstProcess: [
|
||||
{ required: true, message: '工艺不能为空', trigger: 'blur' }
|
||||
],
|
||||
secPosition: [
|
||||
{ required: true, message: '加工炉不能为空', trigger: 'blur' }
|
||||
],
|
||||
secProcess: [
|
||||
{ required: true, message: '工艺不能为空', trigger: 'blur' }
|
||||
],
|
||||
thirdPosition: [
|
||||
{ required: true, message: '加工炉不能为空', trigger: 'blur' }
|
||||
],
|
||||
thirdProcess: [
|
||||
{ required: true, message: '工艺不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
dataList: [],
|
||||
formLoading: false,
|
||||
row: null,
|
||||
editIndex: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (list) {
|
||||
this.dataList = list
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
})
|
||||
},
|
||||
changeAutoTaskType () {
|
||||
this.dataForm.startPosition = null
|
||||
this.dataForm.firstPosition = null
|
||||
this.dataForm.firstProcess = null
|
||||
this.dataForm.secPosition = null
|
||||
this.dataForm.secProcess = null
|
||||
this.dataForm.thirdPosition = null
|
||||
this.dataForm.thirdProcess = null
|
||||
},
|
||||
setIdenCardNum () {
|
||||
this.formLoading = true
|
||||
if (this.dataForm.idenCardNum) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/orderInfo/getTaskInfoByIdenCardNum`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'idenCardNum': this.dataForm.idenCardNum
|
||||
})
|
||||
}).then(({data}) => {
|
||||
console.log(data)
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm = data.data
|
||||
this.dataForm.targetQuantity = data.data.quantity
|
||||
this.dataForm.targetWeight = data.data.weight
|
||||
this.dataForm.weight = null
|
||||
this.dataForm.quantity = null
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
this.formLoading = false
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请输入标识卡号')
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
const requestData = {
|
||||
taskCreateParamList: []
|
||||
}
|
||||
if (this.dataForm.autoTaskType === 1) {
|
||||
requestData.taskCreateParamList.push({
|
||||
autoTaskStep: 1,
|
||||
autoTaskType: this.dataForm.autoTaskType,
|
||||
craftCode: this.dataForm.secProcess,
|
||||
detParams: this.dataList,
|
||||
kilnId: this.dataForm.secPosition.split(',')[0],
|
||||
processType: this.dataForm.processType,
|
||||
startPosition: this.dataForm.startPosition,
|
||||
targetPosition: this.dataForm.secPosition.split(',')[1]
|
||||
})
|
||||
requestData.taskCreateParamList.push({
|
||||
autoTaskStep: 2,
|
||||
autoTaskType: this.dataForm.autoTaskType,
|
||||
craftCode: this.dataForm.thirdProcess,
|
||||
detParams: this.dataList,
|
||||
kilnId: this.dataForm.thirdPosition.split(',')[0],
|
||||
processType: this.dataForm.processType,
|
||||
startPosition: this.dataForm.secPosition.split(',')[1],
|
||||
targetPosition: this.dataForm.thirdPosition.split(',')[1]
|
||||
})
|
||||
} else if (this.dataForm.autoTaskType === 2) {
|
||||
requestData.taskCreateParamList.push({
|
||||
autoTaskStep: 1,
|
||||
autoTaskType: this.dataForm.autoTaskType,
|
||||
craftCode: this.dataForm.secProcess,
|
||||
detParams: this.dataList,
|
||||
kilnId: this.dataForm.firstPosition.split(',')[0],
|
||||
processType: this.dataForm.processType,
|
||||
startPosition: this.dataForm.startPosition,
|
||||
targetPosition: this.dataForm.firstPosition.split(',')[1]
|
||||
})
|
||||
requestData.taskCreateParamList.push({
|
||||
autoTaskStep: 2,
|
||||
autoTaskType: this.dataForm.autoTaskType,
|
||||
craftCode: this.dataForm.secProcess,
|
||||
detParams: this.dataList,
|
||||
kilnId: this.dataForm.secPosition.split(',')[0],
|
||||
processType: this.dataForm.processType,
|
||||
startPosition: this.dataForm.firstPosition.split(',')[1],
|
||||
targetPosition: this.dataForm.secPosition.split(',')[1]
|
||||
})
|
||||
requestData.taskCreateParamList.push({
|
||||
autoTaskStep: 3,
|
||||
autoTaskType: this.dataForm.autoTaskType,
|
||||
craftCode: this.dataForm.thirdProcess,
|
||||
detParams: this.dataList,
|
||||
kilnId: this.dataForm.thirdPosition.split(',')[0],
|
||||
processType: this.dataForm.processType,
|
||||
startPosition: this.dataForm.secPosition.split(',')[1],
|
||||
targetPosition: this.dataForm.thirdPosition.split(',')[1]
|
||||
})
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`currTask/createAutoTask`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(requestData)
|
||||
}).then(({data}) => {
|
||||
console.log(data)
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success('任务提交成功')
|
||||
this.dataList = []
|
||||
sessionStorage.setItem('autoTaskList', '')
|
||||
this.$emit('refreshDataList')
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
344
src/views/common/order-auto.vue
Normal file
344
src/views/common/order-auto.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<div class="auto-session">
|
||||
<el-row style="margin: 10px 0; font-weight: bold">
|
||||
未下发自动任务
|
||||
</el-row>
|
||||
<el-form :inline="true" style="display: flex; align-items: center; justify-content: right;">
|
||||
<el-form-item style="flex: 1;float: left">
|
||||
<el-button size="small" type="primary" @click="addOrUpdateHandle()">
|
||||
<icon-svg class="iconClass" name="新建"></icon-svg>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left:1%">
|
||||
<el-button type="primary" size="small" @click="handleSubmit()">提交任务</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
:stripe="true"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266',height: '56px'}"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="序号"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="idenCardNum"
|
||||
label="标识卡">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="customerName"
|
||||
label="客户名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="orderNo"
|
||||
label="订单号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productName"
|
||||
label="产品名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialDes"
|
||||
label="材料号牌">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="finishQuantity"
|
||||
label="已完成数">
|
||||
<template slot-scope="scope">
|
||||
{{ `${scope.row.finishQuantity}/${scope.row.targetQuantity}` }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="quantity"
|
||||
label="数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="weight"
|
||||
label="重量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="unit"
|
||||
label="单位">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row, scope.$index)">
|
||||
<el-tooltip class="item" effect="dark" content="修改" placement="top">
|
||||
<icon-svg class="iconClass" name="编辑"></icon-svg>
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
<el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.$index)">
|
||||
<el-tooltip class="item" effect="dark" content="删除" placement="top">
|
||||
<icon-svg class="iconClass" name="删除"></icon-svg>
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="auto-undo">
|
||||
<el-row style="margin: 10px 0; font-weight: bold">
|
||||
未完成自动任务
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="autoList"
|
||||
:stripe="true"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266',height: '56px'}"
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="序号"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="processFlowType"
|
||||
label="自动任务类型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.processFlowType === 1 ? '淡化炉加工' : scope.row.processFlowType === 2 ? '多功能炉加工' : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="状态">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '未开始' : scope.row.status === 1 ? '执行中' : scope.row.status === 2 ? '完成' : scope.row.status === 3 ? '终止' : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleAutoDetail(scope.row.id)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" style="color:red" size="small" @click="stopHandle(scope.row.id)">
|
||||
<el-tooltip class="item" effect="dark" content="停止" placement="top">
|
||||
<icon-svg class="iconClass" name="stop"></icon-svg>
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||
<process-point v-if="processPointVisible" ref="processPoint" @refreshPoint="setPoint" />
|
||||
<submit-form v-if="submitFormVisible" ref="submitForm" :kilnList="eqList" :processList="processList" @refreshDataList="getDataList" />
|
||||
<auto-detail v-if="autoDetailVisible" ref="autoDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './order-auto-add'
|
||||
import SubmitForm from './order-auto-submit'
|
||||
import ProcessPoint from './order-process-point'
|
||||
import AutoDetail from './order-auto-detail'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
startPosition: '',
|
||||
kilnId: '',
|
||||
targetPosition: '',
|
||||
dataList: [],
|
||||
autoList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
processType: null,
|
||||
addOrUpdateVisible: false,
|
||||
processPointVisible: false,
|
||||
submitFormVisible: false,
|
||||
autoDetailVisible: false,
|
||||
eqList: [],
|
||||
processList: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
ProcessPoint,
|
||||
SubmitForm,
|
||||
AutoDetail
|
||||
},
|
||||
activated () {
|
||||
this.getDictList()
|
||||
this.getDataList()
|
||||
this.getAutoDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取窑炉、工艺列表
|
||||
getDictList () {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/kilnInfo/page'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.eqList = data.data.records
|
||||
} else {
|
||||
this.eqList = []
|
||||
}
|
||||
})
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/craftInfo/page'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.processList = data.data.records
|
||||
} else {
|
||||
this.processList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getAutoDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getAutoDataList()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataList = sessionStorage.getItem('autoTaskList') ? JSON.parse(sessionStorage.getItem('autoTaskList')) : []
|
||||
// if (data && data.code === 0) {
|
||||
// this.dataList = data.data.records
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
},
|
||||
// 获取已下发自动任务
|
||||
getAutoDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/autoTask/page'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'current': this.pageIndex,
|
||||
'size': this.pageSize
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.autoList = data.data.records
|
||||
this.totalPage = data.data.total
|
||||
} else {
|
||||
this.autoList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (row, idx) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row, idx)
|
||||
})
|
||||
},
|
||||
// 获取点位
|
||||
getPoint (pointType) {
|
||||
this.processPointVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.processPoint.init(pointType)
|
||||
})
|
||||
},
|
||||
setPoint (count, pointType) {
|
||||
if (!pointType) {
|
||||
this.startPosition = count
|
||||
} else {
|
||||
this.kilnId = count
|
||||
this.targetPosition = count
|
||||
}
|
||||
},
|
||||
// 弹出提交任务弹窗
|
||||
handleSubmit () {
|
||||
this.submitFormVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.submitForm.init(this.dataList)
|
||||
})
|
||||
},
|
||||
handleAutoDetail (id) {
|
||||
this.autoDetailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.autoDetail.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (idx) {
|
||||
console.log(idx)
|
||||
this.$confirm(`确定对第${idx + 1}项进行删除操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dataList.splice(idx, 1)
|
||||
sessionStorage.setItem('autoTaskList', JSON.stringify(this.dataList))
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 终止自动任务
|
||||
stopHandle (id) {
|
||||
this.$confirm(`确定对[id=${id}]进行停止操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/autoTask/stop'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({id})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
135
src/views/common/testdata.js
Normal file
135
src/views/common/testdata.js
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-04 14:09:53
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-03-04 14:15:15
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-qj-wms-ui\src\views\common\testdata.js
|
||||
*/
|
||||
export default {
|
||||
"taskCreateParamList": [
|
||||
{
|
||||
"autoTaskStep": 0,
|
||||
"autoTaskType": 0,
|
||||
"craftCode": "",
|
||||
"detParams": [
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
}
|
||||
],
|
||||
"kilnId": 1,
|
||||
"processType": 0,
|
||||
"startPosition": "",
|
||||
"targetPosition": ""
|
||||
},
|
||||
{
|
||||
"autoTaskStep": 1,
|
||||
"autoTaskType": 0,
|
||||
"craftCode": "",
|
||||
"detParams": [
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
}
|
||||
],
|
||||
"kilnId": 1,
|
||||
"processType": 0,
|
||||
"startPosition": "",
|
||||
"targetPosition": ""
|
||||
},
|
||||
{
|
||||
"autoTaskStep": 2,
|
||||
"autoTaskType": 0,
|
||||
"craftCode": "",
|
||||
"detParams": [
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"customerName": "",
|
||||
"idenCardNum": "",
|
||||
"materialDes": "",
|
||||
"orderNo": "",
|
||||
"productName": "",
|
||||
"quantity": 0,
|
||||
"unit": "",
|
||||
"weight": 0
|
||||
}
|
||||
],
|
||||
"kilnId": 1,
|
||||
"processType": 0,
|
||||
"startPosition": "",
|
||||
"targetPosition": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user