Commit 1ae7ddb9 authored by 黄卓's avatar 黄卓

重泡货配置管理状态,列表文案

parent 4bb0524d
......@@ -40,13 +40,12 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="序号" type="index" width="50px" />
<el-table-column label="重泡货类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ZHONG_PAO_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="临介值" align="center" prop="edge" />
<el-table-column label="公式" align="center" prop="formulas" />
<el-table-column label="传输方式" align="center" prop="transportTypes">
<template slot-scope="scope">
<span v-for="item in scope.row.transportTypes.split(',')"><dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="item" />, </span>
......@@ -54,11 +53,18 @@
</el-table-column>
<el-table-column label="始发地" align="center" prop="departureId" :formatter="departureFormatter"/>
<el-table-column label="目的地" align="center" prop="objectiveIds" :formatter="objectiveFormatter"/>
<el-table-column label="临介值标准" align="center" prop="edge" />
<el-table-column label="计算公式" align="center" prop="formulas" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="transportTypes">
<template v-slot="scope">
<el-switch v-model="scope.row.status" @change="handleStatusChange(scope.row)" :active-value="0" :inactive-value="1"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
......@@ -124,6 +130,7 @@ import {parseTime} from "@/utils/ruoyi"
import DictSelector from "@/components/DictSelector"
import {getTradeCityList} from "@/api/ecw/region"
import {getWarehouseList} from "@/api/ecw/warehouse"
import { CommonStatusEnum } from '@/utils/constants'
export default {
name: "ZhongPao",
......@@ -177,6 +184,21 @@ export default {
})
},
methods: {
handleStatusChange(row){
console.log(row)
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用";
this.$modal.confirm('确认要' + text + '吗?').then(function() {
return updateZhongPao({
id: row.id,
status: row.status
})
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
: CommonStatusEnum.ENABLE;
});
},
departureFormatter(row, column, cellValue) {
if (cellValue === 0) return '全部'
return this.warehouseList.find(e => e.id === cellValue)?.titleZh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment