|
<template>
|
<div class="page-list-container">
|
<!--数据Table-->
|
<yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :data-list-selections.sync="dataListSelections" :action-field="actionField" :auth-nodes="authNodes" :on-delete-before="onDeleteBefore">
|
<template slot="common-column-slot" slot-scope="{row, col}">
|
<!--图片列处理-->
|
<template v-if="['filePath'].indexOf(col.prop)>=0">
|
<template v-for="(pic, index) in getPicList(row[col.prop])">
|
<img :key="index" :src="showSmallPic(pic)" class="pic" @click="showBigPic(pic)">
|
</template>
|
</template>
|
<template v-else-if="col.prop == 'orderStatus'">
|
<el-tag :color="setStatusBgColor(row[col.prop])" :style="setStatusColor(row[col.prop])">
|
{{ row[col.prop] }}
|
</el-tag>
|
</template>
|
<template v-else-if="col.prop==dataOptions.linkColumn">
|
<el-link type="primary" @click.native="()=>{linkEditor(row[dataOptions.idField]);}">{{ row[col.prop] }}</el-link>
|
</template>
|
<template v-else-if="col.dropdown_Id>0">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</template>
|
<template v-else>
|
<template v-if="['date', 'datetime'].indexOf(col.dataType)>=0 && col.formatter">
|
{{ common.formatDate(row[col.prop], col.formatter) }}
|
</template>
|
<template v-else-if="['byte', 'int32', 'int64', 'decimal', 'double'].indexOf(col.dataType)>=0 && col.formatter">
|
{{ common.formatNumber(row[col.prop], col.formatter) }}
|
</template>
|
<template v-else>
|
{{ row[col.prop] }}
|
</template>
|
</template>
|
</template>
|
</yrt-data-list>
|
|
<!--数据编辑器Editor-->
|
<yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes"></yrt-editor>
|
|
<!--预览图片-->
|
<el-dialog :visible.sync="dialogPicVisible" :append-to-body="true">
|
<img :src="dialogImageUrl" style="max-width:100%;">
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
|
export default {
|
name: "tms-way-upload-search",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {
|
authNodes: {
|
add: true,
|
Delete: true,
|
export: true,
|
save: true
|
},
|
// 图片域名地址
|
BASE_API: this.common.ossDomain,
|
// 显示图片放大窗口
|
dialogPicVisible: false,
|
// 图片放大地址
|
dialogImageUrl: null,
|
|
abnormalWaybillList: [], // 异常数据
|
remarkTextarea: null, // 备注
|
wayBillCode: null, // 当前运单号
|
actionField: {
|
prop: "_action",
|
label: "操作",
|
width: "100",
|
headerAlign: "center",
|
align: "center",
|
action: [
|
{
|
type: "button",
|
action: "edit",
|
label: "处理",
|
onClick: function(btnInfo, rowData, colInfo, the) {
|
if (rowData.orderStatus === "已录入") {
|
sessionStorage["TMS_WayBillUpload"] = JSON.stringify(rowData);
|
the.$router.push("/tms/way/bill-editor");
|
return true;
|
}
|
the.remarkTextarea = null;
|
the.wayBillCode = rowData.wayBillCode;
|
the.getAbnormalWaybillList(rowData.wayBillCode);
|
the.dialogFormVisible = true;
|
return true;
|
}
|
}
|
// {
|
// type: "button",
|
// action: "select",
|
// label: "查看",
|
// onClick: function(btnInfo, rowData, colInfo, the) {
|
// the.getAbnormalWaybillList(rowData.wayBillCode);
|
// the.SelectdialogFormVisible = true;
|
// return true;
|
// }
|
// }
|
],
|
hidden: false
|
},
|
// 状态值
|
statusValueList: [
|
{
|
status: "待录入",
|
bgColor: "#ffff99",
|
color: "black"
|
},
|
{
|
status: "正在录入",
|
bgColor: "#cc99ff",
|
color: "#fff"
|
},
|
{
|
status: "已录入",
|
bgColor: "#00ccff",
|
color: "#fff"
|
}
|
]
|
};
|
},
|
methods: {
|
// 状态背景颜色
|
setStatusBgColor(status) {
|
var colorItem = this.statusValueList.find(item => {
|
return item.status === status;
|
});
|
var bgColor = "#ffffff";
|
if (colorItem) bgColor = colorItem.bgColor;
|
|
return bgColor;
|
},
|
// 状态字体颜色
|
setStatusColor(status) {
|
var colorItem = this.statusValueList.find(item => {
|
return item.status === status;
|
});
|
var color = "#888";
|
if (colorItem) color = colorItem.color;
|
|
return {
|
border: 0,
|
color: color
|
};
|
},
|
// 将图片字符串转为数组
|
getPicList(pics) {
|
var picList = pics ? pics.split(",") : [];
|
|
return picList;
|
},
|
// 显示大图
|
showSmallPic(pic) {
|
return this.BASE_API + pic + "?x-oss-process=style/small";
|
},
|
// 显示大图
|
showBigPic(pic) {
|
this.dialogPicVisible = true;
|
this.dialogImageUrl = this.BASE_API + pic + "?x-oss-process=style/big";
|
},
|
// editButtonClick(){
|
// debugger;
|
// },
|
// 删除前事件
|
onDeleteBefore(rows) {
|
var existRows = rows.filter(row => {
|
return row.orderStatus === "已录入";
|
});
|
if (existRows.length) {
|
this.$message.error("状态为已录入的单子不允许删除");
|
return false;
|
}
|
|
return true;
|
},
|
getAbnormalWaybillList(code) {
|
var url = "/api/tms/wayBillAbnormal/getWayBillAbnormalList";
|
var params = {
|
wayBillCode: code
|
};
|
this.common.ajax(url, params, res => {
|
if (res.result) {
|
this.abnormalWaybillList = res.data;
|
} else {
|
this.$message.error(res.msg);
|
}
|
});
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
@import "@/styles/yrt-data-list.scss";
|
.pic {
|
width: 40px;
|
height: 40px;
|
cursor: pointer;
|
}
|
</style>
|