|
<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" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
|
<template slot="common-column-slot" slot-scope="{row, col}">
|
<template v-if="col.prop==='claimStatus'">
|
<el-tag v-if="row.claimStatus==='已提交'" color="#33ff66" style="color:#838383;">
|
{{ row[col.prop] }}
|
</el-tag>
|
<el-tag v-else color="#ffffcc" style="color:#838383;">
|
{{ row[col.prop] }}
|
</el-tag>
|
</template>
|
<!--图片列处理-->
|
<template v-else-if="['wayBillPicture', 'packagePicture', 'receiptPicture'].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==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" :button-list="buttonList" @on-change="onChange"></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: "user-service-claim",
|
// 自定义JSON路由地址
|
custoJsonmRoute: "/user/service/claim",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {
|
// 权限点
|
authNodes: {
|
add: true,
|
delete: true,
|
export: true,
|
save: true,
|
auditing: true,
|
batchAuditing: true
|
},
|
// 编辑页面按钮列表
|
buttonList: [
|
{
|
label: "提交",
|
authName: "auditing",
|
icon: "el-icon-yrt-qiyong",
|
type: "success"
|
}
|
],
|
// 域名地址
|
BASE_API: process.env.BASE_API,
|
// 显示图片放大窗口
|
dialogPicVisible: false,
|
// 图片放大地址
|
dialogImageUrl: null
|
};
|
},
|
computed: {},
|
methods: {
|
// 将图片字符串转为数组
|
getPicList(pics) {
|
var picList = pics ? pics.split(",") : [];
|
|
return picList;
|
},
|
// 显示小图
|
showSmallPic(pic) {
|
if (pic) {
|
if (pic.indexOf("http") >= 0) {
|
return pic + "?x-oss-process=style/small";
|
} else {
|
return this.BASE_API + pic + "?x-oss-process=style/small";
|
}
|
} else {
|
return "";
|
}
|
},
|
// 显示大图
|
showBigPic(pic) {
|
this.dialogPicVisible = true;
|
if (pic) {
|
if (pic.indexOf("http") >= 0) {
|
this.dialogImageUrl = pic + "?x-oss-process=style/big";
|
} else {
|
this.dialogImageUrl = this.BASE_API + pic + "?x-oss-process=style/big";
|
}
|
} else {
|
this.dialogImageUrl = "";
|
}
|
},
|
// 明细change事件
|
onChange(ref, val, field, formData) {
|
if (!formData.wayBillCode) {
|
return;
|
}
|
|
if (field.options.prop === "wayBillCode") {
|
this.getWayInfo(formData);
|
}
|
if (field.options.prop === "expressCode") {
|
this.getWayInfoByExpressCode(formData);
|
}
|
},
|
getWayInfoByExpressCode(formData) {
|
const url = "/api/tms/user/claim/getWayInfoByExpressCode";
|
const params = {
|
code: formData.expressCode
|
};
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
if (res.result) {
|
if (res.data) {
|
this.editor.changeValue("expressCode", res.data.expressCode);
|
this.editor.changeValue("storage_Id", res.data.storage_Id);
|
this.editor.changeValue("storageName", res.data.storageName);
|
} else {
|
formData.contacts = null;
|
formData.mobile = null;
|
formData.quantityClaim = null;
|
this.$message.error("运单号号不存在!");
|
}
|
} else {
|
this.common.showMsg(res);
|
}
|
},
|
true
|
);
|
},
|
// 获得运单信息
|
getWayInfo(formData) {
|
const url = "/api/tms/user/claim/getWayInfoBydCode";
|
const params = {
|
code: formData.wayBillCode
|
};
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
if (res.result) {
|
if (res.data) {
|
this.editor.changeValue("expressCode", res.data.expressCode);
|
this.editor.changeValue("storage_Id", res.data.storage_Id);
|
this.editor.changeValue("storageName", res.data.storageName);
|
// this.editor.changeValue(
|
// "mobile",
|
// res.data.ConsigneeMobile
|
// );
|
// this.editor.changeValue(
|
// "quantityClaim",
|
// res.data.TotalQuantityOrder
|
// );
|
}
|
// else {
|
// formData.contacts = null;
|
// formData.mobile = null;
|
// formData.quantityClaim = null;
|
// this.$message.error("运单号号不存在!");
|
// }
|
} else {
|
this.common.showMsg(res);
|
}
|
},
|
true
|
);
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
@import "@/styles/yrt-data-list.scss";
|
.pic {
|
width: 40px;
|
height: 40px;
|
cursor: pointer;
|
}
|
</style>
|