<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" :button-click="buttonClick" :action-field="actionField" :quick-search-fields="quickSearchFields" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
|
<!-- 字段插槽 -->
|
<template slot="common-column-slot" slot-scope="{ row, col }">
|
|
<template v-if="col.prop == 'orderStatus'">
|
<state-flow :load-options="stateLoadOptions" :where="{wayBillCode: row.wayBillCode}">
|
<template slot="content">
|
<el-tag :color="setStatusBgColor(row[col.prop])" :style="setStatusColor(row[col.prop])">
|
{{ row[col.prop] }}
|
</el-tag>
|
</template>
|
</state-flow>
|
</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="dialogFormVisible" title="异常信息" width="700px">
|
<el-table :data="abnormalWaybillList" style="width: 100%">
|
<!-- <el-table-column prop="wayBillCode" label="运单号" width="130">
|
</el-table-column> -->
|
<el-table-column prop="abnormal" label="异常信息" width="200">
|
</el-table-column>
|
<el-table-column prop="abnormalDate" label="异常日期">
|
</el-table-column>
|
<el-table-column prop="abnormalStatus" label="异常状态">
|
</el-table-column>
|
</el-table>
|
<span>备注</span>
|
<el-input :rows="2" v-model="remarkTextarea" type="textarea" placeholder="请输入内容">
|
</el-input>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="Handleing()">处理中</el-button>
|
<el-button type="primary" @click="Handled()">处理完成</el-button>
|
<el-button @click="dialogFormVisible=false">取 消</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog :visible.sync="selectdialogFormVisible" title="异常信息-查看" width="700px">
|
<el-table :data="abnormalWaybillList" style="width: 100%">
|
<!-- <el-table-column prop="wayBillCode" label="运单号" width="130">
|
</el-table-column> -->
|
<el-table-column prop="abnormal" label="异常信息" width="200">
|
</el-table-column>
|
<el-table-column prop="abnormalDate" label="异常日期">
|
</el-table-column>
|
<el-table-column prop="abnormalStatus" label="异常状态">
|
</el-table-column>
|
<el-table-column prop="abnormalRemark" label="备注">
|
</el-table-column>
|
</el-table>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="selectdialogFormVisible=false">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
import stateFlow from "./components/stateflow.vue";
|
|
export default {
|
name: "tms-way-bill-abnormal",
|
components: { stateFlow },
|
mixins: [baseLayout],
|
data() {
|
return {
|
quickSearchFields: [
|
{
|
label: "异常日期",
|
prop: "createDate",
|
type: "input",
|
dataType: "datetime",
|
value: []
|
}
|
],
|
authNodes: {
|
export: true
|
},
|
dialogFormVisible: false, // 处理窗口
|
selectdialogFormVisible: false, // 查看窗口
|
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_AbnormalOrder"] = JSON.stringify(rowData);
|
// 返回地址
|
sessionStorage["goBackRouter"] = "/tms/way/bill-abnormal";
|
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: "#00ff99",
|
color: "black"
|
},
|
{
|
status: "处理中",
|
bgColor: "#ccff33",
|
color: "#828282"
|
},
|
{
|
status: "录入异常",
|
bgColor: "#cc6633",
|
color: "#fff"
|
},
|
{
|
status: "组板异常",
|
bgColor: "#ff6600",
|
color: "#fff"
|
}
|
],
|
// 状态流加载参数
|
stateLoadOptions: {
|
folder: "express/tms",
|
projectName: "Interface.Express",
|
tableView: "TMS_WayBillTracking",
|
idField: "wayBillTracking_Id",
|
sortName: "wayBillTracking_Id DESC",
|
pageIndex: 1,
|
pageSize: 100,
|
menu_Id: -1
|
}
|
};
|
},
|
methods: {
|
// 状态背景颜色
|
setStatusBgColor(status) {
|
var colorItem = this.statusValueList.find(item => {
|
return item.status === status;
|
});
|
var bgColor = "#fffff";
|
if (colorItem) bgColor = colorItem.bgColor;
|
|
return bgColor;
|
},
|
// 状态字体颜色
|
setStatusColor(status) {
|
var colorItem = this.statusValueList.find(item => {
|
return item.status === status;
|
});
|
var color = "#fffff";
|
if (colorItem) color = colorItem.color;
|
|
return {
|
border: 0,
|
color: color,
|
cursor: "pointer"
|
};
|
},
|
getAbnormalWaybillList(wayBillCode) {
|
var url = "/api/tms/waybillAbnormal/getWayBillAbnormalList";
|
var params = {
|
wayBillCode: wayBillCode
|
};
|
this.common.ajax(url, params, res => {
|
if (res.result) {
|
this.abnormalWaybillList = res.data;
|
} else {
|
this.$message.error(res.msg);
|
}
|
});
|
},
|
Handleing() {
|
var url = "/api/tms/waybillAbnormal/updateAbnormal";
|
var params = {
|
wayBillCode: this.wayBillCode,
|
type: "处理中",
|
abnormalRemark: this.remarkTextarea
|
};
|
this.common.ajax(url, params, res => {
|
if (res.result) {
|
this.getAbnormalWaybillList(this.wayBillCode);
|
this.$message({
|
type: "info",
|
message: res.msg
|
});
|
} else {
|
this.$message.error(res.msg);
|
}
|
this.dataList.reloadData();
|
this.dialogFormVisible = false;
|
});
|
},
|
Handled() {
|
var url = "/api/tms/waybillAbnormal/updateAbnormal";
|
var params = {
|
wayBillCode: this.wayBillCode,
|
type: "处理完成",
|
abnormalRemark: this.remarkTextarea
|
};
|
this.common.ajax(url, params, res => {
|
if (res.result) {
|
this.getAbnormalWaybillList(this.wayBillCode);
|
this.$message({
|
type: "info",
|
message: res.msg
|
});
|
} else {
|
this.$message.error(res.msg);
|
}
|
this.dataList.reloadData();
|
this.dialogFormVisible = false;
|
});
|
},
|
// 刷新数据
|
reload() {
|
this.dataList.reloadData();
|
}
|
}
|
};
|
</script>
|