123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item label="任务编号" prop="taskNo">
- <el-input
- v-model="queryParams.taskNo"
- placeholder="请输入任务编号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="起始区域" prop="areaFrom">
-
-
-
-
-
-
-
- <el-select v-model="queryParams.areaFrom" @change="locationZoneFromChange" placeholder="请选择起始区域" clearable
- size="small" style="width: 100%">
- <el-option
- v-for="dict in this.locationZoneCombo"
- :key="dict.zoneId"
- :label="dict.zoneName"
- :value="dict.zoneId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="起始点位" prop="locationFrom">
- <el-input
- v-model="queryParams.locationFrom"
- placeholder="请输入起始点位"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="终点点位" prop="locationTo">
- <el-input
- v-model="queryParams.locationTo"
- placeholder="请输入终点点位"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="终点区域" prop="areaTo">
-
-
-
-
-
-
-
- <el-select v-model="queryParams.areaTo" @change="locationZoneToChange" placeholder="请选择终点区域" clearable
- size="small" style="width: 100%">
- <el-option
- v-for="dict in this.locationZoneCombo"
- :key="dict.zoneId"
- :label="dict.zoneName"
- :value="dict.zoneId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="ִ状态" prop="state">
- <el-select v-model="queryParams.state" clearable placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
-
-
-
-
-
-
-
-
-
- <el-form-item label="创建时间" prop="createDate">
- <el-date-picker
- v-model="dateRange"
- size="small"
- style="width: 240px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <el-form-item label="任务类型" prop="ext7">
- <el-select v-model="queryParams.ext7" placeholder="请选择类型" clearable size="small">
- <el-option
- v-for="dict in taskTypeCombo"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="托盘号" prop="ext5">
- <el-input
- v-model="queryParams.ext5"
- placeholder="请输入托盘号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="单据号" prop="ext6">
- <el-input
- v-model="queryParams.ext6"
- placeholder="请输入单据号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
-
-
-
-
-
-
-
-
-
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['ams:wcsTask:add']"
- >新增</el-button>
- </el-col>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="wcsTaskList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="任务编号" align="center" prop="taskNo" width="180"/>
-
-
-
- <el-table-column label="起始区域" align="center" prop="areaFrom" />
- <el-table-column label="起始点位" align="center" prop="locationFrom" />
- <el-table-column label="终点点位" align="center" prop="locationTo" />
- <el-table-column label="终点区域" align="center" prop="areaTo" />
-
- <el-table-column label="ִ状态" align="center" prop="state" >
- <template slot-scope="scope">
- <div v-if="scope.row.state === 1">开始</div>
- <div v-if="scope.row.state === 2">完成</div>
- <div v-if="scope.row.state === 3">开始取货</div>
- <div v-if="scope.row.state === 4">取货完成</div>
- <div v-if="scope.row.state === 5">开始卸货</div>
- <div v-if="scope.row.state === 6">卸货完成</div>
- <div v-if="scope.row.state === 7">取消</div>
- <div v-if="scope.row.state === 8">异常</div>
- <div v-if="scope.row.state === 9">待下发</div>
- <div v-if="scope.row.state === 10">已下发</div>
- <div v-if="scope.row.state === 11">取消并归于起点</div>
- <div v-if="scope.row.state === 12">取消并归于终点</div>
- <div v-if="scope.row.state === 13">取货待确认</div>
- <div v-if="scope.row.state === 14">卸货待确认</div>
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center" prop="remark" />
-
- <el-table-column label="创建时间" align="center" prop="createDate" width="200"/>
-
- <el-table-column label="任务开始时间" align="center" prop="startTime"/>
- <el-table-column label="任务结束时间" align="center" prop="endTime"/>
-
-
- <el-table-column label="任务类型" align="center" prop="ext7">
- <template slot-scope="scope">
- <div v-if="scope.row.ext7 === '5'">入库</div>
- <div v-if="scope.row.ext7 === '6'">出库</div>
- <div v-if="scope.row.ext7 === '9'">回库</div>
- <div v-if="scope.row.ext7 === '10'">移库</div>
- </template>
- </el-table-column>
- <el-table-column label="托盘号" align="center" prop="ext5" />
- <el-table-column label="单据号" align="center" prop="ext6" width="200" />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed = "right">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.state !== 4 && scope.row.state !== 2 && scope.row.state !== 11 && scope.row.state !== 12"
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handlePickupCompleted(scope.row)">取货完成</el-button>
- <el-button
- v-if="(scope.row.state == 4) || (scope.row.state !== 2 && scope.row.state !== 11 && scope.row.state !== 12)"
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleComplete(scope.row)">卸货完成</el-button>
- <el-button
- v-if="scope.row.state !== 7 && scope.row.state !== 2 && scope.row.state !== 11 && scope.row.state !== 12"
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleCancel(scope.row)"
- v-hasPermi="['ams:wcsTask:remove']"
- >取消</el-button>
-
-
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
-
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-form-item label="任务类型" prop="businessType">
- <el-select v-model="form.businessType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
- <el-option
- v-for="dict in businessTypeCombo"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="是否转发" prop="businessType">
- <el-select v-model="form.taskType" placeholder="请选择" clearable size="small" style="width: 100%">
- <el-option
- v-for="dict in isYesAndNoCombo"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="起始区域" prop="areaFrom">
- <el-select v-model="form.areaFrom" @change="locationZoneFromChange" placeholder="请选择库区" clearable
- size="small" style="width: 100%">
- <el-option
- v-for="dict in this.locationZoneCombo"
- :key="dict.zoneId"
- :label="dict.zoneName"
- :value="dict.zoneId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="起始点位" prop="locationFrom">
- <el-select v-model="form.locationFrom" placeholder="请选择库位" clearable size="small" style="width: 100%">
- <el-option
- v-for="dict in locationFromCombo"
- :key="dict.id"
- :label="dict.locationNo"
- :value="dict.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="目标区域" prop="areaTo">
- <el-select v-model="form.areaTo" @change="locationZoneToChange" placeholder="请选择库区" clearable
- size="small" style="width: 100%">
- <el-option
- v-for="dict in this.locationZoneCombo"
- :key="dict.zoneId"
- :label="dict.zoneName"
- :value="dict.zoneId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="终点点位" prop="locationTo">
- <el-select v-model="form.locationTo" placeholder="请选择库位" clearable size="small" style="width: 100%">
- <el-option
- v-for="dict in locationToCombo"
- :key="dict.id"
- :label="dict.locationNo"
- :value="dict.id"
- ></el-option>
- </el-select>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
-
- <el-dialog :title="title" :visible.sync="chaegeOpen" width="500px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-form-item label="车号" prop="businessType">
- <el-select v-model="form.agvNo" placeholder="请选择车辆" clearable size="small" style="width: 100%">
- <el-option
- v-for="dict in chargeCombo"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitChargeForm">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listWcsTask,
- getWcsTask,
- delWcsTask,
- addWcsTask,
- updateWcsTask,
- addTestTask,
- completeWcsTask,
- pickupCompleteWcsTask,
- taskCancel,
- invDisposition,
- addChargeTask
- } from "@/api/ams/wcsTask";
- import { queryLocationDict } from "@/api/base/locationInfo";
- import { queryLocationZoneDict } from "@/api/base/locationZone"
- import {lockLocRequest} from "@/api/ams/locationView";
- export default {
- name: "WcsTask",
- data() {
- return {
-
- dateRange: [],
-
- loading: true,
-
- ids: [],
-
- single: true,
-
- multiple: true,
-
- showSearch: true,
-
- total: 0,
-
- wcsTaskList: [],
-
- title: "",
-
- open: false,
-
- chaegeOpen:false,
-
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- locationFrom: null,
- areaFrom: null,
- locationTo: null,
- areaTo: null,
- priority: null,
- state: null,
- createUser: null,
- createDate: null,
- taskType: null,
- shopId: null,
- startTime: null,
- endTime: null,
- parentTask: null,
- agvNo: null
- },
-
- form: {},
-
- rules: {
- },
- businessTypeCombo: [
- {'label':'普通任务','value':'01'}
- ],
- chargeCombo: [
- {'label':'迷你堆垛A','value':'1'},
- {'label':'迷你堆垛B','value':'2'},
- {'label':'三向车','value':'3'}
- ],
- taskTypeCombo: [
- {'label':'入库','value':'5'},
- {'label':'出库','value':'6'},
- {'label':'回库','value':'9'},
- {'label':'移库','value':'10'}
- ],
- isYesAndNoCombo: [
- {'label':'是','value':'Y'},
- {'label':'否','value':'N'}
- ],
- locationFromCombo: [],
- locationToCombo: [],
- locationZoneCombo: [],
- options: [{
- value: '1',
- label: '开始'
- }, {
- value: '2',
- label: '完成'
- }, {
- value: '3',
- label: '开始取货'
- }, {
- value: '4',
- label: '取货完成'
- }, {
- value: '5',
- label: '开始卸货'
- },{
- value: '6',
- label: '卸货完成'
- },{
- value: '7',
- label: '取消'
- },{
- value: '8',
- label: '异常'
- },{
- value: '9',
- label: '待下发'
- },{
- value: '10',
- label: '已下发'
- },{
- value: '11',
- label: '取消并归于起点'
- },{
- value: '12',
- label: '取消并归于终点'
- },{
- value: '13',
- label: '取货待确认'
- },{
- value: '14',
- label: '卸货待确认'
- }],
- };
- },
- created() {
- this.initData();
- this.getList();
- },
- methods: {
- initData() {
- queryLocationZoneDict().then(response => {
- this.locationZoneCombo = response.data
- })
- },
-
- getList() {
- this.loading = true;
- listWcsTask(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
- this.wcsTaskList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
-
- cancel() {
- this.open = false;
- this.reset();
- },
-
- reset() {
- this.form = {
- taskNo: null,
- businessType: null,
- whTypeFrom: null,
- whNoFrom: null,
- whTypeTo: null,
- whNoTo: null,
- sysName: null,
- deviceName: null,
- batchNo: null,
- batchOrderNo: null,
- locationFrom: null,
- areaFrom: null,
- locationTo: null,
- areaTo: null,
- priority: null,
- state: null,
- remark: null,
- createUser: null,
- createDate: null,
- updateUser: null,
- updateDate: null,
- taskType: null,
- shopId: null,
- startTime: null,
- endTime: null,
- parentTask: null,
- extParam: null,
- ext1: null,
- ext2: null,
- ext3: null,
- ext4: null,
- ext5: null,
- ext6: null,
- ext7: null,
- ext8: null,
- agvNo: null,
- beforeTask: null
- };
- this.resetForm("form");
- },
-
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
-
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
-
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.taskNo)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
-
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = "添加AGV任务";
- },
-
- handleCharge() {
- this.reset();
- this.chaegeOpen = true;
- this.title = "添加充电任务";
- },
-
- handleUpdate(row) {
- this.reset();
- const taskNo = row.taskNo || this.ids
- getWcsTask(taskNo).then(response => {
- this.form = response.data;
- this.open = true;
- this.title = "修改AGV任务";
- });
- },
-
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- addTestTask(this.form).then(
- response => {
- this.getList();
- this.$modal.msgSuccess("添加成功");
- this.open = false;
- }
- );
- }
- });
- },
-
- submitChargeForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- addChargeTask(this.form).then(
- response => {
- this.getList();
- this.$modal.msgSuccess("添加成功");
- this.open = false;
- }
- );
- }
- });
- },
-
- handleDelete(row) {
- const taskNos = row.taskNo || this.ids;
- this.$modal.confirm('是否确认删除AGV任务编号为"' + taskNos + '"的数据项?').then(function() {
- return delWcsTask(taskNos);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- },
-
- handleExport() {
- this.download('ams/wcsTask/export', {
- ...this.queryParams
- }, `wcsTask_${new Date().getTime()}.xlsx`)
- },
- handlePickupCompleted (row) {
- const taskNos = row.taskNo
- let vue = this
- this.$modal.confirm('是否确认取货完成"' + taskNos + '"的任务?').then(function() {
- pickupCompleteWcsTask(taskNos).then(response => {
- console.log(response)
- if (response.code == 200) {
- vue.getList();
- vue.$modal.msgSuccess(response.msg);
- } else {
- vue.getList();
- vue.$modal.msgError(response.msg);
- }
- });
- });
- },
- handleComplete (row) {
- const taskNos = row.taskNo
- const vue = this
- this.$modal.confirm('是否确认卸货完成"' + taskNos + '"的任务?').then(function() {
- completeWcsTask(taskNos).then(response => {
- if (response.code === 200) {
- vue.getList();
- vue.$modal.msgSuccess(response.msg);
- } else {
- vue.getList();
- vue.$modal.msgError(response.msg);
- }
- });
- });
- },
- handleCancel (row) {
- const taskNos = row.taskNo
- this.$modal.confirm('是否确认要取消"' + taskNos + '"的任务?').then(function() {
- return taskCancel(taskNos);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("执行成功");
- }).catch(() => {});
- },
- handleDisposition (row, result) {
- const taskNos = row.taskNo
- let resultMsg = ''
- if (result === 'disFrom') {
- resultMsg = '归于起点'
- } else if (result === 'disTo') {
- resultMsg = '归于终点'
- } else {
- resultMsg = '清空库存'
- }
- this.$modal.confirm('确认要进行"' + resultMsg + '"的操作?').then(function() {
- return invDisposition(taskNos, result);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("执行成功");
- }).catch(() => {});
- },
- locationZoneFromChange: function (value) {
- let param = 0
- if (value != '') {
- param = value
- }
- queryLocationDict(param).then(response => {
- this.locationFromCombo = response.data
- })
- },
- locationZoneToChange: function (value) {
- let param = 0
- if (value != '') {
- param = value
- }
- queryLocationDict(param).then(response => {
- this.locationToCombo = response.data
- })
- }
- }
- };
- </script>
|