Compare commits
5 Commits
projects/s
...
projects/s
| Author | SHA1 | Date | |
|---|---|---|---|
| f5f250cb16 | |||
| b6241fe7c4 | |||
| 94edd04a08 | |||
| b926559a7d | |||
| b2984ed4cf |
139
src/api/ssdl/product&recipe.js
Normal file
139
src/api/ssdl/product&recipe.js
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-19 13:11:54
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 获得原料分页
|
||||
export function getProductPage(query) {
|
||||
return request({
|
||||
url: '/wms/material/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得原料
|
||||
export function getProduct(id) {
|
||||
return request({
|
||||
url: '/wms/material/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 删除原料
|
||||
export function deleteProduct(id) {
|
||||
return request({
|
||||
url: '/wms/material/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function updateProduct(data) {
|
||||
return request({
|
||||
url: '/wms/material/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function createProduct(data) {
|
||||
return request({
|
||||
url: '/wms/material/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获得工艺分页
|
||||
export function getProcessPage(query) {
|
||||
return request({
|
||||
url: '/wms/process/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 删除工艺
|
||||
export function deleteProcess(id) {
|
||||
return request({
|
||||
url: '/wms/process/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function updateProcess(data) {
|
||||
return request({
|
||||
url: '/wms/process/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function createProcess(data) {
|
||||
return request({
|
||||
url: '/wms/process/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得工艺
|
||||
export function getProcess(id) {
|
||||
return request({
|
||||
url: '/wms/process/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 工艺设备原料分页
|
||||
export function getProcessMaterialPage(query) {
|
||||
return request({
|
||||
url: '/wms/process-equipment-material/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 删除工艺设备原料
|
||||
export function deleteProcessMaterial(id) {
|
||||
return request({
|
||||
url: '/wms/process-equipment-material/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
export function updateProcessMaterial(data) {
|
||||
return request({
|
||||
url: '/wms/process-equipment-material/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function createProcessMaterial(data) {
|
||||
return request({
|
||||
url: '/wms/process-equipment-material/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得工艺
|
||||
export function getProcessMaterial(id) {
|
||||
return request({
|
||||
url: '/wms/process-equipment-material/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备分页
|
||||
export function getEquipmentPage(query) {
|
||||
return request({
|
||||
url: '/wms/equipment/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
60
src/api/ssdl/taskList.js
Normal file
60
src/api/ssdl/taskList.js
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-18 15:42:19
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 获得任务分页
|
||||
export function getTaskPage(query) {
|
||||
return request({
|
||||
url: '/wms/job-main-task/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得任务
|
||||
export function getTask(id) {
|
||||
return request({
|
||||
url: '/wms/job-main-task/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得任务日志分页
|
||||
export function getTaskLogPage(query) {
|
||||
return request({
|
||||
url: '/wms/job-main-task-log/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
export function updateTask(data) {
|
||||
return request({
|
||||
url: '/wms/job-main-task/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据区域id获取该区域下的库位信息
|
||||
export function getRegion(id) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/get-by-region-id?regionId=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function createPCTask(data) {
|
||||
return request({
|
||||
url: '/wms/job-main-task/pc-create-task',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-02 09:33:29
|
||||
* @LastEditTime: 2025-11-19 13:20:30
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
|
||||
65
src/views/cost/components/SmallTitle.vue
Normal file
65
src/views/cost/components/SmallTitle.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: $height;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
442
src/views/cost/components/add-or-updata.vue
Normal file
442
src/views/cost/components/add-or-updata.vue
Normal file
@@ -0,0 +1,442 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 15:07:24
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-07 15:35:14
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div class="circle-container">
|
||||
<div v-for="(item, index) in dotArr" :key="index" class="circle-wrapper">
|
||||
<div
|
||||
class="circle"
|
||||
:style="{
|
||||
background: stepNum == index + 1 ? '#0B58FF' : '',
|
||||
}">
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
<div
|
||||
class="circle-text"
|
||||
:style="{
|
||||
color: stepNum == index + 1 ? '#0B58FF' : '',
|
||||
}">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<!-- 圆点后面的虚线 -->
|
||||
<div v-if="index < 2" class="connector" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="stepNum == 1">
|
||||
<div class="topTip">
|
||||
1.可选择库区、巷道,同批次创建任务搬运仅支持同一产品型号。
|
||||
<br />
|
||||
2.须在本页下方填写搬运数量,搬运数量仅支持双数,且数量≤当前可用库存总量。
|
||||
</div>
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
步骤一:选择产品及起点
|
||||
</small-title>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-position="top"
|
||||
label-width="80px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="搬运对象" prop="val1">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.val1"
|
||||
placeholder="请选择搬运对象">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="dataForm.val1 == 1">
|
||||
<el-form-item label="产品名称" prop="val1">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.val2"
|
||||
placeholder="请选择产品名称">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="dataForm.val1 == 1">
|
||||
<el-form-item label="规格型号" prop="val1">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.val2"
|
||||
placeholder="请选择规格型号">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="搬运数量" prop="val4">
|
||||
<el-input
|
||||
v-model="dataForm.val4"
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
||||
<template slot="append">盘</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="起点信息" prop="val5">
|
||||
<el-radio-group v-model="dataForm.val5">
|
||||
<el-radio :label="1">按策略自动选择</el-radio>
|
||||
<el-radio :label="2">指定起点</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div v-if="dataForm.val5 == 2" class="potBG-div">
|
||||
<div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10">
|
||||
起点库区:
|
||||
<el-select
|
||||
style="width: 200px; margin-left: 10px"
|
||||
v-model="startPot"
|
||||
size="small"
|
||||
placeholder="请选择起点库区">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="13" style="text-align: right; line-height: 36px">
|
||||
<span
|
||||
class="num1-startPot-status"
|
||||
style="background-color: #5ab45a" />
|
||||
可选
|
||||
<span class="num1-startPot-status" />
|
||||
不可选
|
||||
<span
|
||||
class="num1-startPot-status"
|
||||
style="background-color: #e9b100" />
|
||||
已选
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="potTitleBG">
|
||||
<div v-for="item in Object.keys(startPotList)" :key="item">
|
||||
<div class="potTitle">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div class="potList">
|
||||
<div
|
||||
class="pot"
|
||||
v-for="sitem in startPotList[item]"
|
||||
:key="sitem.id"
|
||||
:style="{
|
||||
backgroundColor: potBGcolor[sitem.status],
|
||||
cursor: sitem.status > 0 ? 'pointer' : '',
|
||||
}"
|
||||
@click="sitem.status > 0 && setStartPot(sitem)"
|
||||
:title="sitem.name">
|
||||
{{ sitem.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="text-align: right">可用库存总量 <span style="color:#409EFF;font-size:16px">12</span> 盘</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="stepNum == 2">
|
||||
<div class="topTip">
|
||||
1.指定终点库位,下发后会锁定所属巷道仅本批次任务进入。
|
||||
<br />
|
||||
2.指定终点库位选位规则:仅可从巷道最里空对位选位。
|
||||
<br />
|
||||
3.只选择库区或巷道时,该方式下当前终点为候选位置,系统将根据策略与现场实际情况自动确定最终终点库位。
|
||||
</div>
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
步骤二:选择终点
|
||||
</small-title>
|
||||
</div>
|
||||
<div v-if="stepNum == 3">
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
步骤三:预览与下发
|
||||
</small-title>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle';
|
||||
export default {
|
||||
components: {
|
||||
SmallTitle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dotArr: [
|
||||
{
|
||||
name: '选择起点',
|
||||
},
|
||||
{
|
||||
name: '选择终点',
|
||||
},
|
||||
{
|
||||
name: '预览下发',
|
||||
},
|
||||
],
|
||||
potBGcolor: ['', '#dafadc', '#f8f0c4'],
|
||||
stepNum: 1, // 当前第几步
|
||||
//第一步参数
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
val1: undefined,
|
||||
val2: undefined,
|
||||
val3: undefined,
|
||||
val4: undefined,
|
||||
val5: 1,
|
||||
},
|
||||
options1: [
|
||||
{
|
||||
label: '产品',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '空盘',
|
||||
value: 2,
|
||||
},
|
||||
],
|
||||
dataRule: {},
|
||||
startPot: undefined, //起点库区选择的类型
|
||||
startPotList: {
|
||||
//起点库区List
|
||||
G01: [
|
||||
{
|
||||
id: '001',
|
||||
name: 'L001',
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
id: '002',
|
||||
name: 'R002',
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
id: '003',
|
||||
name: 'L003',
|
||||
status: 0,
|
||||
},
|
||||
{
|
||||
id: '004',
|
||||
name: 'R004',
|
||||
status: 0,
|
||||
},
|
||||
],
|
||||
G02: [
|
||||
{
|
||||
id: '005',
|
||||
name: 'L005',
|
||||
},
|
||||
{
|
||||
id: '006',
|
||||
name: 'R006',
|
||||
},
|
||||
{
|
||||
id: '007',
|
||||
name: 'L007',
|
||||
},
|
||||
{
|
||||
id: '008',
|
||||
name: 'R008',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || undefined;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
} else {
|
||||
}
|
||||
});
|
||||
},
|
||||
//上一步
|
||||
upSubmit() {
|
||||
if (this.stepNum == 2) {
|
||||
this.stepNum -= 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
} else if (this.stepNum == 3) {
|
||||
this.stepNum -= 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
}
|
||||
},
|
||||
//下一步
|
||||
nextSubmit() {
|
||||
if (this.stepNum == 1) {
|
||||
this.stepNum += 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
return;
|
||||
}
|
||||
if (this.stepNum == 2) {
|
||||
this.stepNum += 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
return;
|
||||
}
|
||||
if (this.stepNum == 3) {
|
||||
this.stepNum = 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
return;
|
||||
}
|
||||
},
|
||||
cancelStep() {},
|
||||
|
||||
// 第一步方法
|
||||
setStartPot(data) {
|
||||
data.status = data.status == 1 ? 2 : 1;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topTip {
|
||||
background-color: #ebebeb;
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
line-height: 25px;
|
||||
}
|
||||
</style>
|
||||
<!-- //库位点的样式 -->
|
||||
<style scoped>
|
||||
.potBG-div {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
border: 1px solid gainsboro;
|
||||
box-shadow: 2px 2px 2px gainsboro, -1px -1px 3px gainsboro;
|
||||
padding: 15px;
|
||||
}
|
||||
.num1-startPot-status {
|
||||
margin-left: 5px;
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 1px solid gainsboro;
|
||||
}
|
||||
.potTitleBG {
|
||||
margin-top: 10px;
|
||||
overflow-x: auto;
|
||||
display: flex;
|
||||
}
|
||||
.potTitle {
|
||||
width: 82px;
|
||||
background-color: rgb(169, 235, 249);
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.potList {
|
||||
width: 82px;
|
||||
display: grid;
|
||||
grid-template-columns: 40px 40px;
|
||||
gap: 2px;
|
||||
}
|
||||
.pot {
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
border: 1px solid gainsboro;
|
||||
border-radius: 3px;
|
||||
padding: 5px 0;
|
||||
margin-bottom: 5px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- //序号圆点 -->
|
||||
<style scoped>
|
||||
.circle-container {
|
||||
height: 110px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
width: 90%;
|
||||
overflow-x: auto;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.circle-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 50%;
|
||||
background: #8db1ff;
|
||||
font-weight: 500;
|
||||
font-size: 31px;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
.circle-text {
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
left: -15px;
|
||||
color: #8db1ff;
|
||||
width: 82px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 下半圆虚线边框 */
|
||||
.circle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -6px; /* 2px边框 + 2px间隙 */
|
||||
left: -4px;
|
||||
right: -4px;
|
||||
height: 30px; /* 半圆高度 */
|
||||
border-radius: 0 0 60px 60px;
|
||||
border: 1px dashed #0b58ff;
|
||||
border-top: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.connector {
|
||||
width: 160px; /* 计算连接线长度 */
|
||||
height: 2px;
|
||||
border-bottom: 1px dashed rgb(11, 88, 255, 1);
|
||||
margin: 0 5px;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
273
src/views/cost/components/detailDrawer.vue
Normal file
273
src/views/cost/components/detailDrawer.vue
Normal file
@@ -0,0 +1,273 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-07 17:01:51
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-07 22:31:17
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:with-header="false"
|
||||
size="50%"
|
||||
@close="closeD"
|
||||
:show-close="false">
|
||||
<div class="bgDiv1">
|
||||
<el-row :gutter="20" style="margin-bottom: 15px">
|
||||
<el-col :span="8" style="font-size: 20px; font-weight: 600">
|
||||
TSK202510230001
|
||||
</el-col>
|
||||
<el-col :span="8">满盘搬运(自动)</el-col>
|
||||
<el-col :span="8">
|
||||
上次刷新:{{ parseTime(Date.now()) }}
|
||||
<el-button type="text" @click="refresh">刷新</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">任务状态</el-col>
|
||||
<el-col :span="8">优先级</el-col>
|
||||
<el-col :span="8">执行车辆</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" style="margin-bottom: 15px">
|
||||
<el-col :span="8">
|
||||
<span
|
||||
:style="{ backgroundColor: statusColor[1].color }"
|
||||
class="taskStatus">
|
||||
{{ statusColor[1].label }}
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="8">中</el-col>
|
||||
<el-col :span="8">--</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">执行时长</el-col>
|
||||
<el-col :span="8">创建人</el-col>
|
||||
<el-col :span="8">创建时间</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">--</el-col>
|
||||
<el-col :span="8">系统/张三</el-col>
|
||||
<el-col :span="8">{{ parseTime(Date.now()) }}</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="bgDiv2">
|
||||
<el-steps
|
||||
:active="stepNum"
|
||||
finish-status="success"
|
||||
:process-status="stepStatus"
|
||||
align-center>
|
||||
<el-step title="待下发"></el-step>
|
||||
<el-step title="待执行"></el-step>
|
||||
<el-step title="执行中"></el-step>
|
||||
<el-step title="已完成"></el-step>
|
||||
</el-steps>
|
||||
<div class="abnormal">任务异常:无效路径</div>
|
||||
</div>
|
||||
<div class="bgDiv3">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
搬运对象
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="pan-info">
|
||||
<div class="pan-title">L盘</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="pan-info">
|
||||
<div class="pan-title">R盘</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="bgDiv4">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
回收信息
|
||||
</small-title>
|
||||
<el-descriptions :column="2" size="medium" border>
|
||||
<el-descriptions-item label="回收方式">他车回收</el-descriptions-item>
|
||||
<el-descriptions-item label="回收任务编号">
|
||||
18100000000
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="回收库位">
|
||||
CK-01-A05-L / R
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="执行车辆">AGV-06</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="bgDiv5">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
任务明细
|
||||
</small-title>
|
||||
<el-descriptions :column="2" size="medium" border>
|
||||
<el-descriptions-item label="起点库位(L/R)">
|
||||
CK-01-A05-L / R
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="终点库位(L/R)">
|
||||
CC-02-B03-L/R (候选 )
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="起点策略">--</el-descriptions-item>
|
||||
<el-descriptions-item label="终点策略">入库策略</el-descriptions-item>
|
||||
<el-descriptions-item label="FMS任务号">--</el-descriptions-item>
|
||||
<el-descriptions-item label="车辆位置">--</el-descriptions-item>
|
||||
<el-descriptions-item label="电量">--</el-descriptions-item>
|
||||
<el-descriptions-item label="是否载货">--</el-descriptions-item>
|
||||
<el-descriptions-item label="创建方式">自动/人工</el-descriptions-item>
|
||||
<el-descriptions-item label="任务来源">
|
||||
PDA/PC/系统
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关联叫料单">--</el-descriptions-item>
|
||||
<el-descriptions-item label=""></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="bgDiv6">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
任务日志
|
||||
</small-title>
|
||||
<el-timeline style="padding: 0">
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
:type="activity.type"
|
||||
:color="activity.color"
|
||||
size="large"
|
||||
hide-timestamp>
|
||||
<span>{{ activity.content }}</span>
|
||||
<span style="float: right">{{ activity.timestamp }}</span>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<div class="drawer-body__footer">
|
||||
<el-button @click="closeD">返 回</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle';
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
title: '',
|
||||
statusColor: [
|
||||
//bgDiv1的任务状态
|
||||
{ label: '待下发', color: '#fa8c16' },
|
||||
{ label: '待执行', color: '#1890ff' },
|
||||
{ label: '执行中', color: '#1890ff' },
|
||||
{ label: '已完成', color: '#52c41a' },
|
||||
{ label: '暂停中', color: '#8c8c8c' },
|
||||
{ label: '已终止', color: '#faad14' },
|
||||
{ label: '异常', color: '#ff4d4f' },
|
||||
{ label: '禁用', color: '#d9d9d9' },
|
||||
],
|
||||
//bgDiv2的步骤条
|
||||
stepNum: 2,
|
||||
stepStatus: 'finish',
|
||||
//bgDiv6的时间线
|
||||
|
||||
activities: [
|
||||
{
|
||||
content: 'FMS | 卸货完成,任务完成',
|
||||
timestamp: '2018-04-12 20:46',
|
||||
type: 'primary',
|
||||
},
|
||||
{
|
||||
content: 'FMS | 取货完成',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
},
|
||||
{
|
||||
content: 'FMS | 派车AGV-03,前往起点取货',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
},
|
||||
{
|
||||
content: '张三 | 任务扫码配对完成,进入待下发',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
SmallTitle,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
init(val) {
|
||||
this.visible = true;
|
||||
},
|
||||
//刷新
|
||||
refresh() {},
|
||||
closeD() {
|
||||
this.visible = false
|
||||
this.$emit('closeDrawer');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bgDiv1 {
|
||||
background-color: rgba(242, 242, 242, 0.5);
|
||||
padding: 20px;
|
||||
line-height: 25px;
|
||||
font-size: 15px;
|
||||
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||
.taskStatus {
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
padding: 2px 5px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.bgDiv2 {
|
||||
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||
padding: 18px 0;
|
||||
.abnormal {
|
||||
width: 80%;
|
||||
margin: auto;
|
||||
border-radius: 5px;
|
||||
height: 40px;
|
||||
font-size: 22px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
background-color: rgba(217, 0, 27, 0.1);
|
||||
color: rgba(217, 0, 27, 1);
|
||||
border: 1px solid rgba(217, 0, 27, 1);
|
||||
}
|
||||
}
|
||||
.bgDiv3 {
|
||||
padding: 20px 20px 0;
|
||||
.pan-info {
|
||||
height: 350px;
|
||||
border: 1px solid rgba(121, 121, 121, 0.8);
|
||||
border-radius: 5px;
|
||||
.pan-title {
|
||||
background-color: rgba(242, 242, 242, 0.5);
|
||||
height: 35px;
|
||||
font-size: 20px;
|
||||
line-height: 35px;
|
||||
padding: 0 20px;
|
||||
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.bgDiv4 {
|
||||
padding: 20px 20px 0;
|
||||
}
|
||||
.bgDiv5 {
|
||||
padding: 20px 20px 0;
|
||||
}
|
||||
.bgDiv6 {
|
||||
padding: 20px 20px 0;
|
||||
}
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 0 18px 10px;
|
||||
}
|
||||
</style>
|
||||
65
src/views/cost/components/stopInStock.vue
Normal file
65
src/views/cost/components/stopInStock.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-08 17:44:05
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-08 18:13:25
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div>请选择要执行的终止方式,系统会根据选择进行处理</div>
|
||||
<el-radio-group v-model="radio" class="stockRadioDiv">
|
||||
<el-radio :label="1" border style="margin: 10px 0">
|
||||
仅终止,稍后回收
|
||||
<div style="font-weight: 400">
|
||||
任务立即终止,车辆保持暂停,稍后可在任务列表中手动回收
|
||||
</div>
|
||||
</el-radio>
|
||||
<el-radio :label="2" border style="margin: 10px 0">
|
||||
终止,并立即回收
|
||||
<div style="font-weight: 400">
|
||||
任务立即终止立即,选择货物回收方式生成任务或更新卸货点
|
||||
</div>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<div>
|
||||
终止原因:
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
style="margin: 10px 0"
|
||||
placeholder="请输入终止原因"
|
||||
v-model="textarea" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radio: 1,
|
||||
textarea: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(val) {},
|
||||
submit() {
|
||||
if(this.textarea){
|
||||
|
||||
}else{
|
||||
this.$message('请输入终止原因');
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.stockRadioDiv >>> .el-radio--medium.is-bordered {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70px;
|
||||
line-height: 20px;
|
||||
}
|
||||
</style>
|
||||
32
src/views/cost/components/subSpan1.vue
Normal file
32
src/views/cost/components/subSpan1.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:19:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val2
|
||||
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
32
src/views/cost/components/subSpan2.vue
Normal file
32
src/views/cost/components/subSpan2.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:20:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val3
|
||||
? ['待下发', '待执行', '执行中', '已完成', '暂停中', '已终止', '异常'][injectData.val3]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
57
src/views/cost/components/subSpan3.vue
Normal file
57
src/views/cost/components/subSpan3.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:37:02
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div style="display: flex; align-items: center">
|
||||
<div
|
||||
style="
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 5px;
|
||||
background-color: #e89b24;
|
||||
color: #fff;
|
||||
text-align:center;
|
||||
line-height:16px
|
||||
">
|
||||
L
|
||||
</div>
|
||||
产品名称+产品规格
|
||||
</div>
|
||||
<div style="display: flex; align-items: center">
|
||||
<div
|
||||
style="
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 5px;
|
||||
background-color: #6a96ec;
|
||||
color: #fff;
|
||||
text-align:center;
|
||||
line-height:16px
|
||||
">
|
||||
R
|
||||
</div>
|
||||
产品名称+产品规格
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
32
src/views/cost/components/subSpan4.vue
Normal file
32
src/views/cost/components/subSpan4.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:19:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val2
|
||||
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-12 15:35:21
|
||||
* @LastEditTime: 2025-11-18 15:01:42
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -14,17 +14,17 @@
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="code">
|
||||
<el-form-item label="产品编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
v-model="dataForm.materialCode"
|
||||
clearable
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-form-item label="产品名称" prop="materialName">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
v-model="dataForm.materialName"
|
||||
clearable
|
||||
placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
@@ -32,80 +32,47 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品规格" prop="address">
|
||||
<el-form-item label="产品规格" prop="material">
|
||||
<el-input
|
||||
v-model="dataForm.address"
|
||||
v-model="dataForm.material"
|
||||
clearable
|
||||
placeholder="请输入产品规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品类型" prop="name">
|
||||
<el-select
|
||||
v-model="dataForm.name"
|
||||
disabled
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择产品类型">
|
||||
<el-option
|
||||
v-for="item in typeArr"
|
||||
:key="item.name"
|
||||
:label="item.label"
|
||||
:value="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="启用状态" prop="enabled">
|
||||
<el-select
|
||||
:style="{ width: '100%' }" v-model="dataForm.enabled" placeholder="请选择启用状态">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import {
|
||||
createFactory,
|
||||
updateFactory,
|
||||
getFactory,
|
||||
getCode,
|
||||
} from '@/api/core/base/factory';
|
||||
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createFactory,
|
||||
updateURL: updateFactory,
|
||||
infoURL: getFactory,
|
||||
createURL: createProduct,
|
||||
updateURL: updateProduct,
|
||||
infoURL: getProduct,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
address: undefined,
|
||||
enabled:'1',
|
||||
remark: undefined,
|
||||
material: undefined,
|
||||
materialName: undefined,
|
||||
materialCode: undefined,
|
||||
},
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
code: [
|
||||
materialCode: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
materialName: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
material: [
|
||||
{ required: true, message: '规格不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -41,48 +41,32 @@
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import changeStatus from './changeStatus.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import {
|
||||
deleteFactory,
|
||||
getFactoryPage,
|
||||
exportFactoryExcel,
|
||||
} from '@/api/core/base/factory';
|
||||
import { deleteProduct, getProductPage } from '@/api/ssdl/product&recipe';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
prop: 'materialCode',
|
||||
label: '产品编码',
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
prop: 'materialName',
|
||||
label: '产品名称',
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
prop: 'material',
|
||||
label: '规格型号',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '产品分类',
|
||||
},
|
||||
{
|
||||
prop: 'remark1',
|
||||
prop: 'creator',
|
||||
label: '创建人',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '时间',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '状态',
|
||||
subcomponent: changeStatus,
|
||||
width: 80,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
@@ -90,47 +74,33 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getFactoryPage,
|
||||
deleteURL: deleteFactory,
|
||||
exportURL: exportFactoryExcel,
|
||||
getDataListURL: getProductPage,
|
||||
deleteURL: deleteProduct,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:factory:update`)
|
||||
? {
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:factory:delete`)
|
||||
? {
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '分类',
|
||||
selectOptions: [],
|
||||
param: 'val1',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: [
|
||||
{ id: 1, name: '正常' },
|
||||
{ id: 2, name: '停用' },
|
||||
],
|
||||
param: 'val2',
|
||||
type: 'input',
|
||||
label: '名称',
|
||||
placeholder: '名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'name',
|
||||
label: '编码',
|
||||
placeholder: '编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -150,7 +120,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@@ -177,16 +147,15 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.val1 = val.val1;
|
||||
this.listQuery.val2 = val.val2;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.materialName = val.name;
|
||||
this.listQuery.materialCode = val.code;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
@@ -204,6 +173,27 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index,data) {
|
||||
this.$confirm(`是否确认删除${'产品名称为 ' + data.materialName + ' '}的数据项?`, "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
65
src/views/product&recipe/recipe/SmallTitle.vue
Normal file
65
src/views/product&recipe/recipe/SmallTitle.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,114 +1,395 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-12 15:35:21
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="code">
|
||||
<el-form-item label="配方编码" prop="processCode">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
v-model="dataForm.processCode"
|
||||
clearable
|
||||
placeholder="请输入产品编码" />
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入配方编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-form-item label="配方名称" prop="processName">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
v-model="dataForm.processName"
|
||||
clearable
|
||||
placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品规格" prop="address">
|
||||
<el-input
|
||||
v-model="dataForm.address"
|
||||
clearable
|
||||
placeholder="请输入产品规格" />
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入配方名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品类型" prop="name">
|
||||
<el-form-item label="产品" prop="materialId">
|
||||
<el-select
|
||||
v-model="dataForm.name"
|
||||
disabled
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择产品类型">
|
||||
style="width: 100%"
|
||||
v-model="dataForm.materialId"
|
||||
:disabled="isdetail"
|
||||
@change="setMaterial"
|
||||
placeholder="请选择产品">
|
||||
<el-option
|
||||
v-for="item in typeArr"
|
||||
:key="item.name"
|
||||
:label="item.label"
|
||||
:value="item.name"></el-option>
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="item.materialName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="启用状态" prop="enabled">
|
||||
<el-select
|
||||
:style="{ width: '100%' }" v-model="dataForm.enabled" placeholder="请选择启用状态">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
<el-form-item label="配方描述" prop="processDesc">
|
||||
<el-input
|
||||
v-model="dataForm.processDesc"
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入配方描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true"
|
||||
v-if="dataForm.id">
|
||||
产品属性列表
|
||||
</small-title>
|
||||
|
||||
<div class="attr-list" v-if="dataForm.id">
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:add-button-show="isdetail ? null : '添加属性'"
|
||||
@emitButtonClick="addNew()"
|
||||
:table-data="productAttributeList">
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
v-show="listQuery.total > 0"
|
||||
:total="listQuery.total"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<product-attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:process-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import {
|
||||
createFactory,
|
||||
updateFactory,
|
||||
getFactory,
|
||||
getCode,
|
||||
} from '@/api/core/base/factory';
|
||||
updateProcess,
|
||||
createProcess,
|
||||
getProcess,
|
||||
getProcessMaterialPage,
|
||||
deleteProcessMaterial,
|
||||
getProductPage,
|
||||
} from '@/api/ssdl/product&recipe';
|
||||
import productAttrAdd from './attr-add';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import SmallTitle from './SmallTitle';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '原料名称',
|
||||
},
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '数量',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { productAttrAdd, SmallTitle },
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createFactory,
|
||||
updateURL: updateFactory,
|
||||
infoURL: getFactory,
|
||||
},
|
||||
visible: false,
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
tableProps,
|
||||
productAttributeList: [],
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
address: undefined,
|
||||
enabled:'1',
|
||||
remark: undefined,
|
||||
id: null,
|
||||
processName: '', // 配方名称
|
||||
processCode: '', // 配方编码
|
||||
processDesc: '', // 配方描述
|
||||
materialId: '', // 物料id
|
||||
materialName: '', // 物料名称
|
||||
materialCode: '', // 物料编码
|
||||
},
|
||||
productArr: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
|
||||
processCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '配方编码不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
|
||||
processName: [
|
||||
{
|
||||
required: true,
|
||||
message: '配方名称不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
materialId: [
|
||||
{
|
||||
required: true,
|
||||
message: '物料不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
isdetail: false,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
methods: {
|
||||
initData() {
|
||||
this.productAttributeList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.productArr = res.data.list;
|
||||
});
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || null;
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
getProcess(id).then((response) => {
|
||||
this.dataForm = response.data;
|
||||
});
|
||||
// 获取产品的属性列表
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setMaterial() {
|
||||
const data = this.productArr.find(
|
||||
(i) => i.id === this.dataForm.materialId
|
||||
);
|
||||
this.dataForm.materialName = data.materialName;
|
||||
this.dataForm.materialCode = data.materialCode;
|
||||
},
|
||||
getList() {
|
||||
// 获取产品的属性列表
|
||||
getProcessMaterialPage({
|
||||
...this.listQuery,
|
||||
productId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.productAttributeList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProcessMaterial(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateProcess(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createProcess(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$confirm(`是否新增产品属性?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
this.dataForm.id = response.data;
|
||||
this.addNew();
|
||||
})
|
||||
.catch(() => {
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
if (this.dataForm.id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
} else {
|
||||
this.$message('请先创建配方!');
|
||||
}
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
this.initData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
195
src/views/product&recipe/recipe/attr-add.vue
Normal file
195
src/views/product&recipe/recipe/attr-add.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'35%'"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
class="dialog">
|
||||
<template #title>
|
||||
<slot name="title">
|
||||
<div class="titleStyle">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</div>
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="设备" prop="equipmentId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.equipmentId"
|
||||
@change="setEquipment"
|
||||
placeholder="请选择设备">
|
||||
<el-option
|
||||
v-for="item in equipmentArr"
|
||||
:key="item.id"
|
||||
:label="item.equipmentName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原料" prop="materialId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.materialId"
|
||||
@change="setMaterial"
|
||||
placeholder="请选择原料">
|
||||
<el-option
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="item.materialName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input-number
|
||||
v-model="dataForm.quantity"
|
||||
:step="1"
|
||||
step-strictly
|
||||
:min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProductPage,
|
||||
createProcessMaterial,
|
||||
getProcessMaterial,
|
||||
updateProcessMaterial,
|
||||
getEquipmentPage
|
||||
} from '@/api/ssdl/product&recipe';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
processId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
equipmentId: '',
|
||||
equipmentCode: '',
|
||||
equipmentName: '',
|
||||
materialId: '',
|
||||
materialCode: '',
|
||||
materialName: '',
|
||||
quantity: '',
|
||||
},
|
||||
productArr: [],
|
||||
equipmentArr: [],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'change' },
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '原料不能为空', trigger: 'change' },
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.productArr = res.data.list;
|
||||
});
|
||||
getEquipmentPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.equipmentArr = res.data.list;
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getProcessMaterial(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
setMaterial() {
|
||||
const data = this.productArr.find(
|
||||
(i) => i.id === this.dataForm.materialId
|
||||
);
|
||||
this.dataForm.materialName = data.materialName;
|
||||
this.dataForm.materialCode = data.materialCode;
|
||||
},
|
||||
setEquipment() {
|
||||
const data = this.equipmentArr.find(
|
||||
(i) => i.id === this.dataForm.equipmentId
|
||||
);
|
||||
this.dataForm.equipmentName = data.equipmentName;
|
||||
this.dataForm.equipmentCode = data.equipmentCode;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateProcessMaterial({
|
||||
...this.dataForm,
|
||||
processId: this.processId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createProcessMaterial({
|
||||
...this.dataForm,
|
||||
processId: this.processId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog >>> .el-dialog__body {
|
||||
padding: 30px 24px;
|
||||
}
|
||||
.dialog >>> .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
<template>
|
||||
<el-switch
|
||||
@change="changeStatus"
|
||||
size="small"
|
||||
v-model="list.enabled"
|
||||
:active-value="1"
|
||||
:inactive-value="0"></el-switch>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateGroup } from '@/api/group/groupSetting';
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeStatus(val) {
|
||||
const data = { ...this.injectData, enabled: val };
|
||||
updateGroup(data).then((res) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.$emit('emitData');
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,3 +1,10 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-19 13:21:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
@@ -5,16 +12,14 @@
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="90"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@@ -24,64 +29,44 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
@refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import changeStatus from './changeStatus.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import {
|
||||
deleteFactory,
|
||||
getFactoryPage,
|
||||
exportFactoryExcel,
|
||||
} from '@/api/core/base/factory';
|
||||
import { deleteProcess, getProcessPage } from '@/api/ssdl/product&recipe';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '产品编码',
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产品名称',
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: '规格型号',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '产品分类',
|
||||
},
|
||||
{
|
||||
prop: 'remark1',
|
||||
label: '创建人',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
label: '创建时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '状态',
|
||||
subcomponent: changeStatus,
|
||||
width: 80,
|
||||
prop: 'processName',
|
||||
label: '配方名称'
|
||||
},
|
||||
{
|
||||
prop: 'processCode',
|
||||
label: '配方编码'
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '产品名称'
|
||||
},
|
||||
{
|
||||
prop: 'materialCode',
|
||||
label: '产品编码'
|
||||
},
|
||||
{
|
||||
prop: 'processDesc',
|
||||
label: '配方描述'
|
||||
},
|
||||
];
|
||||
|
||||
@@ -90,64 +75,46 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getFactoryPage,
|
||||
deleteURL: deleteFactory,
|
||||
exportURL: exportFactoryExcel,
|
||||
getDataListURL: getProcessPage,
|
||||
deleteURL: deleteProcess,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:factory:update`)
|
||||
? {
|
||||
tableBtn: [{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:factory:delete`)
|
||||
? {
|
||||
},{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
},{
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '适用框绞线',
|
||||
selectOptions: [],
|
||||
param: 'val1',
|
||||
type: 'input',
|
||||
label: '配方编码',
|
||||
placeholder: '配方编码',
|
||||
param: 'code1',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '修改人',
|
||||
selectOptions: [],
|
||||
param: 'val2',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: [
|
||||
{ id: 1, name: '正常' },
|
||||
{ id: 2, name: '停用' },
|
||||
],
|
||||
param: 'val3',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '最后修改时间',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
type: 'input',
|
||||
label: '配方名称',
|
||||
placeholder: '配方名称',
|
||||
param: 'name1',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'name',
|
||||
param: 'code2',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品名称',
|
||||
placeholder: '产品名称',
|
||||
param: 'name2',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -167,21 +134,22 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
@@ -194,19 +162,17 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.val1 = val.val1;
|
||||
this.listQuery.val2 = val.val2;
|
||||
this.listQuery.val3 = val.val3;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.processName = val.name1 || null;
|
||||
this.listQuery.processCode = val.code1 || null;
|
||||
this.listQuery.materialName = val.name2 || null;
|
||||
this.listQuery.materialCode = val.code2 || null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
@@ -223,6 +189,34 @@ export default {
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index,data) {
|
||||
this.$confirm(`是否确认删除${'配方名称为 ' + data.processName + ' '}的数据项?`, "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 15:07:24
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-07 15:35:14
|
||||
* @LastEditTime: 2025-11-20 14:47:37
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -45,52 +45,48 @@
|
||||
label-width="80px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="搬运对象" prop="val1">
|
||||
<el-form-item label="任务类型" prop="mainTaskType">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.val1"
|
||||
placeholder="请选择搬运对象">
|
||||
v-model="dataForm.mainTaskType"
|
||||
placeholder="请选择任务类型">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
v-for="item in options0"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="dataForm.val1 == 1">
|
||||
<el-form-item label="产品名称" prop="val1">
|
||||
<el-col :span="6" v-if="dataForm.mainTaskType !== 2">
|
||||
<el-form-item label="产品名称" prop="productId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.val2"
|
||||
v-model="dataForm.productId"
|
||||
@change="setMaterial"
|
||||
placeholder="请选择产品名称">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="item.materialName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="dataForm.val1 == 1">
|
||||
<el-form-item label="规格型号" prop="val1">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.val2"
|
||||
placeholder="请选择规格型号">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
<el-col :span="6" v-if="dataForm.mainTaskType !== 2">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="dataForm.material"
|
||||
placeholder="规格型号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="搬运数量" prop="val4">
|
||||
<el-form-item label="搬运数量" prop="quantity">
|
||||
<el-input
|
||||
v-model="dataForm.val4"
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
||||
v-model="dataForm.quantity"
|
||||
@blur="validateNumber"
|
||||
placeholder="请输入正整数且为双数">
|
||||
<template slot="append">盘</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -101,67 +97,11 @@
|
||||
<el-form-item label="起点信息" prop="val5">
|
||||
<el-radio-group v-model="dataForm.val5">
|
||||
<el-radio :label="1">按策略自动选择</el-radio>
|
||||
<el-radio :label="2">指定起点</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div v-if="dataForm.val5 == 2" class="potBG-div">
|
||||
<div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10">
|
||||
起点库区:
|
||||
<el-select
|
||||
style="width: 200px; margin-left: 10px"
|
||||
v-model="startPot"
|
||||
size="small"
|
||||
placeholder="请选择起点库区">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="13" style="text-align: right; line-height: 36px">
|
||||
<span
|
||||
class="num1-startPot-status"
|
||||
style="background-color: #5ab45a" />
|
||||
可选
|
||||
<span class="num1-startPot-status" />
|
||||
不可选
|
||||
<span
|
||||
class="num1-startPot-status"
|
||||
style="background-color: #e9b100" />
|
||||
已选
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="potTitleBG">
|
||||
<div v-for="item in Object.keys(startPotList)" :key="item">
|
||||
<div class="potTitle">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div class="potList">
|
||||
<div
|
||||
class="pot"
|
||||
v-for="sitem in startPotList[item]"
|
||||
:key="sitem.id"
|
||||
:style="{
|
||||
backgroundColor: potBGcolor[sitem.status],
|
||||
cursor: sitem.status > 0 ? 'pointer' : '',
|
||||
}"
|
||||
@click="sitem.status > 0 && setStartPot(sitem)"
|
||||
:title="sitem.name">
|
||||
{{ sitem.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="text-align: right">可用库存总量 <span style="color:#409EFF;font-size:16px">12</span> 盘</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="stepNum == 2">
|
||||
<div class="topTip">
|
||||
@@ -174,17 +114,206 @@
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
步骤二:选择终点
|
||||
</small-title>
|
||||
<div class="potBG-div">
|
||||
<div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10">
|
||||
终点库区:
|
||||
<el-select
|
||||
style="width: 300px; margin-left: 10px"
|
||||
v-model="endPot"
|
||||
size="small"
|
||||
@change="getEndPot"
|
||||
placeholder="请选择终点库区">
|
||||
<el-option
|
||||
v-for="item in regionArr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="13" style="text-align: right; line-height: 36px">
|
||||
<span class="num1-startPot-status free" />
|
||||
空盘
|
||||
<span class="num1-startPot-status full" />
|
||||
满盘
|
||||
<span class="num1-startPot-status unavailable" />
|
||||
不可用
|
||||
<span class="num1-startPot-status locked" />
|
||||
锁定
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="potTitleBG">
|
||||
<div v-for="item in Object.keys(PotList)" :key="item">
|
||||
<div class="potTitle">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div class="potList">
|
||||
<div
|
||||
class="pot"
|
||||
v-for="sitem in PotList[item]"
|
||||
:key="sitem.id"
|
||||
:class="
|
||||
sitem.usableState == 1
|
||||
? sitem.lineEdgeLibraryState == 1
|
||||
? 'full'
|
||||
: 'free'
|
||||
: sitem.usableState == 2
|
||||
? 'unavailable'
|
||||
: 'locked'
|
||||
"
|
||||
@click="
|
||||
sitem.usableState == 1 &&
|
||||
sitem.lineEdgeLibraryState == 0 &&
|
||||
setStartPot(sitem)
|
||||
"
|
||||
:title="sitem.lineEdgeLibraryName">
|
||||
{{ sitem.lineEdgeLibraryCode }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="text-align: right">
|
||||
搬运数量
|
||||
<span style="color: #409eff; font-size: 16px">
|
||||
{{ dataForm.quantity }}
|
||||
</span>
|
||||
盘 可用库位
|
||||
<span style="color: #409eff; font-size: 16px">{{ stockNum }}</span>
|
||||
个
|
||||
<span
|
||||
v-if="dataForm.quantity > stockNum"
|
||||
style="color: #e6a23c; font-size: 16px">
|
||||
<i class="el-icon-warning"></i>
|
||||
请注意搬运数量超过可用库位
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="stepNum == 3">
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
步骤三:预览与下发
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<div
|
||||
style="
|
||||
margin: 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: black;
|
||||
">
|
||||
搬运对象
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
搬运对象:{{ dataForm.mainTaskType !== 2 ? '产品' : '空盘' }}
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="dataForm.mainTaskType !== 2">
|
||||
产品名称:
|
||||
{{ productArr.find((i) => i.id === dataForm.productId).materialName }}
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="dataForm.mainTaskType !== 2">
|
||||
规格型号:
|
||||
{{ productArr.find((i) => i.id === dataForm.productId).material }}
|
||||
</el-col>
|
||||
<el-col :span="6">搬运数量:{{ dataForm.quantity + ' 盘' }}</el-col>
|
||||
<el-col :span="24">
|
||||
<div
|
||||
style="
|
||||
margin: 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: black;
|
||||
">
|
||||
起点信息
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24">按策略自动选择</el-col>
|
||||
</el-row>
|
||||
<div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<div
|
||||
style="
|
||||
margin: 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: black;
|
||||
">
|
||||
终点信息
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
库区:{{ regionArr.find((i) => i.value === endPot).label }}
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="potTitleBG">
|
||||
<div v-for="item in Object.keys(PotList)" :key="item">
|
||||
<div class="potTitle">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div class="potList">
|
||||
<div
|
||||
class="pot"
|
||||
v-for="sitem in PotList[item]"
|
||||
:key="sitem.id"
|
||||
:class="
|
||||
sitem.usableState == 1
|
||||
? sitem.lineEdgeLibraryState == 1
|
||||
? 'full'
|
||||
: 'free'
|
||||
: sitem.usableState == 2
|
||||
? 'unavailable'
|
||||
: 'locked'
|
||||
"
|
||||
:title="sitem.lineEdgeLibraryName">
|
||||
{{ sitem.lineEdgeLibraryCode }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<div
|
||||
style="
|
||||
margin: 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: black;
|
||||
">
|
||||
任务信息
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
任务类型:{{ options0[dataForm.mainTaskType - 1].label }}
|
||||
</el-col>
|
||||
<el-col :span="8">任务数量:{{ dataForm.quantity / 2 }}</el-col>
|
||||
<el-col :span="8">
|
||||
本批次任务优先级:
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="taskPriority"
|
||||
placeholder="请选择优先级">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { getRegion, createPCTask } from '@/api/ssdl/taskList';
|
||||
import { getProductPage } from '@/api/ssdl/product&recipe';
|
||||
export default {
|
||||
components: {
|
||||
SmallTitle,
|
||||
@@ -207,72 +336,123 @@ export default {
|
||||
//第一步参数
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
val1: undefined,
|
||||
val2: undefined,
|
||||
val3: undefined,
|
||||
val4: undefined,
|
||||
mainTaskType: undefined,
|
||||
productId: undefined,
|
||||
materialName: '', // 物料名称
|
||||
materialCode: '', // 物料编码
|
||||
material: undefined,
|
||||
quantity: undefined,
|
||||
val5: 1,
|
||||
},
|
||||
options1: [
|
||||
productArr: [],
|
||||
options0: [
|
||||
{
|
||||
label: '产品',
|
||||
label: '满盘搬运',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '空盘',
|
||||
label: '空盘搬运',
|
||||
value: 2,
|
||||
},
|
||||
],
|
||||
dataRule: {},
|
||||
startPot: undefined, //起点库区选择的类型
|
||||
startPotList: {
|
||||
//起点库区List
|
||||
G01: [
|
||||
{
|
||||
id: '001',
|
||||
name: 'L001',
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
id: '002',
|
||||
name: 'R002',
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
id: '003',
|
||||
name: 'L003',
|
||||
status: 0,
|
||||
},
|
||||
{
|
||||
id: '004',
|
||||
name: 'R004',
|
||||
status: 0,
|
||||
label: '备货搬运',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
G02: [
|
||||
options2: [
|
||||
{
|
||||
id: '005',
|
||||
name: 'L005',
|
||||
label: '最高',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
id: '006',
|
||||
name: 'R006',
|
||||
label: '较高',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
id: '007',
|
||||
name: 'L007',
|
||||
label: '常规',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
id: '008',
|
||||
name: 'R008',
|
||||
label: '较低',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: '最低',
|
||||
value: 4,
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
mainTaskType: [
|
||||
{ required: true, message: '任务类型不能为空', trigger: 'change' },
|
||||
],
|
||||
productId: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'change' },
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '搬运数量不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
endPot: 7, //起点库区选择的类型,进来默认第一个
|
||||
PotList: {},
|
||||
//第二步参数
|
||||
regionArr: [
|
||||
{
|
||||
label: '框绞1号线设备1满盘缓存区',
|
||||
value: 7,
|
||||
},
|
||||
{
|
||||
label: '框绞1号线设备2满盘缓存区',
|
||||
value: 8,
|
||||
},
|
||||
{
|
||||
label: '框绞1号线设备3满盘缓存区',
|
||||
value: 9,
|
||||
},
|
||||
{
|
||||
label: '框绞1号线设备4满盘缓存区',
|
||||
value: 10,
|
||||
},
|
||||
{
|
||||
label: '框绞3号线设备1满盘缓存区',
|
||||
value: 11,
|
||||
},
|
||||
{
|
||||
label: '框绞3号线设备2满盘缓存区',
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
label: '框绞3号线设备3满盘缓存区',
|
||||
value: 13,
|
||||
},
|
||||
{
|
||||
label: '框绞3号线设备4满盘缓存区',
|
||||
value: 14,
|
||||
},
|
||||
{
|
||||
label: '框绞2号线设备1满盘缓存区',
|
||||
value: 15,
|
||||
},
|
||||
{
|
||||
label: '框绞2号线设备2满盘缓存区',
|
||||
value: 16,
|
||||
},
|
||||
{
|
||||
label: '框绞2号线设备3满盘缓存区',
|
||||
value: 17,
|
||||
},
|
||||
],
|
||||
stockNum: 0, //可用库位数
|
||||
taskPriority: 2, //优先级
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || undefined;
|
||||
this.stepNum = 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.productArr = res.data.list;
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
} else {
|
||||
@@ -292,11 +472,21 @@ export default {
|
||||
//下一步
|
||||
nextSubmit() {
|
||||
if (this.stepNum == 1) {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
this.stepNum += 1;
|
||||
this.getEndPot();
|
||||
this.$emit('setSN', this.stepNum);
|
||||
return;
|
||||
});
|
||||
}
|
||||
if (this.stepNum == 2) {
|
||||
if (this.dataForm.quantity > this.stockNum) {
|
||||
this.$message('请注意搬运数量超过可用库位');
|
||||
return;
|
||||
}
|
||||
this.stepNum += 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
return;
|
||||
@@ -309,10 +499,50 @@ export default {
|
||||
},
|
||||
cancelStep() {},
|
||||
|
||||
// 第一步方法
|
||||
setStartPot(data) {
|
||||
data.status = data.status == 1 ? 2 : 1;
|
||||
validateNumber() {
|
||||
const value = this.dataForm.quantity;
|
||||
|
||||
// 校验正整数且为双数
|
||||
if (!/^[1-9]\d*$/.test(value) || value % 2 !== 0) {
|
||||
this.$message.error('请输入正整数且为双数');
|
||||
this.dataForm.quantity = '';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
setMaterial() {
|
||||
const data = this.productArr.find((i) => i.id === this.dataForm.productId)
|
||||
this.dataForm.materialName = data.materialName
|
||||
this.dataForm.materialCode = data.materialCode
|
||||
this.dataForm.material = data.material
|
||||
},
|
||||
// 获取终点库区
|
||||
getEndPot() {
|
||||
this.PotList = {};
|
||||
this.stockNum = 0;
|
||||
getRegion(this.endPot).then((res) => {
|
||||
res.data.forEach((item) => {
|
||||
if (item.lineEdgeLibraryState == 0 && item.usableState == 1) {
|
||||
this.stockNum += 1;
|
||||
}
|
||||
});
|
||||
//提取巷道
|
||||
let xiangdaoArr = res.data.map((item) =>
|
||||
item.bindGroupId.substring(0, 5)
|
||||
);
|
||||
//提取去重
|
||||
xiangdaoArr = [...new Set(xiangdaoArr)];
|
||||
//巷道为对象名,巷道内库位赋给巷道
|
||||
xiangdaoArr.forEach((objName) => {
|
||||
const stockArr = res.data.filter((item) => {
|
||||
if (item.bindGroupId.substring(0, 5) == objName) return item;
|
||||
});
|
||||
this.$set(this.PotList, objName, stockArr);
|
||||
});
|
||||
});
|
||||
},
|
||||
setStartPot(data) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -347,7 +577,7 @@ export default {
|
||||
display: flex;
|
||||
}
|
||||
.potTitle {
|
||||
width: 82px;
|
||||
width: 190px;
|
||||
background-color: rgb(169, 235, 249);
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
@@ -355,17 +585,19 @@ export default {
|
||||
color: #000000;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.potList {
|
||||
width: 82px;
|
||||
width: 190px;
|
||||
display: grid;
|
||||
grid-template-columns: 40px 40px;
|
||||
gap: 2px;
|
||||
grid-template-columns: 90px 90px;
|
||||
gap: 8px;
|
||||
}
|
||||
.pot {
|
||||
width: 40px;
|
||||
width: 90px;
|
||||
text-align: center;
|
||||
border: 1px solid gainsboro;
|
||||
color: black;
|
||||
border-radius: 3px;
|
||||
padding: 5px 0;
|
||||
margin-bottom: 5px;
|
||||
@@ -373,6 +605,29 @@ export default {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
/* 空闲状态 */
|
||||
.free {
|
||||
background-color: #edf7ff;
|
||||
border: 1px solid #57a5f4;
|
||||
}
|
||||
|
||||
/* 满位状态 */
|
||||
.full {
|
||||
background-color: #fff1d4;
|
||||
border: 1px solid #f8b881;
|
||||
}
|
||||
|
||||
/* 不可用状态 */
|
||||
.unavailable {
|
||||
background-color: #e9e8e8;
|
||||
border: 1px solid #b4b4b4;
|
||||
}
|
||||
|
||||
/* 锁定状态 */
|
||||
.locked {
|
||||
background-color: #e8d7ff;
|
||||
border: 1px solid #722ed1;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- //序号圆点 -->
|
||||
@@ -433,7 +688,7 @@ export default {
|
||||
}
|
||||
|
||||
.connector {
|
||||
width: 160px; /* 计算连接线长度 */
|
||||
width: 220px; /* 计算连接线长度 */
|
||||
height: 2px;
|
||||
border-bottom: 1px dashed rgb(11, 88, 255, 1);
|
||||
margin: 0 5px;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-07 17:01:51
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-07 22:31:17
|
||||
* @LastEditTime: 2025-11-17 15:47:16
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -15,11 +15,20 @@
|
||||
<div class="bgDiv1">
|
||||
<el-row :gutter="20" style="margin-bottom: 15px">
|
||||
<el-col :span="8" style="font-size: 20px; font-weight: 600">
|
||||
TSK202510230001
|
||||
{{ infoData.mainTaskCode }}
|
||||
</el-col>
|
||||
<el-col :span="8">满盘搬运(自动)</el-col>
|
||||
<el-col :span="8">
|
||||
上次刷新:{{ parseTime(Date.now()) }}
|
||||
{{
|
||||
['', '满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][
|
||||
infoData.mainTaskType
|
||||
] +
|
||||
'(' +
|
||||
['', '自动', '人工'][infoData.taskAttribute] +
|
||||
')'
|
||||
}}
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
上次刷新:{{ parseTime(nowDate) }}
|
||||
<el-button type="text" @click="refresh">刷新</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -31,23 +40,25 @@
|
||||
<el-row :gutter="20" style="margin-bottom: 15px">
|
||||
<el-col :span="8">
|
||||
<span
|
||||
:style="{ backgroundColor: statusColor[1].color }"
|
||||
:style="{
|
||||
backgroundColor: statusColor[infoData.mainTaskState].color,
|
||||
}"
|
||||
class="taskStatus">
|
||||
{{ statusColor[1].label }}
|
||||
{{ statusColor[infoData.mainTaskState].label }}
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="8">中</el-col>
|
||||
<el-col :span="8">--</el-col>
|
||||
<el-col :span="8">
|
||||
{{ ['最高', '较高', '常规', '较低', '最低'][infoData.taskPriority] }}
|
||||
</el-col>
|
||||
<el-col :span="8">{{ infoData.agv }}</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">执行时长</el-col>
|
||||
<el-col :span="8">创建人</el-col>
|
||||
<el-col :span="8">创建时间</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">--</el-col>
|
||||
<el-col :span="8">系统/张三</el-col>
|
||||
<el-col :span="8">{{ parseTime(Date.now()) }}</el-col>
|
||||
<el-col :span="8">{{ infoData.creator }}</el-col>
|
||||
<el-col :span="8">{{ parseTime(infoData.createTime) }}</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="bgDiv2">
|
||||
@@ -61,7 +72,9 @@
|
||||
<el-step title="执行中"></el-step>
|
||||
<el-step title="已完成"></el-step>
|
||||
</el-steps>
|
||||
<div class="abnormal">任务异常:无效路径</div>
|
||||
<div class="abnormal" v-if="infoData.mainTaskState == 7">
|
||||
任务异常:无效路径
|
||||
</div>
|
||||
</div>
|
||||
<div class="bgDiv3">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
@@ -71,16 +84,72 @@
|
||||
<el-col :span="12">
|
||||
<div class="pan-info">
|
||||
<div class="pan-title">L盘</div>
|
||||
<div class="pan-body">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">物料名称</el-col>
|
||||
<el-col :span="12">物料规格</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.leftMaterialName }}
|
||||
</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.leftMaterial }}
|
||||
</el-col>
|
||||
<el-col :span="12">物料编码</el-col>
|
||||
<el-col :span="12">批次</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.leftMaterialCode }}
|
||||
</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.leftBatch }}
|
||||
</el-col>
|
||||
<el-col :span="12">线缆长度</el-col>
|
||||
<el-col :span="12">虚拟盘号</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.leftCableLength }}
|
||||
</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.leftVirtualTrayNumber }}
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="pan-info">
|
||||
<div class="pan-title">R盘</div>
|
||||
<div class="pan-body">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">物料名称</el-col>
|
||||
<el-col :span="12">物料规格</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.rightMaterialName }}
|
||||
</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.rightMaterial }}
|
||||
</el-col>
|
||||
<el-col :span="12">物料编码</el-col>
|
||||
<el-col :span="12">批次</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.rightMaterialCode }}
|
||||
</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.rightBatch }}
|
||||
</el-col>
|
||||
<el-col :span="12">线缆长度</el-col>
|
||||
<el-col :span="12">虚拟盘号</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.rightCableLength }}
|
||||
</el-col>
|
||||
<el-col :span="12" style="color: black">
|
||||
{{ infoData.rightVirtualTrayNumber }}
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="bgDiv4">
|
||||
<div class="bgDiv4" v-if="false">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
回收信息
|
||||
</small-title>
|
||||
@@ -100,43 +169,64 @@
|
||||
任务明细
|
||||
</small-title>
|
||||
<el-descriptions :column="2" size="medium" border>
|
||||
<el-descriptions-item label="起点库位(L/R)">
|
||||
CK-01-A05-L / R
|
||||
<el-descriptions-item label="起点库位( L )(候选)">
|
||||
{{ infoData.leftLibraryStartName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="终点库位(L/R)">
|
||||
CC-02-B03-L/R (候选 )
|
||||
<el-descriptions-item label="终点库位( L )(候选)">
|
||||
{{ infoData.leftLibraryEndName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="起点策略">--</el-descriptions-item>
|
||||
<el-descriptions-item label="终点策略">入库策略</el-descriptions-item>
|
||||
<el-descriptions-item label="FMS任务号">--</el-descriptions-item>
|
||||
<el-descriptions-item label="车辆位置">--</el-descriptions-item>
|
||||
<el-descriptions-item label="电量">--</el-descriptions-item>
|
||||
<el-descriptions-item label="是否载货">--</el-descriptions-item>
|
||||
<el-descriptions-item label="创建方式">自动/人工</el-descriptions-item>
|
||||
<el-descriptions-item label="任务来源">
|
||||
PDA/PC/系统
|
||||
<el-descriptions-item label="起点库位( R )(候选)">
|
||||
{{ infoData.rightLibraryStartName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="终点库位( R )(候选)">
|
||||
{{ infoData.rightLibraryEndName }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item
|
||||
label="起点库位( L )"
|
||||
:labelStyle="{ background: '#f1ffe9' }">
|
||||
{{ infoData.changeLeftLibraryStartName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="终点库位( L )"
|
||||
:labelStyle="{ background: '#f1ffe9' }">
|
||||
{{ infoData.changeLeftLibraryEndName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="起点库位( R )"
|
||||
:labelStyle="{ background: '#f1ffe9' }">
|
||||
{{ infoData.changeRightLibraryStartName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="终点库位( R )"
|
||||
:labelStyle="{ background: '#f1ffe9' }">
|
||||
{{ infoData.changeRightLibraryEndName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关联叫料单">--</el-descriptions-item>
|
||||
<el-descriptions-item label=""></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="bgDiv6">
|
||||
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||
任务日志
|
||||
</small-title>
|
||||
<div class="timelineDiv">
|
||||
<el-timeline style="padding: 0">
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
:type="activity.type"
|
||||
:type="index == 0 ? 'primary' : ''"
|
||||
:color="activity.color"
|
||||
size="large"
|
||||
hide-timestamp>
|
||||
<span>{{ activity.content }}</span>
|
||||
<span style="float: right">{{ activity.timestamp }}</span>
|
||||
<span>
|
||||
{{ activity.triggerObject + ' | ' + activity.description }}
|
||||
</span>
|
||||
<span style="float: right">
|
||||
{{ parseTime(activity.createTime) }}
|
||||
</span>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
@@ -147,48 +237,33 @@
|
||||
</template>
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { getTask, getTaskLogPage } from '@/api/ssdl/taskList';
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
title: '',
|
||||
infoID: '',
|
||||
infoData: '',
|
||||
statusColor: [
|
||||
//bgDiv1的任务状态
|
||||
{ label: '待下发', color: '#fa8c16' },
|
||||
{ label: '待执行', color: '#1890ff' },
|
||||
{ label: '执行中', color: '#1890ff' },
|
||||
{ label: '取货完成', color: '#52c41a' },
|
||||
{ label: '已完成', color: '#52c41a' },
|
||||
{ label: '暂停中', color: '#8c8c8c' },
|
||||
{ label: '已终止', color: '#faad14' },
|
||||
{ label: '异常', color: '#ff4d4f' },
|
||||
{ label: '禁用', color: '#d9d9d9' },
|
||||
],
|
||||
nowDate: Date.now(),
|
||||
//bgDiv2的步骤条
|
||||
stepNum: 2,
|
||||
stepNum: 0,
|
||||
stepStatus: 'finish',
|
||||
//bgDiv6的时间线
|
||||
|
||||
activities: [
|
||||
{
|
||||
content: 'FMS | 卸货完成,任务完成',
|
||||
timestamp: '2018-04-12 20:46',
|
||||
type: 'primary',
|
||||
},
|
||||
{
|
||||
content: 'FMS | 取货完成',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
},
|
||||
{
|
||||
content: 'FMS | 派车AGV-03,前往起点取货',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
},
|
||||
{
|
||||
content: '张三 | 任务扫码配对完成,进入待下发',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
},
|
||||
],
|
||||
activities: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -196,13 +271,37 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
init(val) {
|
||||
init(id) {
|
||||
this.visible = true;
|
||||
this.infoID = id;
|
||||
this.$nextTick(() => {
|
||||
this.getInfoData();
|
||||
});
|
||||
},
|
||||
getInfoData() {
|
||||
getTask(this.infoID).then(({ data }) => {
|
||||
this.infoData = data;
|
||||
if (data.mainTaskState < 3) {
|
||||
this.stepNum = data.mainTaskState;
|
||||
} else if (data.mainTaskState == 4) {
|
||||
this.stepNum = 3;
|
||||
}
|
||||
getTaskLogPage({
|
||||
mainTaskId: this.infoID,
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
}).then(({ data }) => {
|
||||
this.activities = data.list.sort((a, b) => a.timestamp - b.timestamp);
|
||||
});
|
||||
});
|
||||
},
|
||||
//刷新
|
||||
refresh() {},
|
||||
refresh() {
|
||||
this.nowDate = Date.now();
|
||||
this.getInfoData();
|
||||
},
|
||||
closeD() {
|
||||
this.visible = false
|
||||
this.visible = false;
|
||||
this.$emit('closeDrawer');
|
||||
},
|
||||
},
|
||||
@@ -211,11 +310,10 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bgDiv1 {
|
||||
background-color: rgba(242, 242, 242, 0.5);
|
||||
background-color: #f1f9ff;
|
||||
padding: 20px;
|
||||
line-height: 25px;
|
||||
font-size: 15px;
|
||||
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||
.taskStatus {
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
@@ -224,8 +322,18 @@ export default {
|
||||
}
|
||||
}
|
||||
.bgDiv2 {
|
||||
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||
padding: 18px 0;
|
||||
background-image: linear-gradient(
|
||||
to right,
|
||||
transparent 0%,
|
||||
#c5c5c5 10%,
|
||||
#c5c5c5 90%,
|
||||
transparent 100%
|
||||
);
|
||||
background-position: bottom;
|
||||
background-size: 100% 1px;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 1px;
|
||||
.abnormal {
|
||||
width: 80%;
|
||||
margin: auto;
|
||||
@@ -242,11 +350,12 @@ export default {
|
||||
.bgDiv3 {
|
||||
padding: 20px 20px 0;
|
||||
.pan-info {
|
||||
height: 350px;
|
||||
height: 200px;
|
||||
border: 1px solid rgba(121, 121, 121, 0.8);
|
||||
border-radius: 5px;
|
||||
.pan-title {
|
||||
background-color: rgba(242, 242, 242, 0.5);
|
||||
background-color: #d8eeff;
|
||||
border-radius: 5px;
|
||||
height: 35px;
|
||||
font-size: 20px;
|
||||
line-height: 35px;
|
||||
@@ -254,6 +363,11 @@ export default {
|
||||
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.pan-body {
|
||||
padding: 15px;
|
||||
font-size: 16px;
|
||||
color: rgba(121, 121, 121, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.bgDiv4 {
|
||||
@@ -264,6 +378,11 @@ export default {
|
||||
}
|
||||
.bgDiv6 {
|
||||
padding: 20px 20px 0;
|
||||
.timelineDiv {
|
||||
padding: 5px;
|
||||
height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:19:24
|
||||
* @LastEditTime: 2025-11-17 09:28:31
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val2
|
||||
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||
(injectData.mainTaskType
|
||||
? ['','满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.mainTaskType]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:20:43
|
||||
* @LastEditTime: 2025-11-17 11:11:56
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val3
|
||||
? ['待下发', '待执行', '执行中', '已完成', '暂停中', '已终止', '异常'][injectData.val3]
|
||||
(injectData.mainTaskState
|
||||
? ['待下发', '待执行', '执行中', '取货完成','已完成', '暂停中', '终止', '异常'][injectData.mainTaskState]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:37:02
|
||||
* @LastEditTime: 2025-11-17 14:35:35
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -16,11 +16,14 @@
|
||||
background-color: #e89b24;
|
||||
color: #fff;
|
||||
text-align:center;
|
||||
line-height:16px
|
||||
line-height:16px;
|
||||
margin-right:5px
|
||||
">
|
||||
L
|
||||
</div>
|
||||
产品名称+产品规格
|
||||
<span v-if="injectData.prop==='val4'">{{injectData.leftMaterialName+'-'+injectData.leftMaterialCode}}</span>
|
||||
<span v-else-if="injectData.prop==='val5'">{{injectData.leftLibraryStartName}}</span>
|
||||
<span v-else-if="injectData.prop==='val6'">{{injectData.leftLibraryStartName}}</span>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center">
|
||||
<div
|
||||
@@ -31,11 +34,14 @@
|
||||
background-color: #6a96ec;
|
||||
color: #fff;
|
||||
text-align:center;
|
||||
line-height:16px
|
||||
line-height:16px;
|
||||
margin-right:5px
|
||||
">
|
||||
R
|
||||
</div>
|
||||
产品名称+产品规格
|
||||
<span v-if="injectData.prop==='val4'">{{injectData.rightMaterialName+'-'+injectData.rightMaterialCode}}</span>
|
||||
<span v-else-if="injectData.prop==='val5'">{{injectData.rightLibraryStartName}}</span>
|
||||
<span v-else-if="injectData.prop==='val6'">{{injectData.rightLibraryEndName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -51,7 +57,8 @@ export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
created() {
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:19:24
|
||||
* @LastEditTime: 2025-11-17 09:32:07
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val2
|
||||
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||
: '-')
|
||||
injectData.agv
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
82
src/views/taskCenter/taskList/components/subSpan5.vue
Normal file
82
src/views/taskCenter/taskList/components/subSpan5.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 16:17:21
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-17 16:30:28
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-popover placement="top" trigger="click" v-model="visible">
|
||||
优先级
|
||||
<el-select v-model="priority" placeholder="请选择优先级">
|
||||
<el-option
|
||||
v-for="item in priorityArr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
<div style="text-align: right; margin: 10px 10px 0">
|
||||
<el-button size="mini" type="text" @click="visible = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" @click="changePriority">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="text">
|
||||
{{ ['最高', '较高', '常规', '较低', '最低'][injectData.taskPriority] }}
|
||||
</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateTask } from '@/api/ssdl/taskList';
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData,
|
||||
visible: false,
|
||||
priorityArr: [
|
||||
{
|
||||
value: 0,
|
||||
label: '最高',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '较高',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '常规',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '较低',
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '最低',
|
||||
},
|
||||
],
|
||||
priority: '',
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changePriority() {
|
||||
const data = { ...this.injectData, taskPriority: this.priority };
|
||||
updateTask(data).then((res) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false
|
||||
this.$emit('emitData');
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -4,10 +4,9 @@
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
:isFold="true"
|
||||
@headBtnClick="buttonClick" />
|
||||
<div style="font-size: 14px">
|
||||
自动刷新(5s)
|
||||
自动刷新(10s)
|
||||
<el-switch v-model="autoRefresh"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,11 +16,12 @@
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:max-height="tableH"
|
||||
:table-data="tableData">
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="260"
|
||||
:width="100"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@@ -61,21 +61,12 @@
|
||||
@click="handleCancel">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="stepNum == 3"
|
||||
type="primary"
|
||||
class="btnTextStyle"
|
||||
size="small"
|
||||
plain
|
||||
@click="successSubmit">
|
||||
创建任务
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="btnTextStyle"
|
||||
size="small"
|
||||
@click="handleConfirm">
|
||||
{{ stepNum < 3 ? '下一步' : '创建并下发' }}
|
||||
{{ stepNum < 3 ? '下一步' : '创建任务' }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -106,29 +97,31 @@ import subSpan1 from './components/subSpan1.vue';
|
||||
import subSpan2 from './components/subSpan2.vue';
|
||||
import subSpan3 from './components/subSpan3.vue';
|
||||
import subSpan4 from './components/subSpan4.vue';
|
||||
import subSpan5 from './components/subSpan5.vue';
|
||||
import detailDrawer from './components/detailDrawer.vue';
|
||||
import stopInStock from './components/stopInStock.vue'
|
||||
import stopInStock from './components/stopInStock.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { getTaskPage } from '@/api/ssdl/taskList';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
prop: 'mainTaskCode',
|
||||
label: '任务编号',
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
prop: 'val1',
|
||||
prop: 'taskAttribute',
|
||||
label: '创建方式',
|
||||
filter: (val) => (val ? ['自动', '人工'][val] : '-'),
|
||||
filter: (val) => (val ? ['', '自动', '人工'][val] : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'val2',
|
||||
prop: 'mainTaskType',
|
||||
label: '任务类型',
|
||||
subcomponent: subSpan1,
|
||||
},
|
||||
{
|
||||
prop: 'val3',
|
||||
prop: 'mainTaskState',
|
||||
label: '状态',
|
||||
subcomponent: subSpan2,
|
||||
},
|
||||
@@ -136,19 +129,19 @@ const tableProps = [
|
||||
prop: 'val4',
|
||||
label: '搬运对象(L/R)',
|
||||
subcomponent: subSpan3,
|
||||
width: 160,
|
||||
width: 220,
|
||||
},
|
||||
{
|
||||
prop: 'val5',
|
||||
label: '起点(L/R)',
|
||||
subcomponent: subSpan3,
|
||||
width: 160,
|
||||
width: 220,
|
||||
},
|
||||
{
|
||||
prop: 'val6',
|
||||
label: '终点(L/R)',
|
||||
subcomponent: subSpan3,
|
||||
width: 160,
|
||||
width: 220,
|
||||
},
|
||||
{
|
||||
prop: 'val7',
|
||||
@@ -156,17 +149,16 @@ const tableProps = [
|
||||
subcomponent: subSpan4,
|
||||
},
|
||||
{
|
||||
prop: 'creatTime',
|
||||
prop: 'val8',
|
||||
label: '优先级',
|
||||
subcomponent: subSpan5,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
prop: 'Time',
|
||||
label: '执行时长',
|
||||
filter: (val) => parseTime(val, '{HH}:{mm}:{ss}'),
|
||||
width: 100,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
@@ -179,46 +171,20 @@ export default {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
{
|
||||
type: 'issue',
|
||||
btnName: '下发',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'pause',
|
||||
btnName: '暂停',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'unequal',
|
||||
name: 'status',
|
||||
value: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'reassign',
|
||||
btnName: '改派',
|
||||
},
|
||||
{
|
||||
type: 'stop',
|
||||
btnName: '终止',
|
||||
},
|
||||
{
|
||||
type: 'recycle',
|
||||
btnName: '回收',
|
||||
},
|
||||
// {
|
||||
// type: 'stop',
|
||||
// btnName: '终止',
|
||||
// showParam: {
|
||||
// type: '&',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'mainTaskState',
|
||||
// value: 2,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
@@ -238,15 +204,11 @@ export default {
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '备料搬运',
|
||||
name: '空盘搬运',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '临时搬运',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '空盘搬运',
|
||||
name: '备料搬运',
|
||||
},
|
||||
],
|
||||
param: 'val1',
|
||||
@@ -254,23 +216,15 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '业务类型',
|
||||
label: '创建方式',
|
||||
selectOptions: [
|
||||
{
|
||||
id: 1,
|
||||
name: '满盘搬运',
|
||||
name: '自动任务',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '空盘搬运',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '备料搬运',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '临时搬运',
|
||||
name: '人工任务',
|
||||
},
|
||||
],
|
||||
param: 'val2',
|
||||
@@ -281,20 +235,24 @@ export default {
|
||||
label: '状态',
|
||||
selectOptions: [
|
||||
{
|
||||
id: 1,
|
||||
id: 0,
|
||||
name: '待下发',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
id: 1,
|
||||
name: '待执行',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
id: 2,
|
||||
name: '执行中',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '取货完成',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '已完成',
|
||||
name: '完成',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
@@ -302,7 +260,7 @@ export default {
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: '已终止',
|
||||
name: '终止',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
@@ -312,46 +270,10 @@ export default {
|
||||
param: 'val3',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '执行车辆',
|
||||
selectOptions: [],
|
||||
param: 'val4',
|
||||
labelField: 'label',
|
||||
valueField: 'name',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '创建日期',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '回收任务',
|
||||
selectOptions: [
|
||||
{
|
||||
id: 1,
|
||||
name: '是',
|
||||
},
|
||||
{
|
||||
id: 0,
|
||||
name: '否',
|
||||
},
|
||||
],
|
||||
param: 'val5',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '编号',
|
||||
placeholder: '编号',
|
||||
label: '任务编号',
|
||||
placeholder: '任务编号',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
@@ -372,9 +294,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('monitoring:cost-othercost-log:create')
|
||||
? 'button'
|
||||
: '',
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@@ -396,7 +316,7 @@ export default {
|
||||
this.getDataList();
|
||||
this.refreshTimer = setInterval(() => {
|
||||
this.getDataList();
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
} else {
|
||||
// 关闭时清除定时器
|
||||
if (this.refreshTimer) {
|
||||
@@ -417,7 +337,9 @@ export default {
|
||||
detailDrawer,
|
||||
stopInStock,
|
||||
},
|
||||
created() {},
|
||||
created() {
|
||||
this.getDataList();
|
||||
},
|
||||
mounted() {
|
||||
this.autoRefresh = true;
|
||||
},
|
||||
@@ -427,11 +349,10 @@ export default {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name || null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.listQuery.mainTaskType = val.val1 || null;
|
||||
this.listQuery.taskAttribute = val.val2 || null;
|
||||
this.listQuery.mainTaskState = val.val3 || null;
|
||||
this.listQuery.mainTaskCode = val.code || null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
@@ -452,17 +373,12 @@ export default {
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.tableData = [
|
||||
{
|
||||
code: 1,
|
||||
},
|
||||
];
|
||||
// this.dataListLoading = true
|
||||
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
// this.tableData = response.data.list;
|
||||
// this.listQuery.total = response.data.total;
|
||||
// this.dataListLoading = false
|
||||
// });
|
||||
this.dataListLoading = true;
|
||||
getTaskPage(this.listQuery).then((response) => {
|
||||
this.tableData = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
@@ -490,29 +406,32 @@ export default {
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === 'stop') {
|
||||
if (val.data === '无货') {
|
||||
this.stopFun(val.data);
|
||||
} else {
|
||||
this.stopStockVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.stopStockRef.init();
|
||||
});
|
||||
}
|
||||
// if (val.data === '无货') {
|
||||
// this.stopFun(val.data);
|
||||
// } else {
|
||||
// this.stopStockVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.stopStockRef.init();
|
||||
// });
|
||||
// }
|
||||
} else if (val.type === 'detail') {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.detailDrawer.init(val.data, 'detail');
|
||||
this.$refs.detailDrawer.init(val.data.id, 'detail');
|
||||
});
|
||||
} else {
|
||||
this.otherMethods(val);
|
||||
}
|
||||
},
|
||||
stopFun(val) {
|
||||
this.$prompt('确认终止空载该任务?此操作不可恢复', '终止任务', {
|
||||
this.$prompt(
|
||||
'确认终止该任务?此操作任务立即终止,车辆保持暂停,请人工回收货物,释放车辆!',
|
||||
'终止任务',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPlaceholder: '请输入终止原因',
|
||||
})
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
console.log('终止原因' + value);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user