<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>调价申请编辑</title>
|
<script src="../../../jsnew/elementDefault.js?v=20220425"></script>
|
<script src="../../../jsnew/vue/vue.js"></script>
|
<script src="../../../jsnew/vue/element-ui/element-ui_15/index.js"></script>
|
<script src="../../../jsnew/myelement.js?v=20220425"></script>
|
<script src="../../../jsnew/page.js?v=20220425"></script>
|
<script src="../../../js/vue/axios/dist/axios.min.js"></script>
|
<script src="../../../js/common.js"></script>
|
<!-- <script src="../../../setting.js"></script> -->
|
|
<link href="../../../jsnew/vue/element-ui/element-ui_15/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../jsnew/myelement.css?v=20220426" rel="stylesheet">
|
<link href="../../../jsnew/theme.css?v=20220426" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../jsnew/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<div class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}}</span>
|
</div>
|
</div>
|
|
<!-- <div style=" text-align: right; padding: 5px 30px 0px 0px;" v-if="!isedit">
|
<el-button :disabled="true" size="small" type="primary" @click="">导 出</el-button>
|
<el-button-group>
|
<el-button size="small" v-if="isapproval" type="primary" @click="">批 准</el-button>
|
<el-button size="small" v-if="isapproval" type="primary" @click="">退 回</el-button>
|
<el-button size="small" v-if="isapproval" type="primary" @click="">拒 绝</el-button>
|
<el-button size="small" v-if="isapproval" type="primary" @click="">转 发</el-button>
|
<el-button size="small" v-if="isapproval" type="primary" @click="">转 办</el-button>
|
</el-button-group>
|
<el-button :disabled="true" size="small" type="primary" @click="">打 印</el-button>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div> -->
|
<div class="el-dialog__footer" v-if="isapproval"><!-- || isbrowse -->
|
<el-button size="small" v-if="isapproval" type="primary" @click="exportList">导 出</el-button>
|
<el-button-group>
|
<el-button size="small" v-if="isapproval" type="success" @click="approvalOp(true)">批 准</el-button>
|
<el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">退 回</el-button>
|
<el-button size="small" v-if="isapproval" type="danger" @click="approvalOp(false)">拒 绝</el-button>
|
<el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">转 发</el-button>
|
<el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">转 办</el-button>
|
</el-button-group>
|
<el-button :disabled="true" :disabled="true" size="small" type="primary" @click="">打 印</el-button>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
|
<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
|
<div class="el-dialog__body">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
|
<div v-if="alertMessage" id="alertMessage" style="margin-top: 10px;">
|
<el-alert
|
:title="alertMessage"
|
type="warning"
|
>
|
</el-alert>
|
<!-- <el-alert
|
v-for="(item, key) in alertMessage"
|
:title="item"
|
type="warning"
|
>
|
</el-alert> -->
|
</div>
|
|
<div class="h_dialog__body">
|
<div style="display: flex; padding-top: 30px;">
|
<!-- 工具栏 -->
|
<div style="margin-right: auto; font-weight: bolder; font-size: medium; color: black;">
|
<span>原价格</span>
|
</div>
|
<div v-if="isedit || isrefuseedit" style="margin-left: auto;">
|
<el-button-group style="display: flex;">
|
<el-button @click="selectData">新增明细</el-button>
|
<el-button @click="moduleDownload">模板下载</el-button>
|
<input type="file" id="btn_file" style="display: none;" @change="getFile($event)" />
|
<el-button @click="fileUpload()">导 入</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
|
<h-table
|
v-if="isRefresh && tableFields.length"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isedit || isrefuseedit"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="tableData.length ? true : false"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
:is-highlight-row="true"
|
|
v-on:row-click="rowClick"
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
|
<div style="margin-right: auto; font-weight: bolder; font-size: medium; color: black; margin-top: 20px;">
|
<span>调价价格</span>
|
</div>
|
|
<h-table
|
v-if="isRefresh && tableFields2.length"
|
ref="table2"
|
:table-fields="tableFields2"
|
:table-data="tableData2"
|
:is-edit-table-data="false"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="tableData2.length ? true : false"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
:is-highlight-row="true"
|
|
v-on:row-click="rowClick"
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
</div>
|
|
<div class="h_dialog__body" style="padding-top: 30px;">
|
<h-form
|
ref="form2"
|
:form-attr="formAttr2"
|
:table-fields="formFields2"
|
:form-data="formData2"
|
:table-field-click="formfieldClick"
|
:is-end-colspan = "false"
|
>
|
</h-form>
|
|
<span v-if="popupParames.sceneCode == 'add' || popupParames.sceneCode == 'edit'" style="margin-left: 150px; color: #4b9ac6;">附件上传内容:调价补差明细表、库存盖章证明</span>
|
</div>
|
|
<div v-if="showApprovalInfo" style="height: 150px; border-top: 15px">
|
<!-- <iframe :src="'../../approval/ApprovalList_page.html?flow_id=' + flow_id" style="width: 100%; height: 100%; border: 0px;"></iframe> -->
|
<div style="width: 100%; height: 100%; border: 0px;">
|
<div class="topbar">
|
<span>审批记录</span>
|
|
<div style="float: right; margin-right: 20px;">
|
<el-button-group>
|
<!-- <el-button :disabled="isexport_pdf" @click="" :loading="export_loading">导出</el-button> -->
|
<el-button @click="onShowApproval">查看流程图</el-button>
|
<!-- <el-button type="default" @click="closeDialog">关 闭</el-button> -->
|
</el-button-group>
|
</div>
|
</div>
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table3"
|
:table-fields="tableFields3"
|
:table-data="tableData3"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
>
|
</h-table>
|
|
</div>
|
</div>
|
</div>
|
|
<el-dialog :title="approvalTitle" :close-on-click-modal="false" :visible.sync="reasonvisible" height="50%">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="approveremark">
|
</el-input>
|
|
<h-form
|
ref="form3"
|
:form-attr="formAttr3"
|
:table-fields="formFields3"
|
:form-data="formData3"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
|
<div slot="footer" class="dialog-footer" >
|
<el-button type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button type="primary" :loading="loading_pass" @click="saveReason">确 定</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog title="附件列表" :close-on-click-modal="false" :visible.sync="showFileList" width="30%" height="10%">
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields4"
|
:table-data="tableData4"
|
:table-height="250"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
>
|
</h-table>
|
</div>
|
</el-dialog>
|
</div>
|
</div>
|
<div class="el-dialog__footer" v-if="isedit">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="(isedit || isrefuseedit) && !isend" type="primary" @click="saveRowTable">保 存</el-button>
|
<el-button size="small" v-if="isedit && !isend" type="success" @click="submitRowTable">提 交</el-button>
|
<el-button size="small" v-if="isend" type="primary" @click="">提交申请</el-button>
|
<el-button size="small" v-if="isrefuseedit" type="success" @click="">再次提交</el-button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
function initVue() {
|
new FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "pkg_adjust_order",
|
table_dataname: "md_product_line.aaa_detail",
|
title: "表单+明细模板1",
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 3,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields: [],
|
formFields: [],
|
newformData: {
|
biz_date: createDate(),
|
status: 'input',
|
trans_type: "new"
|
},
|
dataRequest: [
|
{
|
name: "md_province",
|
url: "rootjemin/data/getEntitySet",
|
paramsobj: {dataname: "md_division", filter: "level = '1'"},
|
isnotoption: false, //true:不是选项
|
}, {
|
name: "md_department",
|
url: "rootjemin/data/getEntitySet",
|
paramsobj: {dataname: "md_department", filter: ""},
|
isnotoption: false, //true:不是选项
|
}
|
],
|
formData: {},
|
|
formAttr2: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formAttr3: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formFields3: [],
|
formData3: {},
|
|
default_formFields2: [
|
{isshow: "T", field: "sum_cnt", name: "调价数量汇总", type: "span", colspan: 2},
|
{isshow: "T", field: "sum_amt", name: "补差金额汇总", type: "span", colspan: 2},
|
{isshow: "T", field: "attachment_name", name: "附件", type: "uploadfilelist", colspan: 2},
|
],
|
default_formFields3: [
|
{isshow: "T", field: "files2", name: "附件", type: "uploadfilelist"},
|
],
|
formFields2: [],
|
formData2: {
|
|
},
|
|
tableFields: [],
|
newTableData: {
|
// create_time: createDatetime(),
|
// creator_name: window.top.vue.userinfo.name,
|
},
|
tableData: [],
|
|
tableFields2: [],
|
newTableData2: {
|
// create_time: createDatetime(),
|
// creator_name: window.top.vue.userinfo.name,
|
},
|
tableData2: [],
|
|
default_tableFields3: [
|
{isshow: "T", field: "node_name", name: "当前节点", width: "150", type:"span", required: true},
|
{isshow: "T", field: "end_time", name: "申请/审批时间", width: "100", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
|
{isshow: "T", field: "pass", name: "审批情况", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "reason", name: "原因", width: "150", type: "span", required: true, isminwidth: true,},
|
{isshow: "T", field: "user_name", name: "申请/审批人", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "viewFile", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableFields3: [],
|
tableFields4: [
|
{isshow: "T", field: "attachment_name", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableData3: [],
|
tableData4: [],
|
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
isend: false,
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
|
flow_id: "c1355b3fd4b049f28135548d17f2071f",
|
t_height:null,
|
isRefresh: true,
|
|
showApprovalInfo: false,
|
opTableData: true,
|
reasonvisible: false,
|
loading_pass: false,
|
pass: false,
|
approveremark: '',
|
approvalTitle: '通过原因',
|
|
province_code_old: '',
|
province_name_old: '',
|
tableDataObj: {},
|
tableDataOldObj: {},
|
showFileList: false,
|
alertMessage: "",
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text;
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
if (this.newformData) {
|
let formData_ = clone(this.formData);
|
|
for (var k in this.newformData) {
|
formData_[k] = this.newformData[k];
|
}
|
this.formData = formData_;
|
}
|
|
// if (this.newTableData) {
|
// this.tableData.push(clone(this.newTableData));
|
// }
|
|
// if (this.newTableData2) {
|
// this.tableData2.push(clone(this.newTableData2));
|
// }
|
|
this.isedit = true;
|
|
var newEntity_ = {
|
name: "newEntity",
|
url: "rootjemin/data/newEntity",
|
paramsobj: {dataname: "pkg_adjust_order"},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
this.isapproval = true;
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
me.t_height = document.documentElement.clientHeight*1 - 91;
|
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
if (me.dataRequestObj.newEntity) {
|
var formData = clone(me.dataRequestObj.newEntity.data["adjust_order"]);
|
// formData.product_category_name = [];
|
if (me.newformData) {
|
let formData_ = clone(formData);
|
|
for (var k in me.newformData) {
|
if (!formData_[k]) {
|
formData_[k] = me.newformData[k];
|
}
|
}
|
|
me.formData = formData_;
|
}
|
}
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
let w_ = this.$refs.popup_body.offsetWidth + "px";
|
// let w_ = "900px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
rowClick(obj) {
|
if (obj.row.delivery_sum_id) {
|
this.$refs.table1.setCurrentRow(this.tableData.filter(s => s.id == obj.row.delivery_sum_id)[0]);
|
}
|
else {
|
this.$refs.table2.setCurrentRow(this.tableData2.filter(s => s.delivery_sum_id == obj.row.id)[0]);
|
}
|
},
|
moduleDownload() {
|
let url = encodeURI("template\\调价补差_新增_导入模板.xlsx")
|
handleDownloadPath(window.top.RootSetting.url_jemin + "io/downloadOneFile?token=" + Root.getToken() + "&url=" + url)
|
},
|
fileUpload() {
|
let me = this
|
|
if (!me.formData.province_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择省份'
|
});
|
return
|
}
|
if (!me.formData.trans_depart_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择业务线'
|
});
|
return
|
}
|
if (!me.formData.business_type) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择商业属性'
|
});
|
return
|
}
|
|
document.getElementById("btn_file").click()
|
},
|
getFile(event) {
|
var me = this;
|
//this.fullscreenLoading = true;
|
var file = event.target.files;
|
var forms = new FormData();
|
|
if(file.length <= 0) {
|
//this.fullscreenLoading = false;
|
}
|
for (var i = 0; i < file.length; i++) {
|
// 上传类型判断
|
var FileName = file[i].name;
|
var idx = FileName.lastIndexOf(".");
|
if (idx != -1) {
|
var ext = FileName.substr(idx + 1).toUpperCase();
|
ext = ext.toLowerCase();
|
if (ext == 'xlsx') {
|
let formData = new FormData()
|
formData.append("file", file[i]);
|
|
uploadAxios.post(window.top.RootSetting.url_jemin + 'io/loadData?ioname=adjustLoad&token=' + Root.getToken() + '&trans_depart_code='+me.formData.trans_depart_code + '&province_name=' + me.formData.province_name + '&business_type=' + me.formData.business_type_name, formData).then(result => {
|
if(result.data.success) {
|
let tableData = result.data.delivery_summary;
|
let tableData2 = result.data.adjust_order_detail;
|
|
me.tableData = tableData
|
me.tableData2 = tableData2
|
|
let formData = clone(me.formData2)
|
let total_cnt = 0
|
let total_amt = 0
|
me.tableData2.map(e => {
|
total_cnt += parseFloat(e.trans_cnt)
|
if (e.balance_amt) total_amt += parseFloat(e.balance_amt.toFixed(10))
|
})
|
formData.sum_cnt = total_cnt
|
formData.sum_amt = total_amt
|
me.formData2 = formData
|
|
let str = ""
|
me.tableData.map((e, index) => {
|
if (e.trans_count && e.trans_count > 0) {
|
if (!str) {
|
str = "第1条明细已调价完成" + e.trans_count + "次"
|
}
|
else {
|
str += ";第" + (index + 1) + "条明细已调价完成" + e.trans_count + "次"
|
}
|
}
|
})
|
me.alertMessage = str
|
}
|
if (result.data.messages && result.data.messages.list && result.data.messages.list.length > 0){
|
let str = ''
|
result.data.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:250px; width: auto; overflow: auto; line-height: 16px; letter-spacing: 1px;'>" + decodeURI(e.message)
|
else {
|
str += "</br></br> " + decodeURI(e.message)
|
}
|
})
|
|
if(result.data.success) {
|
Root.message({
|
dangerouslyUseHTMLString: true,
|
type: 'success',
|
message: str
|
});
|
}
|
else {
|
me.$alert(str, '提示', {
|
dangerouslyUseHTMLString: true
|
});
|
}
|
}
|
//me.fullscreenLoading = false;
|
}).catch(error => {
|
me.$message({
|
showClose: true,
|
message: ':请求出现错误:' + error,
|
type: 'error'
|
});
|
//me.fullscreenLoading = false;
|
});
|
} else {
|
Root.message({
|
type: 'info',
|
message: '格式不正确'
|
});
|
//me.fullscreenLoading = false;
|
}
|
}
|
}
|
|
event.target.value = null
|
},
|
exportList() {
|
exportList('adjustExport', "ao.id = '" + this.formData.id + "'")
|
},
|
//关闭弹窗
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
initData() {
|
let me = this
|
var id_ = null;
|
|
me.formFields2 = clone(me.default_formFields2);
|
me.formFields3 = clone(me.default_formFields3);
|
me.tableFields3 = clone(me.default_tableFields3);
|
|
let param = {
|
dataname: "pkg_adjust_order",
|
};
|
if (this.formData.id) {
|
param.id = this.formData.id;
|
}
|
Server.call("rootjemin/data/getEntity", param, function(result) {
|
if (result.success) {
|
let formData_ = result.data['adjust_order']
|
let formData2_ = result.data['adjust_order_file']
|
let tableData_ = result.data['adjust_order_detail']
|
if (formData_) {
|
me.formData = formData_
|
me.formData2 = formData_
|
}
|
if (formData2_ && formData2_.length > 0) {
|
let formData = clone(me.formData2)
|
formData.attachment_name = formData2_
|
me.formData2 = formData
|
}
|
if (tableData_ && tableData_.length > 0) {
|
me.tableData2 = tableData_
|
}
|
if (me.formData.flow_id) {
|
me.showApprovalInfo = true
|
me.getApprovalHisInfo(me.formData.flow_id || "")
|
}
|
if (me.popupParames.sceneCode == "approval" && me.formData.readed != "T") {
|
me.setPolicyReaded()
|
}
|
|
me.setOriginal()
|
|
var metas = clone(result.meta['adjust_order'].fields);
|
var table_dataname_ = "adjust_order_detail";
|
var table_metas = [];
|
if (table_dataname_) {
|
me.table_dataname = table_dataname_;
|
table_metas = clone(result.meta[table_dataname_].fields);
|
}
|
var formFields_ = [];
|
var tableFields_ = [];
|
metas.map(f=>{
|
f.isshow = "T";
|
if (f.field == 'province_name') {
|
f.filterable = true
|
me.dataRequestObj.md_province.data.entityset.map(e => {
|
e.value = e.name
|
})
|
f.options = me.dataRequestObj.md_province.data.entityset
|
}
|
// if (f.field == 'trans_depart_name') {
|
// me.dataRequestObj.md_department.data.entityset.map(e => {
|
// e.value = e.name
|
// })
|
// f.options = me.dataRequestObj.md_department.data.entityset
|
// }
|
if (f.field !== 'sum_amt' && f.field !== 'sum_cnt') {
|
formFields_.push(clone(f));
|
}
|
})
|
table_metas.map(f=>{
|
f.isshow = "T";
|
if (me.popupParames.sceneCode == "add" && f.field == 'detail_code') {
|
f.isshow = "F"
|
}
|
if (!f.appendix) {
|
tableFields_.push(clone(f));
|
}
|
})
|
|
me.formFields = clone(formFields_);
|
me.tableFields2 = clone(tableFields_);
|
//字段数组转字段obj
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
});
|
},
|
|
setOriginal() {
|
let me = this
|
|
Server.call("rootjemin/data/getEntitySet", {dataName: "delivery_order_summary"}, function(result) {
|
if (result.success) {
|
let table_metas = clone(result.meta['delivery_order_summary'].fields);
|
var tableFields_ = [];
|
table_metas.map(f=>{
|
f.isshow = "T";
|
tableFields_.push(clone(f));
|
})
|
me.tableFields = clone(tableFields_);
|
|
let tableData_ = []
|
if (result.data.entityset.length > 0) {
|
me.tableData2.map(s => {
|
let arr = result.data.entityset.filter(x => x.id == s.delivery_sum_id)
|
if (arr.length > 0) {
|
tableData_.push(arr[0])
|
}
|
})
|
}
|
me.tableData = tableData_
|
|
let str = ""
|
me.tableData.map((e, index) => {
|
if (e.trans_count && e.trans_count > 0) {
|
if (!str) {
|
str = "第1条明细已调价完成" + e.trans_count + "次"
|
}
|
else {
|
str += ";第" + (index + 1) + "条明细已调价完成" + e.trans_count + "次"
|
}
|
}
|
})
|
me.alertMessage = str
|
}
|
})
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
attachment_name: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "attachment_name";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj);
|
}
|
}
|
}
|
},
|
files2: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "files2";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj, true);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname, true);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj, true);
|
}
|
}
|
}
|
},
|
province_name: {
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
obj.data.province_code = obj.selectoption.code
|
obj.data.province_name = obj.selectoption.name
|
}
|
},
|
},
|
trans_depart_name: {
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
obj.data.trans_depart_code = obj.selectoption.code
|
obj.data.trans_depart_name = obj.selectoption.value
|
}
|
},
|
},
|
business_type: {
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
obj.data.business_type = obj.selectoption.code
|
obj.data.business_type_name = obj.selectoption.value
|
}
|
},
|
},
|
};
|
|
//表格字段事件设置
|
this.tablefieldClick = {
|
viewFile: {
|
val: {
|
onclick: function(obj) {
|
me.showFileList = true
|
me.getFileList(obj.row.attachment)
|
},
|
}
|
},
|
attachment_name: {
|
val: {
|
onclick: function(obj) {
|
me.showFileImgByFileId({file_id: obj.row.attachment, file_name: obj.row.attachment_name}, true);
|
},
|
}
|
},
|
network_name: {
|
cssname: function(row, callback) {
|
var classname_ = "h_terminal"
|
if (row.stock_type == "business") {
|
classname_ = "h_business";
|
}
|
callback(classname_)
|
},
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
if (obj.row.stock_type == "business") {
|
return
|
}
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择网点",
|
id: "popup_customer_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_network_list.html",
|
data: {},
|
delta: {},
|
dataname: "md_terminal",
|
filter: "1 = 1",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popObj, callback) {
|
let tableData = clone(me.tableData2)
|
|
tableData[obj.$index]['network_code'] = popObj.row.pos_code
|
tableData[obj.$index]['network_name'] = popObj.row.md_description
|
|
me.tableData2 = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
trans_price: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
let oldDetailId = obj.row.delivery_sum_id
|
let oldDetailObj = me.tableData.filter(s => s.id == oldDetailId)[0]
|
|
let arr = me.dataRequestObj.md_department.data.entityset.filter(s => s.line_type == me.formData.trans_depart_code)
|
|
let str = ""
|
arr.map(s => {
|
if (!str) {
|
str = "'" + s.code + "'"
|
}
|
else {
|
str += ",'" + s.code + "'"
|
}
|
})
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择商业政策",
|
id: "popup_customer_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_business_policy_list.html",
|
data: {},
|
delta: {},
|
dataname: "agm_record_syzc",
|
filter: "1 = 1 and type='syzc' and status='open' and freeze='F' and customer_code='" + oldDetailObj.customer_code + "' and delivery_part_code='" + oldDetailObj.delivery_part_code + "' and product_code='" + oldDetailObj.product_code + "' and settle_type='" + oldDetailObj.settle_type + "' and ar.business_depart_code in (" + str + ")",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popObj, callback) {
|
let tableData = clone(me.tableData2)
|
|
tableData[obj.$index]['agreement_id'] = popObj.row.id
|
tableData[obj.$index]['trans_price'] = popObj.row.supply_price
|
tableData[obj.$index]['tag_price'] = popObj.row.tag_price
|
tableData[obj.$index]['settle_type'] = popObj.row.settle_type
|
tableData[obj.$index]['discount_total_amt'] = popObj.row.discount_total_amt || 0
|
tableData[obj.$index]['discount_total_rate'] = popObj.row.discount_total_rate
|
|
tableData[obj.$index]['code'] = popObj.row.code
|
|
//(原发货价-新发货价)+(新折让小计-原折让小计)
|
//(price - trans_price)+(discount_total_amt - discount_total_amt)
|
let oldRowData = me.tableData.filter(s => s.id == tableData[obj.$index]['delivery_sum_id'])[0]
|
let discount_total_amt = oldRowData.discount_total_amt || 0
|
tableData[obj.$index]['balance_price'] = parseFloat(((oldRowData.price - popObj.row.supply_price) + (tableData[obj.$index]['discount_total_amt'] - discount_total_amt)).toFixed(10))
|
//tableData[obj.$index]['balance_price'] = popObj.row.supply_price - me.tableData.filter(s => s.id == tableData[obj.$index]['delivery_sum_id'])[0].price
|
|
if (tableData[obj.$index]['trans_cnt']) {
|
tableData[obj.$index]['balance_amt'] = parseFloat(tableData[obj.$index]['balance_price']) * parseFloat(tableData[obj.$index]['trans_cnt'])
|
}
|
|
let formData = clone(me.formData2)
|
let total_amt = 0
|
tableData.map(e => {
|
if (e.balance_amt) total_amt += parseFloat(e.balance_amt.toFixed(10))
|
})
|
formData.sum_amt = total_amt
|
me.formData2 = formData
|
|
me.tableData2 = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
trans_cnt: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.tableData2)
|
if (tableData[obj.$index]['balance_price']) {
|
tableData[obj.$index]['balance_amt'] = tableData[obj.$index]['balance_price'] * tableData[obj.$index]['trans_cnt']
|
}
|
me.tableData2 = tableData
|
|
let formData = clone(me.formData2)
|
let total_cnt = 0
|
let total_amt = 0
|
me.tableData2.map(e => {
|
total_cnt += parseFloat(e.trans_cnt)
|
if (e.balance_amt) total_amt += parseFloat(e.balance_amt.toFixed(10))
|
})
|
formData.sum_cnt = total_cnt
|
formData.sum_amt = total_amt
|
me.formData2 = formData
|
}
|
}
|
},
|
stock_type: {
|
select: {
|
onchange: function(obj) {
|
if (obj.selectoption.code && obj.selectoption.code == "business") {
|
let tableData = clone(me.tableData2)
|
tableData[obj.$index]['network_code'] = null
|
tableData[obj.$index]['network_name'] = null
|
me.tableData2 = tableData
|
}
|
else if (obj.selectoption.code && obj.selectoption.code == "terminal") {
|
|
}
|
}
|
}
|
},
|
};
|
},
|
|
getFileList(parentFileId) {
|
let me = this
|
|
let param = {
|
dataName: "sys_file_mapping",
|
filter: "parent_id = '" + parentFileId + "'"
|
}
|
Server.call("rootjemin/data/getEntitySet", param, function(result) {
|
if (result.success) {
|
let fileList = result.data.entityset || []
|
fileList.map(e => {
|
e.attachment_name = e.file_name
|
e.attachment = e.file_id
|
})
|
|
me.tableData4 = fileList
|
}
|
});
|
},
|
|
getApprovalHisInfo(flowId) {
|
let me = this
|
|
if (!flowId) {
|
return
|
}
|
|
let param = {
|
flowId: flowId
|
}
|
|
Server.call("jeminact/root/order/getHistoryTask", param, function(result) {
|
if (result.success) {
|
let tableData = []
|
tableData = result.data.entityset
|
tableData.map(s => {
|
s.pass = !s.pass && s.pass !== 0? '' : s.pass == '1'? '同意' : '拒绝'
|
s.user_name = s.user_name? s.user_name : '已完成'
|
|
s.viewFile = s.attachment? "查看附件" : ''
|
})
|
me.tableData3 = tableData
|
}
|
});
|
},
|
onShowApproval() {
|
var me = this;
|
let param = {
|
isClientMode: false,
|
flowId: this.formData.flow_id
|
}
|
|
var config = {
|
hide_close: true,
|
width: "85vw",
|
height: "95vh",
|
url: "../approval_new/Approval_flowid_new.html",
|
data: {},
|
delta: {
|
flow_id: this.formData.flow_id,
|
title: ''
|
},
|
};
|
|
this.doPopupByPublic(config);
|
},
|
|
approvalOp(op) {
|
this.reasonvisible = true
|
this.approveremark = ""
|
this.formData3.files2 = null
|
if (op) {
|
this.approvalTitle = '通过原因'
|
this.pass = true
|
}
|
else {
|
this.approvalTitle = '拒绝原因'
|
this.pass = false
|
}
|
},
|
|
saveReason() {
|
let me = this
|
|
if (!this.pass && !this.approveremark) {
|
Root.message({
|
type: 'warning',
|
message: '请填写拒绝原因'
|
})
|
|
return
|
}
|
|
if (this.formData3.files2 && this.formData3.files2.length > 0) {
|
let sys_file_mapping = []
|
let parent_id = uuid_short()
|
this.formData3.files2.map(e => {
|
let list = {
|
parent_id: parent_id,
|
type: "flow",
|
file_id: e.id,
|
file_name: e.file_name
|
}
|
sys_file_mapping.push(list)
|
})
|
let param = {
|
dataName: 'sys_file_mapping',
|
data: {
|
sys_file_mapping: sys_file_mapping
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
if (result.success) {
|
me.doSaveReason(parent_id)
|
}
|
});
|
}
|
else {
|
me.doSaveReason()
|
}
|
},
|
|
doSaveReason(parent_id) {
|
let me = this
|
|
let param = {
|
businessId: this.formData.id,
|
flowId: this.formData.flow_id,
|
variableMap: {
|
dataName: "adjust_order",
|
reason: this.approveremark,
|
flowId: this.formData.flow_id,
|
attachment: parent_id?parent_id : ""
|
},
|
pass: this.pass
|
}
|
Server.call("jeminact/rootact/act/deal/" + this.formData.flow_id, param, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
})
|
window.top.vue.setMenuBadgeByMenuid('A10-12', 'adjustOrder');
|
me.saveAfter()
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: result.error
|
})
|
}
|
});
|
},
|
|
onPopupByUploadFile(filenamefield, fileidfield,dataname, isApprovalReason) {
|
var me = this;
|
let url = isApprovalReason? "../tool_new/popup_uploadFile_new.html" : "../tool/popup_uploadFile.html"
|
var analysistype_ = "";
|
var formData_ = isApprovalReason? clone(me.formData3) : clone(me.formData2);
|
var delta_ = {filetypelist: []}//".png", ".jpg", ".pdf"
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: url,
|
data: {
|
dataName: dataname,
|
fileidfieldName: fileidfield,
|
id: me.formData.id,
|
fileNamefieldName: filenamefield,
|
// max_size: "100MB",
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
|
var file_ = {
|
id: obj.row[0].id,
|
file_name: decodeURI(obj.row[0].name)
|
}
|
if (!formData_[filenamefield]) {
|
formData_[filenamefield] = []
|
}
|
formData_[filenamefield].push(file_);
|
|
if (isApprovalReason) {
|
me.formData3 = formData_;
|
}
|
else {
|
me.formData2 = formData_;
|
}
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId(filenamefield, fileobj, isApprovalReason){
|
var me = this;
|
Root.confirm('确定删除附件【' + fileobj.file_name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (isApprovalReason) {
|
me.formData3[filenamefield].remove(fileobj);
|
}
|
else {
|
me.formData2[filenamefield].remove(fileobj);
|
}
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}).catch(() => {
|
|
});
|
},
|
|
showFileImgByFileId(fileobj, isApprovalReason) {
|
let me = this;
|
var file_id = fileobj.file_id || fileobj.id;
|
var file_name = fileobj.file_name;
|
|
this.zzimg = {};
|
this.zzimgList = [];
|
this.file_txt = false;
|
if(file_id) {
|
var fileid = file_id;
|
let fileName = clone(file_name);
|
let index1 = fileName.lastIndexOf(".");
|
let index2 = fileName.length;
|
let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
|
if (suffix == ".png" || suffix == ".jpg" || suffix == ".pdf") {
|
var row = {
|
fileid: fileid,
|
filename: fileName
|
}
|
|
var config = {
|
totab: false,
|
width: "1200px",
|
height: 800,
|
icon: "icon-product",
|
text: "附件预览",
|
id: "pdf_" + fileid,
|
url: "../tool/popup_file_pdf.html",
|
data: row,
|
delta: {},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
|
}
|
else {//只可下载,不可预览
|
if (isApprovalReason) {
|
handleDownloadNew(fileid);
|
}
|
else {
|
handleDownload(fileid);
|
}
|
}
|
}
|
},
|
selectData() {
|
var me = this;
|
|
let filter = ""
|
if (me.tableData.length > 0) {
|
let str = ''
|
me.tableData.map(s => {
|
if (!str) {
|
str = "'" + s.id + "'"
|
}
|
else {
|
str += ",'" + s.id + "'"
|
}
|
})
|
|
if (str) {
|
filter += " id not in (" + str + ") "
|
}
|
}
|
|
if (!me.formData.province_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择省份'
|
});
|
return
|
}
|
if (!me.formData.trans_depart_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择业务线'
|
});
|
return
|
}
|
if (!me.formData.business_type) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择商业属性'
|
});
|
return
|
}
|
|
let arr = me.dataRequestObj.md_department.data.entityset.filter(s => s.line_type == me.formData.trans_depart_code)
|
|
let str = ""
|
arr.map(s => {
|
if (!str) {
|
str = "'" + s.code + "'"
|
}
|
else {
|
str += ",'" + s.code + "'"
|
}
|
})
|
|
if (!filter) {
|
filter = " province_code = '" + me.formData.province_code + "' and manage_part_code in (" + str + ") and business_type = '" + me.formData.business_type + "' "
|
}
|
else {
|
filter += " and province_code = '" + me.formData.province_code + "' and manage_part_code in (" + str + ") and business_type = '" + me.formData.business_type + "' "
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "选择明细",
|
id: "agreement_edit" + "edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/priceAdjust/popup_product_list.html",
|
data: "",
|
delta: {isSelects: true},
|
filter: filter,
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData_ = clone(me.tableData)
|
let tableData_2 = clone(me.tableData2)
|
|
data.map((e, index) => {
|
tableData_.push(e)
|
tableData_2.push({
|
delivery_sum_id: e.id,
|
})
|
})
|
|
me.tableData = tableData_
|
me.tableData2 = tableData_2
|
|
let str = ""
|
me.tableData.map((e, index) => {
|
if (e.trans_count && e.trans_count > 0) {
|
if (!str) {
|
str = "第1条明细已调价完成" + e.trans_count + "次"
|
}
|
else {
|
str += ";第" + (index + 1) + "条明细已调价完成" + e.trans_count + "次"
|
}
|
}
|
})
|
me.alertMessage = str
|
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
addTableData() {
|
var table_row = clone(this.newTableData);
|
this.rowChange(table_row, "add", this.table_dataname);
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
Root.confirm('确定删除吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.rowChange(row, "del", me.table_dataname);
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
rowChange(row, type, tablename) {
|
var me = this;
|
if (type == "add") {
|
this.tableData.unshift(row);
|
}
|
else if (type == "del") {
|
me.tableData2 = me.tableData2.filter(s => s.delivery_sum_id !== row.id)
|
me.tableData.remove(row);
|
|
let str = ""
|
me.tableData.map((e, index) => {
|
if (e.trans_count && e.trans_count > 0) {
|
if (!str) {
|
str = "第1条明细已调价完成" + e.trans_count + "次"
|
}
|
else {
|
str += ";第" + (index + 1) + "条明细已调价完成" + e.trans_count + "次"
|
}
|
}
|
})
|
me.alertMessage = str
|
|
let formData = clone(me.formData2)
|
let total_cnt = 0
|
let total_amt = 0
|
me.tableData2.map(e => {
|
total_cnt += parseFloat(e.trans_cnt)
|
if (e.balance_amt) total_amt += parseFloat(e.balance_amt.toFixed(10))
|
})
|
formData.sum_cnt = total_cnt
|
formData.sum_amt = total_amt
|
me.formData2 = formData
|
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}
|
else {
|
|
}
|
},
|
|
setPolicyReaded() {
|
let me = this
|
let param = {
|
dataName: 'pkg_adjust_order',
|
data: {
|
adjust_order: {
|
id: me.formData.id,
|
readed: "T"
|
}
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {});
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
|
if (this.tableData2.length == 0) {
|
Root.message({
|
type: 'warning',
|
message: '请先添加明细数据'
|
});
|
return
|
}
|
if(me.iscommit) {
|
var bo = me.$refs.form1.checkForm();
|
if(!bo) {
|
Root.message({
|
type: 'warning',
|
message: '请填写必填项'
|
});
|
return;
|
}
|
|
this.formData.readed = "F"
|
}
|
|
if (this.formData.id) {
|
me.deleteDetails(this.formData.id)
|
}
|
else {
|
me.doSaveRowTable()
|
}
|
},
|
deleteDetails(id) {
|
let me = this
|
|
let param = {
|
dataName: 'adjust_order_detail',
|
filter: "parent_id = '" + id + "'"
|
}
|
|
Server.call("rootjemin/history/deleteDetails", param, function(result) {
|
if (result && result.data) {
|
me.doSaveRowTable()
|
}
|
});
|
},
|
doSaveRowTable() {
|
let me = this
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r]) {
|
entity[r] = entity_[r];
|
}
|
}
|
entity['sum_cnt'] = this.formData2.sum_cnt
|
entity['sum_amt'] = this.formData2.sum_amt
|
|
var tableData_ = [];
|
this.tableData2.map(r=>{
|
var row_ = {};
|
for (var k in r) {
|
if (r[k]) {
|
row_[k] = r[k];
|
}
|
}
|
tableData_.push(row_);
|
})
|
|
let fileList = []
|
if (me.formData2.attachment_name && me.formData2.attachment_name.length > 0) {
|
me.formData2.attachment_name.map(s => {
|
let list = {
|
type: "adjust_order",
|
file_id: s.id,
|
file_name: s.file_name
|
}
|
if (s.id) list.id = s.id
|
if (s.parent_id) list.parent_id = s.parent_id
|
fileList.push(list)
|
})
|
}
|
|
let param = {
|
dataname: "pkg_adjust_order",
|
data: {
|
adjust_order: entity,
|
adjust_order_detail: tableData_,
|
adjust_order_file: fileList
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
if (result.success) {
|
if(me.iscommit){
|
me.iscommit = false;
|
me.doSubmit(param.data.adjust_order.id);
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
});
|
},
|
doSubmit(id) {
|
let me = this;
|
let pa = {
|
dataName: "adjust_order",
|
id: id,
|
flow_id: this.formData.flow_id || "",
|
business_type: "adjustOrder"
|
}
|
Server.call("rootjemin/data/Commit", pa, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
window.top.vue.setMenuBadgeByMenuid('A10-12', 'adjustOrder');
|
me.saveAfter();
|
}
|
}, function(result) {
|
if (result.messages && result.messages.list && result.messages.list.length > 0){
|
let str = ''
|
result.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:250px; width: auto; overflow: auto; line-height: 16px; letter-spacing: 1px; color: #e10c0c;'>" + e.message
|
else {
|
str += "</br></br> " + e.message
|
}
|
})
|
|
me.$alert(str, '提示', {
|
dangerouslyUseHTMLString: true
|
});
|
}
|
});
|
}
|
|
}
|
});
|
};
|
|
initVue();
|
</script>
|
|
<style>
|
.a:hover{
|
background-color: #FFFFFF;
|
}
|
.el-input__inner{
|
padding: 0 2px;
|
}
|
.header {
|
height: 21px;
|
}
|
.el-dialog_header {
|
padding: 10px 20px;
|
border-bottom: 1px solid #ccc;
|
right: 10px;
|
left: 10px;
|
top: 0px;
|
position: fixed;
|
}
|
.el-dialog_body{
|
padding: 20px;
|
|
overflow-y: auto;
|
right: 10px;
|
left: 10px;
|
top: 42px;
|
bottom: 50px;
|
position: fixed;
|
}
|
.el-dialog_footer {
|
padding: 10px 20px;
|
border-top: 1px solid #ccc;
|
right: 10px;
|
left: 10px;
|
bottom: 0px;
|
position: fixed;
|
background-color: #fff;
|
z-index: 10;
|
text-align: right;
|
}
|
html{
|
overflow-y: hidden;
|
}
|
.h_business .el-input__inner {
|
pointer-events: none;
|
border: 1px solid #DDD;
|
background-color: #F5F5F5;
|
color: #ACA899;
|
}
|
.h_business .el-button {
|
display: none;
|
}
|
.h_table .el-table {
|
margin-bottom: 50px;
|
}
|
.el-dialog__body {
|
overflow-y: visible;
|
}
|
/* .el-button--mini {
|
color: #FFF;
|
background-color: #2984e2;
|
border-color: #409EFF;
|
} */
|
</style>
|
|
</body>
|
</html>
|