|
<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" @on-load-data-after="onLoadDataAfter">
|
<template slot="common-column-slot" slot-scope="{row, col}">
|
|
<!--图片列处理-->
|
<template v-if="['images'].indexOf(col.prop)>=0">
|
<template v-for="(item, index) in row.images">
|
<img :key="index" :src="showSmallPic(item)" class="pic" @click="showBigPic(item)">
|
</template>
|
</template>
|
<!--审核字段-->
|
<template v-else-if="col.prop=='auditing'">
|
<template>
|
<el-tag v-if="row[col.prop]==0" color="#ffff33" style="color:black;border:0">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</el-tag>
|
<!-- <el-tag v-else-if="row[col.prop]==1" color="#ff0033" style="color:white;border:0">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</el-tag> -->
|
<el-tag v-else-if="row[col.prop]==2" color="#33cc33" style="color:black;border:0;color:#fff;">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</el-tag>
|
<span v-else>
|
{{ row[col.prop] }}
|
</span>
|
</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" :edit-button-click="editButtonClick" :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";
|
import yrtSelector from "@/components/common/yrtSelector.vue";
|
|
export default {
|
name: "crm-app-productApply",
|
components: { yrtSelector },
|
mixins: [baseLayout],
|
data() {
|
return {
|
// 表单默认值,新建时用
|
defaultValue: {
|
auditing: 0,
|
consignor_Id: null,
|
consignorCode: null,
|
consignorName: null,
|
provider_Id: null,
|
providerCode: null,
|
providerShortName: null
|
},
|
// 显示图片放大窗口
|
dialogPicVisible: false,
|
// 图片放大地址
|
dialogImageUrl: null
|
};
|
},
|
methods: {
|
// 显示大图
|
showSmallPic(item) {
|
return item.url + "?x-oss-process=style/small";
|
},
|
// 显示大图
|
showBigPic(item) {
|
this.dialogPicVisible = true;
|
this.dialogImageUrl = item.url + "?x-oss-process=style/big";
|
},
|
// 列表页面数据加载完毕后事件
|
onLoadDataAfter(dataList) {
|
// 处理数据
|
dataList.forEach(row => {
|
row.images = JSON.parse(row.images);
|
});
|
},
|
// 编辑按钮点击事件
|
editButtonClick(authNode, formData) {
|
switch (authNode) {
|
case "auditing":
|
// 批量审核
|
this.batchAuditing([formData]);
|
return false;
|
}
|
},
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "auditing":
|
// 批量审核
|
this.batchAuditing(this.dataListSelections);
|
return false;
|
// case "reAudit":
|
// this.funReAudit();
|
// return false;
|
// case "printAction1":
|
// case "printAction2":
|
// case "printAction3":
|
// this.printBarcode(authNode);
|
// return false;
|
// case "import":
|
// // 导入
|
// this.importConfig.isShowDialog = true;
|
// return true;
|
}
|
},
|
// 批量审核
|
batchAuditing(dataListSelections) {
|
// let isok = true;
|
const productApply_Id = dataListSelections.map((item, index, Array) => {
|
return item.productApply_Id;
|
});
|
if (!productApply_Id.length) {
|
this.$message.error("请至少选择一行数据!");
|
return false;
|
}
|
this.$confirm("提示:确认后将无法进行修改", "确认审核", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
const url = "/api/crm/app/appProductApply/productAuditing";
|
const params = {
|
openNodeApi: true,
|
IDs: productApply_Id.join(",")
|
};
|
const ref = this.dataList;
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
this.editorOptions.config.visible = false;
|
}
|
};
|
this.common.ajax(url, params, callback, ref);
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
}
|
}
|
};
|
</script>
|