<template>
|
<div ref="container" 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" :load-data-before="loadDataBefore">
|
<div slot="datalist-customer-area">
|
总单量:{{ sumQuantity }},剩余单量:{{ surplusQuantity }}
|
</div>
|
</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" @on-change="onChange"></yrt-editor>
|
</div>
|
</template>
|
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
|
export default {
|
name: "api-internal-spare-code",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {
|
sumQuantity: 0,
|
surplusQuantity: "0"
|
};
|
},
|
methods: {
|
onChange(ref, val, field, formData) {
|
if (field.options.prop === "expressCorpType") {
|
this.$set(formData, "expressCorpName", null);
|
this.$set(formData, "expressCorpCode", null);
|
this.$set(formData, "expressCorp_Id", null);
|
|
var url = "/api/basicInfo/base/expressCorp/getList";
|
var params = {
|
expressCorpType: formData.expressCorpType
|
};
|
var callBack = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
var data = res.data.map(item => {
|
item.label = item.expressCorpName;
|
item.value = item.expressCorp_Id;
|
return item;
|
});
|
this.editor.setDropdownData(568, data);
|
}
|
};
|
this.common.ajax(url, params, callBack);
|
}
|
},
|
// 加载前事件,获取统计数据
|
loadDataBefore(params) {
|
const where = params.where;
|
var url = "/api/express/spareCode/getStatInfo";
|
params = {
|
idField: "expressSpareCode_Id",
|
where: where
|
};
|
var callBack = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.sumQuantity = res.data.sumQuantity;
|
this.surplusQuantity = res.data.surplusQuantity;
|
}
|
};
|
this.common.ajax(url, params, callBack);
|
}
|
}
|
};
|
</script>
|