|
|
@@ -23,6 +23,11 @@
|
|
|
@saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 292)"
|
|
|
@on-load="onLoad">
|
|
|
<template slot="menuLeft">
|
|
|
+ <el-button type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="addbtnfun()">新建航线
|
|
|
+ </el-button>
|
|
|
<el-button type="danger"
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
@@ -30,6 +35,30 @@
|
|
|
@click="handleDelete">删 除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowViewfun(scope.row,scope.index)"
|
|
|
+ >查看
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowEditfun(scope.row,scope.index)"
|
|
|
+ >编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowDel(scope.row,scope.index)"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ </template>
|
|
|
<template slot="remarks" slot-scope="scope">
|
|
|
<avue-text-ellipsis :text="scope.row.remarks" :height="30" use-tooltip placement="top">
|
|
|
<small slot="more">...</small>
|
|
|
@@ -37,14 +66,14 @@
|
|
|
</template>
|
|
|
<template slot="carrierNameForm">
|
|
|
<search-query ref="SearchQuery"
|
|
|
- :datalist="carrierData"
|
|
|
+ :datalist="corpData"
|
|
|
title="船公司"
|
|
|
:filterable="true"
|
|
|
:clearable="true"
|
|
|
:remote="true"
|
|
|
- :forParameter="{key:'id',label:'cnName',value:'cnName'}"
|
|
|
- @remoteMethod="shippingCompanyfun" @corpChange="corpChange" >
|
|
|
- 插槽
|
|
|
+ :forParameter="{key:'id',label:'cnName',value:'id'}"
|
|
|
+ @remoteMethod="getBcorpsListfun" @corpChange="corpCorpChange" >
|
|
|
+ <bcorps></bcorps>
|
|
|
</search-query>
|
|
|
</template>
|
|
|
<template slot="extendedDataArr" slot-scope="scope">
|
|
|
@@ -126,17 +155,18 @@
|
|
|
import {blinesList, blinesDetail, blinesSubmit, blinesRemove} from "@/api/iosBasicData/blines";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
+ import bcorps from "@/views/iosBasicData/bcorps/index.vue";
|
|
|
+ import {getBcorpsList} from "@/api/iosBasicData/bcorps";
|
|
|
|
|
|
export default {
|
|
|
- components: { SearchQuery},
|
|
|
+ components: {bcorps, SearchQuery},
|
|
|
data() {
|
|
|
return {
|
|
|
- // 船公司数据
|
|
|
- carrierData:[],
|
|
|
+ // 客户(船公司)数据
|
|
|
+ corpData:[],
|
|
|
// 扩展数据弹窗
|
|
|
dialogVisible:false,
|
|
|
extendedDisabled:false,
|
|
|
-
|
|
|
form: {
|
|
|
extendedDataArr:[],
|
|
|
},
|
|
|
@@ -150,11 +180,17 @@
|
|
|
selectionList: [],
|
|
|
option:{},
|
|
|
optionBack: {
|
|
|
+ addBtnText:'新建航线',
|
|
|
+ addTitle:'新建航线',
|
|
|
+ editBtnText:'编辑航线',
|
|
|
+ editTitle:'编辑航线',
|
|
|
+ viewBtnText:'查看航线',
|
|
|
+ viewTitle:'查看航线',
|
|
|
height:'auto',
|
|
|
calcHeight: 30,
|
|
|
tip: false,
|
|
|
searchShow: true,
|
|
|
- searchMenuSpan: 24,
|
|
|
+ searchMenuSpan: 6,
|
|
|
border: true,
|
|
|
index: true,
|
|
|
viewBtn: true,
|
|
|
@@ -317,10 +353,10 @@
|
|
|
...mapGetters(["permission"]),
|
|
|
permissionList() {
|
|
|
return {
|
|
|
- // addBtn: this.vaildData(this.permission.blines_add, false),
|
|
|
- // viewBtn: this.vaildData(this.permission.blines_view, false),
|
|
|
- // delBtn: this.vaildData(this.permission.blines_delete, false),
|
|
|
- // editBtn: this.vaildData(this.permission.blines_edit, false)
|
|
|
+ addBtn: this.vaildData(this.permission.blines_add, false),
|
|
|
+ viewBtn: this.vaildData(this.permission.blines_view, false),
|
|
|
+ delBtn: this.vaildData(this.permission.blines_delete, false),
|
|
|
+ editBtn: this.vaildData(this.permission.blines_edit, false)
|
|
|
};
|
|
|
},
|
|
|
ids() {
|
|
|
@@ -333,6 +369,7 @@
|
|
|
},
|
|
|
async created() {
|
|
|
this.option = await this.getColumnData(this.getColumnName(292), this.optionBack);
|
|
|
+ this.getBcorpsListfun()
|
|
|
},
|
|
|
methods: {
|
|
|
// 扩展数据表格点击查询详情
|
|
|
@@ -360,26 +397,48 @@
|
|
|
},
|
|
|
// 扩展数据编辑
|
|
|
extendedDataEdit(index,row) {
|
|
|
- row.edit = !row.edit
|
|
|
+ this.$set(row,'edit',!row.edit)
|
|
|
+ // row.edit = !row.edit
|
|
|
},
|
|
|
// 扩展数据删除
|
|
|
extendedDataDelete(index,row) {
|
|
|
this.form.extendedDataArr.splice(index,1)
|
|
|
},
|
|
|
|
|
|
- // 获取船公司数据
|
|
|
- shippingCompanyfun(cnName){
|
|
|
- // getBunitsList(1, 10,{cnName}).then(res=>{
|
|
|
- // this.unitNoData = res.data.data.records
|
|
|
- // })
|
|
|
+ // 获取客户(船公司)数据
|
|
|
+ getBcorpsListfun(cnName){
|
|
|
+ getBcorpsList(1,10,{cnName}).then(res=>{
|
|
|
+ this.corpData = res.data.data.records
|
|
|
+ })
|
|
|
},
|
|
|
// 船公司选中的回调
|
|
|
- corpChange(value){
|
|
|
- // for(let item of this.unitNoData) {
|
|
|
- // if (item.id == value) {
|
|
|
- // this.form.unitNo = item.cnName
|
|
|
- // }
|
|
|
- // }
|
|
|
+ corpCorpChange(value){
|
|
|
+ for(let item of this.corpData) {
|
|
|
+ if (item.id == value) {
|
|
|
+ this.$set(this.form,'carrierId',item.id)
|
|
|
+ this.$set(this.form,'carrierName',item.cnName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ addbtnfun(){
|
|
|
+ this.form.status = 0
|
|
|
+ this.$refs.crud.rowAdd()
|
|
|
+ },
|
|
|
+ // 查看
|
|
|
+ rowViewfun(row,index){
|
|
|
+ this.extendedDisabled = true
|
|
|
+ this.$refs.crud.rowView(row,index)
|
|
|
+ },
|
|
|
+ // 编辑
|
|
|
+ rowEditfun(row,index){
|
|
|
+ blinesDetail(row.id).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.form.extendedDataArr.map(item=>{
|
|
|
+ item.edit = false
|
|
|
+ })
|
|
|
+ this.$refs.crud.rowEdit(row,index)
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
rowSave(row, done, loading) {
|