修改接口

This commit is contained in:
朱文强 2021-12-01 19:04:33 +08:00
parent e0e522c4c5
commit 9fe84a5697
2 changed files with 140 additions and 55 deletions

View File

@ -11,7 +11,7 @@
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="80px" label-width="80px"
> >
<el-form-item label="任务类型" prop="taskType"> <!-- <el-form-item label="任务类型" prop="taskType">
<el-select <el-select
v-model="dataForm.taskType" v-model="dataForm.taskType"
placeholder="任务类型0 出库1入库" placeholder="任务类型0 出库1入库"
@ -20,7 +20,7 @@
<el-option label="出库" :value="0"></el-option> <el-option label="出库" :value="0"></el-option>
<el-option label="入库" :value="1"></el-option> <el-option label="入库" :value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="产品编码" prop="model"> <el-form-item label="产品编码" prop="model">
<el-autocomplete <el-autocomplete
class="inline-input" class="inline-input"
@ -31,22 +31,35 @@
clearable clearable
></el-autocomplete> ></el-autocomplete>
</el-form-item> </el-form-item>
<!-- <el-form-item label="起点" prop="startPoint"> <el-form-item label="起点" prop="startPoint">
<el-input v-model="dataForm.startPoint" placeholder="起点"></el-input> <el-select v-model="dataForm.startPoint" filterable placeholder="请选择起点">
</el-form-item> --> <el-option
<!-- <el-form-item label="终点" prop="endPoint"> v-for="item in PointArr"
<el-input v-model="dataForm.endPoint" placeholder="终点"></el-input> :key="item.id"
</el-form-item> --> :label="item.anotherName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终点" prop="endPoint">
<el-select v-model="dataForm.endPoint" filterable placeholder="请选择终点">
<el-option
v-for="item in PointArr"
:key="item.id"
:label="item.anotherName"
:value="item.id">
</el-option>
</el-form-item>
<el-form-item label="数量" prop="num"> <el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="数量" oninput = "value=value.replace(/[^\d]/g,'')"></el-input> <el-input v-model="dataForm.num" placeholder="数量" oninput = "value=value.replace(/[^\d]/g,'')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="批次号" prop="dateNum"> <!-- <el-form-item label="批次号" prop="dateNum">
<el-input <el-input
v-model="dataForm.dateNum" v-model="dataForm.dateNum"
placeholder="请填写批次号" placeholder="请填写批次号"
></el-input> ></el-input>
<!-- oninput = "value=value.replace(/[^\d]/g,'')" --> oninput = "value=value.replace(/[^\d]/g,'')"
</el-form-item> </el-form-item> -->
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="dataForm.remarks" placeholder="备注"></el-input> <el-input v-model="dataForm.remarks" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
@ -67,29 +80,30 @@ export default {
id: 0, id: 0,
taskType: '', taskType: '',
model: '', model: '',
// startPoint: '', startPoint: '',
// endPoint: '', endPoint: '',
num: '', num: '',
unit: '', unit: '',
remarks: '', remarks: '',
dateNum: '' dateNum: ''
}, },
PointArr: [],
dataRule: { dataRule: {
taskType: [ // taskType: [
{ required: true, message: '任务类型不能为空', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
], // ],
model: [ model: [
{ required: true, message: '型号不能为空', trigger: 'blur' } { required: true, message: '型号不能为空', trigger: 'blur' }
], ],
num: [ num: [
{ required: true, message: '数量不能为空', trigger: 'blur' } { required: true, message: '数量不能为空', trigger: 'blur' }
],
startPoint: [
{ required: true, message: '起点不能为空', trigger: 'change' }
],
endPoint: [
{ required: true, message: '终点不能为空', trigger: 'change' }
] ]
// startPoint: [
// { required: true, message: '', trigger: 'blur' }
// ],
// endPoint: [
// { required: true, message: '', trigger: 'blur' }
// ]
} }
} }
}, },
@ -100,13 +114,19 @@ export default {
}, },
methods: { methods: {
init (id) { init (id) {
if (this.inout === 1) { // if (this.inout === 1) {
this.dataForm.taskType = 0 // this.dataForm.taskType = 0
} else if (this.inout === 2) { // } else if (this.inout === 2) {
this.dataForm.taskType = 1 // this.dataForm.taskType = 1
} // }
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.$http({
url: this.$http.adornUrl('/generator/mtccwarehousrank/list'),
method: 'post'
}).then(({data}) => {
this.PointArr = data.list
})
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
@ -148,11 +168,11 @@ export default {
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': this.dataForm.id || undefined, 'id': this.dataForm.id || undefined,
'taskType': this.dataForm.taskType, // 'taskType': this.dataForm.taskType,
'model': this.dataForm.model, 'model': this.dataForm.model,
'num': this.dataForm.num, 'num': this.dataForm.num,
// 'startPoint': this.dataForm.startPoint, 'startPoint': this.dataForm.startPoint,
// 'endPoint': this.dataForm.endPoint, 'endPoint': this.dataForm.endPoint,
'remarks': this.dataForm.remarks, 'remarks': this.dataForm.remarks,
'dateNum': this.dataForm.dateNum 'dateNum': this.dataForm.dateNum
}) })

View File

@ -10,7 +10,7 @@
</el-form-item> --> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button @click="getDataListShow()">刷新</el-button> <el-button @click="getDataListShow()">刷新</el-button>
<el-button type="success" @click="showTask()">执行演示任务</el-button> <!-- <el-button type="success" @click="showTask()">执行演示任务</el-button> -->
<el-button <el-button
v-if="isAuth('generator:mtcctaskruninfo:save')" v-if="isAuth('generator:mtcctaskruninfo:save')"
type="primary" type="primary"
@ -26,6 +26,14 @@
:disabled="dataListSelections.length <= 0" :disabled="dataListSelections.length <= 0"
>批量删除</el-button> --> >批量删除</el-button> -->
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="success" @click="showTask(1)">执行单托盘演示任务</el-button>
<el-button type="success" @click="showTask(2)">执行多托盘演示任务</el-button>
<el-button type="success" @click="showTask(0)">暂停演示任务</el-button>
</el-form-item>
<el-form-item>
<span style="margin-left:20px"><el-tag type="warning">已执行任务记数:{{showTaskMsg}}</el-tag></span>
</el-form-item>
</el-form> </el-form>
<el-table <el-table
:data="dataList" :data="dataList"
@ -201,19 +209,19 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> --> </div> -->
<el-dialog <!-- <el-dialog
title="信息" title="信息"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:show-close="false" :show-close="false"
width="30%" width="30%"
> >演示任务弹窗
<span>{{taskMsg}}</span> <span>{{taskMsg}}</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-show="showTaskBtn" @click="dialogVisible = false"> </el-button> <el-button v-show="showTaskBtn" @click="dialogVisible = false"> </el-button>
</span> </span>
</el-dialog> </el-dialog> -->
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update <add-or-update
:inout="inout" :inout="inout"
@ -249,6 +257,7 @@ export default {
btnText: '执行任务', btnText: '执行任务',
dialogVisible: false, dialogVisible: false,
taskMsg: '演示任务正在执行,请勿操作', taskMsg: '演示任务正在执行,请勿操作',
showTaskMsg: 0,
showTaskBtn: false, showTaskBtn: false,
sTaskInfo: [], sTaskInfo: [],
sTaskInfoNum: 0, sTaskInfoNum: 0,
@ -339,22 +348,68 @@ export default {
this.$refs.infoDet.init(row, bol) this.$refs.infoDet.init(row, bol)
}) })
}, },
showTask () { showTask (type) {
this.dialogVisible = true // this.dialogVisible = true
this.taskMsg = '演示任务正在执行,请勿操作' // this.taskMsg = ''
this.showTaskBtn = false // this.showTaskBtn = false
// this.$http({
// url: this.$http.adornUrl('/generator/mtcctaskruninfo/runExampleTask'),
// method: 'post'
// }).then(({ data }) => {
// if (data.code === 0 && data) {
// this.dialogVisible = false
// } else {
// this.$message.error(data.msg)
// this.taskMsg = data.msg
// this.showTaskBtn = true
// }
// })
if (type === 0) {
this.$http({
url: this.$http.adornUrl('/generator/mtcctaskruninfo/setOff'),
method: 'post'
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
} else {
this.$message.error(data.msg)
}
})
} else if (type === 1) {
this.$http({
url: this.$http.adornUrl('/generator/mtcctaskruninfo/runOneTask'),
method: 'post'
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
} else {
this.$message.error(data.msg)
}
})
} else if (type === 2) {
this.$http({ this.$http({
url: this.$http.adornUrl('/generator/mtcctaskruninfo/runExampleTask'), url: this.$http.adornUrl('/generator/mtcctaskruninfo/runExampleTask'),
method: 'post' method: 'post'
}).then(({ data }) => { }).then(({ data }) => {
if (data.code === 0 && data) { if (data && data.code === 0) {
this.dialogVisible = false this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
this.taskMsg = data.msg
this.showTaskBtn = true
} }
}) })
}
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle (val) {
@ -407,16 +462,26 @@ export default {
}, },
showSTaskInfo () { showSTaskInfo () {
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl('/generator/mtcctaskruninfo/alreadyRun'),
'/generator/mtcctaskruninfodet/taskruninfodetlist'
),
method: 'post' method: 'post'
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.sTaskInfo = data.list this.showTaskMsg = data.msg
this.sTaskInfoNum = this.sTaskInfo.length } else {
this.$message.error(data.msg)
} }
}) })
// this.$http({
// url: this.$http.adornUrl(
// '/generator/mtcctaskruninfodet/taskruninfodetlist'
// ),
// method: 'post'
// }).then(({ data }) => {
// if (data && data.code === 0) {
// this.sTaskInfo = data.list
// this.sTaskInfoNum = this.sTaskInfo.length
// }
// })
}, },
sTaskClick () { sTaskClick () {
this.openSTask = !this.openSTask this.openSTask = !this.openSTask