<!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="../../../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 class="el-dialog__footer" v-if="isapproval || isbrowse"> <el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">导 出</el-button> <el-button :disabled="true" size="small" v-if="isbrowse" type="primary" @click="">下 è½½</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" size="small" type="primary" v-if="isapproval" @click="">å¾è¯¢æ„è§</el-button> <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 class="h_dialog__body" style=" padding-top: 20px;"> <!-- <el-alert v-if="!isend && !ischange" title="ç›´è¥æ”¿ç–-OTCç»é”€: éžé‡‘æ°´å®ç³»åˆ—预付款折让å°è®¡æ¯”率ä¸è¶…过4%, 账期ä¸è¶…过3%" description="折让å°è®¡æ¯”率为1,118.182%" type="warning" show-icon > </el-alert> --> <el-alert v-for="(item, key) in alertMessage" :title="item" type="error" > </el-alert> <div style="display: flex;"> <div v-if="showChangeInfo" style="margin-right: auto;"> <span>å˜æ›´å‰</span> </div> <div v-if="isedit || isrefuseedit" style="margin-left: auto;"> <!-- 工具æ --> <el-button-group style="display: flex;"> <el-button v-if="!isend && !ischange && !isChangeEdit && !isEndEdit" @click="addTableData">新增明细</el-button> <el-button v-if="isend || ischange || isChangeEdit || isEndEdit" @click="newEndDeatil">新增明细</el-button> <!-- <el-button v-if="ischange" @click="changeTableData">新增明细</el-button> --> <el-button :disabled="true" @click="">模æ¿ä¸‹è½½</el-button> <el-button :disabled="true" @click="">导 å…¥</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="opTableData" :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" v-on:get-data="getData" v-on:del-data="delData" > </h-table> </div> <div class="h_dialog__body" v-if="showChangeInfo" style="padding-top: 30px;;"> <div v-if="showChangeInfo" style="margin-right: auto;"> <span>å˜æ›´åŽ</span> </div> <h-table v-if="isRefresh && tableFields.length" ref="table2" :table-fields="tableFields2" :table-data="tableData2" :table-data-old="tableDataOldObj" :is-old-contrast="true" :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" 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" > </h-form> </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> </div> </div> <div class="el-dialog__footer" v-if="!isapproval && !isbrowse"> <el-button size="small" type="default" @click="closeDialog">å– æ¶ˆ</el-button> <el-button size="small" v-if="(isedit || isrefuseedit)" type="primary" @click="saveRowTable">ä¿ å˜</el-button> <el-button size="small" v-if="isedit" 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: "agm_record_apply_xsrw", table_dataname: "agm_record_xsrw", title: "表å•+明细模æ¿1", formAttr: { istitle: false, title: "表å•åç§°", columnnumber: 2, labelwidth: "140px", labelposition: "left",//"left",// right//top size: "mini", border: "3px solid #c6c6c600" }, default_formFields: [ {isshow: "T", field: "process_no", name: "æµç¨‹å·", type:"span", colspan: 2, required: true}, {isshow: "T", field: "apply_date", name: "申请日期", type:"span", required: true}, {isshow: "T", field: "employee_code", name: "员工编å·", type:"span", required: true }, {isshow: "T", field: "apply_name", name: "申请人", type:"span", required: true}, {isshow: "T", field: "department", name: "所在部门", type:"span", required: true}, {isshow: "T", field: "apply_province", name: "申请çœä»½", type:"select", required: true}, {isshow: "T", field: "type", name: "æµç¨‹ç±»åž‹", type:"select", required: true}, {isshow: "T", field: "remark", name: "备注", type:"textarea", required: false, colspan: 2}, ], formFields: [], newformData: { //id: uuid_short(), // code: createCode("BA"), // create_time: createDatetime(), // state_code: "Draft", // state_name: "录入", // // creator_name: window.top.vue.userinfo.name, // type_code: "", // type_name: "", biz_date: createDate(), creator_code: window.top.vue.userinfo.employee.code, creator_name: window.top.vue.userinfo.employee.name, creator_depart_name: window.top.vue.userinfo.employee.hierarchyNodesStr || "虚拟部门", type: 'xsrw', status: 'input', trans_type: "new" }, formData: {}, dataRequest: [ { name: "md_province", url: "rootjemin/data/getEntitySet", paramsobj: {dataname: "md_division", filter: "level = '1'"}, isnotoption: false, //true:䏿˜¯é€‰é¡¹ label: "name", code: "code" } ], editTableButton: { del: { isshow: true, txt: "åˆ é™¤" } }, 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: "attachment_name", name: "附件", type: "uploadfilelist"}, ], default_formFields3: [ {isshow: "T", field: "files2", name: "附件", type: "uploadfilelist"}, ], formFields2: [], formData2: {}, default_tableFields: [ // {isshow: "T",field: "begin_date", name: "开始时间", width: "150", type:"date", formatter: "formatter_date", required: true}, // {isshow: "T",field: "end_date", name: "ç»“æŸæ—¶é—´", width: "150", type:"date", formatter: "formatter_date", required: true}, // {isshow: "T", field: "customer_code", name: "商业编ç ", width: "150", type: "select", required: true}, // {isshow: "T", field: "customer_name", name: "商业åç§°", width: "200", type:"span", required: true}, // {isshow: "T", field: "customer_person", name: "商业æ“作人", width: "100", type:"input", required: true}, // {isshow: "T", field: "product_code", name: "å“ç§ç¼–ç ", width: "150", type:"select", required: true}, // {isshow: "T", field: "product_name", name: "å“å", width: "200", type: "span", align: "left", required: true}, // {isshow: "T", field: "spec", name: "è§„æ ¼", width: "100", type: "span", required: true}, // {isshow: "T", field: "net_code", name: "网点编ç ", width: "100", type: "span",}, // {isshow: "T", field: "net_name", name: "网点åç§°", width: "200", type: "select", align: "left", required: true}, // {isshow: "T", field: "target_price", name: "䏿 ‡ä»·", width: "100", type: "input", formatter: "formatter_money", align: "right", required: true}, // {isshow: "T", field: "origin_price", name: "商业供货价", width: "100", type: "input", formatter: "formatter_money", align: "right", required: true}, // {isshow: "T", field: "gap_price", name: "补差å•ä»·", width: "100", type: "input", formatter: "formatter_money", align: "right", required: true}, // {isshow: "T", field: "gap_rate", name: "补差扣率", width: "100", type: "span", required: true}, // {isshow: "T", field: "pay_type", name: "支付方å¼", width: "100", type: "span", required: true}, // {isshow: "T", field: "pay_time", name: "兑付周期", width: "100", align: "right", type: "select", required: true}, // {isshow: "T", field: "is_agency", name: "æ˜¯å¦æ‰˜ç®¡", width: "100", align: "right", required: true}, // {isshow: "T", field: "agree_no", name: "å议编ç ", width: "100", align: "right", type: "input",}, // {isshow: "T", field: "remark", name: "明细备注", type: "input", width: "150"}, ], tableFields: [], newTableData: { pay_type: "票折" }, tableData: [], tableData_old: [], //å˜æ›´åŽ tableFields2: [], 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", formatter: "", 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: "attachment_name", name: "附件", width: "200", type:"span", required: true, isminwidth: true,}, ], tableFields3: [], tableData3: [], //å—æ®µè®¾ç½® tablefieldClick: {}, formfieldClick: {}, //按键æƒé™è®¾ç½® isedit: false,//æäº¤å‰ç¼–辑,ä¿å˜/æäº¤ isrefuseedit: false,//æ‹’ç»åŽç¼–辑,ä¿å˜/冿¬¡æäº¤ isapproval: false,//å®¡æ‰¹ï¼ŒåŒæ„/æ‹’ç»/转办/退回 isend: false, ischange: false, isbrowse: false, iscommit: false,//æäº¤æ ‡è®° isChangeEdit: false, isEndEdit: false, //å¼¹çª—å‚æ•° popupParames: {}, t_height:null, flow_id: "c1355b3fd4b049f28135548d17f2071f", isRefresh: true, showApprovalInfo: false, showChangeInfo: false, opTableData: true, reasonvisible: false, loading_pass: false, pass: false, approveremark: '', approvalTitle: '', tableDataObj: {}, tableDataOldObj: {}, 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)); // } this.isedit = true; //动æ€èŽ·å–é»˜è®¤æ•°æ® var newEntity_ = { name: "newEntity", url: "rootjemin/data/newEntity", paramsobj: {dataname: "pkg_agm_record_xsrw"}, isnotoption: true, //true:䏿˜¯é€‰é¡¹ } this.dataRequest.push(newEntity_); } else if (this.popupParames.sceneCode == "browse") {//åªè¯» this.formAttr.disabled = true; this.formAttr2.disabled = true; this.isbrowse = true; this.opTableData = false; } else if (this.popupParames.sceneCode == "edit") {//编辑 this.isedit = true; } else if (this.popupParames.sceneCode == "changeEdit") {//编辑 this.isedit = true; this.isChangeEdit = true } else if (this.popupParames.sceneCode == "endEdit") {//编辑 this.isedit = true; this.isEndEdit = true } else if (this.popupParames.sceneCode == "approval") {//审批 this.formAttr.disabled = true; this.formAttr2.disabled = true; this.isapproval = true; this.opTableData = false; } else if (this.popupParames.sceneCode == "change") {//å˜æ›´ //this.formAttr.disabled = true; this.formAttr2.disabled = false; this.isapproval = false; this.isedit = true; this.ischange = true; if (this.newformData) { this.newformData.trans_type = "trans" let formData_ = clone(this.formData); for (var k in this.newformData) { formData_[k] = this.newformData[k]; } this.formData = formData_; } var newEntity_ = { name: "newEntity", url: "rootjemin/data/newEntity", paramsobj: {dataname: "pkg_agm_record_xsrw"}, isnotoption: true, //true:䏿˜¯é€‰é¡¹ } this.dataRequest.push(newEntity_); } else if (this.popupParames.sceneCode == "end") {//ç»ˆæ¢ //this.formAttr.disabled = true; this.formAttr2.disabled = false; this.isapproval = false; this.isend = true; this.isedit = true; if (this.newformData) { this.newformData.trans_type = "end" let formData_ = clone(this.formData); for (var k in this.newformData) { formData_[k] = this.newformData[k]; } this.formData = formData_; } var newEntity_ = { name: "newEntity", url: "rootjemin/data/newEntity", paramsobj: {dataname: "pkg_agm_record_xsrw"}, isnotoption: true, //true:䏿˜¯é€‰é¡¹ } this.dataRequest.push(newEntity_); } 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["agm_record_apply_xsrw"]); // 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_; } // if (me.popupParames.delta) { // me.formData.category_code = clone(me.popupParames.delta.code); // me.formData.category_name = clone(me.popupParames.delta.name); // } } 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:{ //å…³é—弹窗 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; if (!me.formFields || (me.formFields && me.formFields.length == 0)) { me.formFields2 = clone(me.default_formFields2); me.formFields3 = clone(me.default_formFields3); me.tableFields3 = clone(me.default_tableFields3); } let param = { dataname: "pkg_agm_record_xsrw", }; param.id = this.formData.parent_id?this.formData.parent_id : this.formData.id?this.formData.id : ''; Server.call("rootjemin/data/getEntity", param, function(result) { if (result.success) { let formData_ = result.data['agm_record_apply_xsrw'] let formData2_ = result.data['agm_record_xsrw_file'] let tableData_ = result.data['agm_record_xsrw'] let alertMessage = result.data['agm_notice_message'] if (alertMessage && alertMessage.length > 0) { let arr = [] alertMessage.map(s => { arr.push(s.title + s.message) }) this.alertMessage = arr } if (formData_) { me.formData = formData_ } if (formData2_ && formData2_.length > 0) { let formData = clone(me.formData2) formData.attachment_name = formData2_ me.formData2 = formData } if (tableData_ && tableData_.length > 0) { tableData_.map(e => { e.is_deposit = e.is_deposit? 'Y' : 'N' }) let idStr = '' tableData_.map(s => { if (!idStr) idStr += "'" + s.old_id + "'" else idStr += ",'" + s.old_id + "'" }) if (me.formData.trans_type && me.formData.trans_type == 'trans' && me.popupParames.sceneCode !== "changeEdit") { me.tableDataObj = {} tableData_.map(s => { me.tableDataObj[s.old_id] = s.id }) me.tableData2 = tableData_ me.getOldData(idStr) } else if (me.popupParames.sceneCode == "changeEdit") { me.tableData = tableData_ me.getOldData(idStr) } else { me.tableData = tableData_ } } if (me.popupParames.sceneCode !== "change" && me.popupParames.sceneCode !== "end" && me.popupParames.sceneCode !== "changeEdit" && me.popupParames.sceneCode !== "endEdit" && me.formData.trans_type && me.formData.trans_type == 'trans') { me.showChangeInfo = true } 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() } var metas = clone(result.meta['agm_record_apply_xsrw'].fields); var table_dataname_ = "agm_record_xsrw"; 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 == 'head_province_name') { me.dataRequestObj.md_province.data.entityset.map(e => { e.value = e.name }) f.options = me.dataRequestObj.md_province.data.entityset } 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)); } }) if (me.formData.trans_type == 'trans') { let canChangeField = [ {field: "end_date"}, {field: "recommendation_level"}, {field: "tag_price_type"}, {field: "settle_type"}, {field: "actual_operate_name"}, {field: "tag_price"}, {field: "invoice_limit_price"}, {field: "distribution_price"}, {field: "retail_price"}, {field: "settle_price"}, {field: "cash_type"}, {field: "terminal_position"}, {field: "inventory_amt"}, {field: "drained_amt"}, {field: "discount_flow_amt"}, {field: "discount_business_amt"}, {field: "discount_annual_amt"}, {field: "discount_common_amt"}, {field: "project_amt"}, {field: "pay_tax_amt"}, {field: "agm_sales_task"}, {field: "drained_arrest_amt"}, {field: "discount_trans_amt"}, {field: "current_tick_amt"}, {field: "pay_peroid"}, {field: "remark"} ] tableFields_.map(s => { if (canChangeField.filter(e => e.field == s.field).length == 0) { s.type = "span" } }) var termination_date = { isshow: "T",field: "termination_date", name: "ç»ˆæ¢æ—¥æœŸ", width: "150", type:"date", formatter: "formatter_date" }; tableFields_.unshift(termination_date); } if (me.formData.trans_type == 'end') { tableFields_.map(t => { t.type = "span"; }) var termination_date = { isshow: "T",field: "termination_date", name: "ç»ˆæ¢æ—¥æœŸ", width: "150", type:"date", formatter: "formatter_date" }; tableFields_.unshift(termination_date); } me.formFields = clone(formFields_); me.tableFields = clone(tableFields_); me.tableFields2 = clone(tableFields_); me.$nextTick(function(){ if (me.showChangeInfo) { me.addListener() } }) //å—æ®µæ•°ç»„è½¬å—æ®µobj me.fieldsToFieldsObj(); //è®¾ç½®å—æ®µäº‹ä»¶ me.tableFieldClick(); } }); }, addListener() { this.dom1 = this.$refs['table1'].$refs['table1'].bodyWrapper this.dom2 = this.$refs['table2'].$refs['table1'].bodyWrapper this.dom2.addEventListener('scroll', () => { this.dom1.scrollLeft = this.dom2.scrollLeft this.dom1.scrollTop = this.dom2.scrollTop }) }, newEndDeatil() { var me = this; let filter = " type = 'xsrw' and status = 'open' and freeze <> 'T'" if (me.tableData.length > 0) { let str = '' me.tableData.map(s => { if (!str) { str = "'" + s.old_id + "'" } else { str += ",'" + s.old_id + "'" } }) if (str) { filter += " and ar.id not in (" + str + ")" } } var config = { totab: false, //true: 以Tabå¯¼èˆªçš„æ–¹å¼æ‰“å¼€ width: "900px", height: "900px", icon: "icon-product", text: "è¯·é€‰æ‹©é”€å”®ä»»åŠ¡æ”¿ç–æ˜Žç»†æ•°æ®", id: "popup_task_discount_info_list",//totab: trueæ—¶éœ€è®¾ç½®ï¼Œç”¨äºŽåˆ¤æ–æ˜¯å¦å·²æ‰“å¼€æ¤é¡µé¢ url: "../agreement/policy/popup_policy_info_list.html", dataname: "agm_record_xsrw", filter: filter, data: {}, delta: {}, sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse", callback: function(data, callback) { let tableData_ = clone(me.tableData) data.map(e => { e.termination_operate_code = window.top.vue.userinfo.employee.code e.termination_operate_name = window.top.vue.userinfo.employee.name e.old_id = JSON.parse(JSON.stringify(e.id)) e.id = null e.parent_id = me.formData.id tableData_.push(e) }) me.tableData = tableData_ if (callback) { callback(); } } }; me.doPopupByPublic(config); }, 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); } } } }, head_province_name: { select: { onchange: function(obj) {//下拉展开事件 obj.data.head_province_code = obj.selectoption.code obj.data.head_province_name = obj.selectoption.name } }, } }; //è¡¨æ ¼å—æ®µäº‹ä»¶è®¾ç½® this.tablefieldClick = { attachment_name: { val: { onclick: function(obj) { me.showFileImgByFileId({file_id: obj.row.attachment, file_name: obj.row.attachment_name}, true); }, } }, customer_name: { popup: { onclick: function(obj) {//弹窗点击事件 var config = { totab: false, //true: 以Tabå¯¼èˆªçš„æ–¹å¼æ‰“å¼€ width: "900px", height: "450px", icon: "icon-product", text: "选择客户", id: "popup_customer_list",//totab: trueæ—¶éœ€è®¾ç½®ï¼Œç”¨äºŽåˆ¤æ–æ˜¯å¦å·²æ‰“å¼€æ¤é¡µé¢ url: "../agreement/popup/popup_customer_list.html", data: {}, delta: {}, dataname: "customer", filter: "1 = 1", sceneCode: "add", //"add"//"browse", callback: function(popObj, callback) { let tableData = clone(me.tableData) tableData[obj.$index]['customer_id'] = popObj.row.id tableData[obj.$index]['customer_code'] = popObj.row.md_code tableData[obj.$index]['customer_name'] = popObj.row.md_description tableData[obj.$index]['province_code'] = popObj.row.province tableData[obj.$index]['province_name'] = popObj.row.province_name me.tableData = tableData if (callback) { callback(); } } }; me.doPopupByPublic(config); } }, }, product_name: { popup: { onclick: function(obj) {//弹窗点击事件 var config = { totab: false, //true: 以Tabå¯¼èˆªçš„æ–¹å¼æ‰“å¼€ width: "900px", height: "450px", icon: "icon-product", text: "选择è¯å“", id: "popup_product_list",//totab: trueæ—¶éœ€è®¾ç½®ï¼Œç”¨äºŽåˆ¤æ–æ˜¯å¦å·²æ‰“å¼€æ¤é¡µé¢ url: "../agreement/popup/popup_product_list.html", data: {}, delta: {}, dataname: "md_product", filter: "1 = 1", sceneCode: "add", //"add"//"browse", callback: function(popObj, callback) { let tableData = clone(me.tableData) tableData[obj.$index]['product_id'] = popObj.row.id tableData[obj.$index]['product_code'] = popObj.row.md_code tableData[obj.$index]['product_name'] = popObj.row.md_description tableData[obj.$index]['product_spec'] = popObj.row.specification tableData[obj.$index]['product_unit'] = popObj.row.unit me.tableData = tableData if (callback) { callback(); } } }; me.doPopupByPublic(config); } }, }, network_name: { popup: { onclick: function(obj) {//弹窗点击事件 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.tableData) tableData[obj.$index]['network_code'] = popObj.row.md_code tableData[obj.$index]['network_name'] = popObj.row.md_description me.tableData = tableData if (callback) { callback(); } } }; me.doPopupByPublic(config); } }, }, tag_price: { input: { onchange: function(obj) { if (obj.row.balance_price) { let tableData = clone(me.tableData) let tag_price = obj.row.tag_price? parseFloat(obj.row.tag_price) : 0 let balance_price = obj.row.balance_price? parseFloat(obj.row.balance_price) : 0 tableData[obj.$index]['balance_rate'] = balance_price / tag_price me.tableData = tableData } } }, }, balance_price: { input: { onchange: function(obj) { if (obj.row.tag_price) { let tableData = clone(me.tableData) let tag_price = obj.row.tag_price? parseFloat(obj.row.tag_price) : 0 let balance_price = obj.row.balance_price? parseFloat(obj.row.balance_price) : 0 tableData[obj.$index]['balance_rate'] = balance_price / tag_price me.tableData = tableData } } }, }, termination_date: { input: { onchange: function(obj) { let start_date = obj.row.start_date if (me.tableData_old.length > 0) { start_date = me.tableData_old.filter(s => s.id == obj.row.old_id)[0].start_date } var year_ = new Date().getFullYear(); if (new Date(obj.row.termination_date) > new Date(year_ + "-12-31")) { Root.message({ type: 'warning', message: 'ç»ˆæ¢æ—¥æœŸä¸èƒ½è·¨å¹´' }); obj.row.termination_date = null; } if (obj.row.end_date) { if (new Date(obj.row.termination_date) > new Date(obj.row.end_date) || new Date(obj.row.termination_date) < new Date(start_date)) { Root.message({ type: 'warning', message: 'ç»ˆæ¢æ—¥æœŸéœ€åœ¨å¼€å§‹æ—¥æœŸä¸Žç»“æŸæ—¥æœŸä¹‹é—´', }); obj.row.termination_date = null; } var year_2 = start_date.split('-')[0]; if (new Date(obj.row.termination_date) > new Date(year_2 + "-12-31")) { Root.message({ type: 'warning', message: 'ç»ˆæ¢æ—¥æœŸä¸èƒ½è·¨å¹´' }); obj.row.start_date = null; } } }, } }, start_date: { input: { onchange: function(obj) { var year_ = new Date().getFullYear(); if (new Date(obj.row.start_date) > new Date(year_ + "-12-31")) { Root.message({ type: 'warning', message: '开始日期ä¸èƒ½è·¨å¹´' }); obj.row.start_date = null; } if (obj.row.end_date) { if (obj.row.start_date) { if (new Date(obj.row.end_date) < new Date(obj.row.start_date)) { Root.message({ type: 'warning', message: '开始日期ä¸èƒ½æ™šäºŽç»“æŸæ—¥æœŸ', }); obj.row.start_date = null; } } var year_2 = obj.row.end_date.split('-')[0]; if (new Date(obj.row.start_date) > new Date(year_2 + "-12-31")) { Root.message({ type: 'warning', message: '开始日期ä¸èƒ½è·¨å¹´' }); obj.row.start_date = null; } } }, } }, end_date: { input: { onchange: function(obj) { if (obj.row.end_date) { if (obj.row.end_date && obj.row.start_date) { if (new Date(obj.row.end_date) < new Date(obj.row.start_date)) { Root.message({ type: 'warning', message: 'ç»“æŸæ—¥æœŸä¸èƒ½æ—©äºŽå¼€å§‹æ—¥æœŸ', }); obj.row.end_date = null; } } var year_ = obj.row.start_date? obj.row.start_date.split('-')[0] : new Date().getFullYear(); if (new Date(obj.row.end_date) > new Date(year_ + "-12-31")) { Root.message({ type: 'warning', message: 'ç»“æŸæ—¥æœŸä¸èƒ½è·¨å¹´' }); obj.row.end_date = null; } } } } }, }; }, getOldData(idStr) { let me = this let param = { dataName: 'agm_record_syzc', filter: "ar.id in (" + idStr + ")" } Server.call("rootjemin/data/getEntitySet", param, function(result) { if (result.success) { let tableData = result.data.entityset if (tableData.length > 0) { let idArr = idStr.replaceAll("'", "").split(',') let tableData_ = [] idArr.map(s => { tableData_.push(tableData.filter(x => x.id == s)[0]) }) if (me.popupParames.sceneCode == "changeEdit") { me.tableData_old = tableData_ } else { var tableDataOldObj_ = {}; tableData_.map(entity=>{ let row_ = clone(entity); tableDataOldObj_[me.tableDataObj[row_.id]] = row_; }) me.tableDataOldObj = clone(tableDataOldObj_); me.tableData = tableData_ let tableData = clone(me.tableData) let tableData2 = clone(me.tableData2) tableData.map(s => { tableData2.map(x => { if (x.old_id == s.id) { s.termination_date = JSON.parse(JSON.stringify(x.termination_date)) x.termination_date = "" } }) }) me.tableData = tableData me.tableData2 = tableData2 } } } }); }, 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 = clone(me.tableData3) 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 : '已完æˆ' }) 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 } let param = { businessId: this.formData.id, flowId: this.formData.flow_id, businessType: "agmRecord", variableMap: { reason: this.approveremark, flowId: this.formData.flow_id, attachment: this.formData3.files2?this.formData3.files2[0].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: '审批æˆåŠŸ' }) 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_ = clone(me.formData2); var formData_2 = clone(me.formData3); 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) { 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); } } } }, changeTableData() { var table_row = clone(this.newTableData); this.rowChange(table_row, "2add", this.table_dataname); }, addTableData() { let me = this var config = { totab: false, //true: 以Tabå¯¼èˆªçš„æ–¹å¼æ‰“å¼€ width: "900px", height: "450px", icon: "icon-product", text: "选择客户", id: "popup_customer_list",//totab: trueæ—¶éœ€è®¾ç½®ï¼Œç”¨äºŽåˆ¤æ–æ˜¯å¦å·²æ‰“å¼€æ¤é¡µé¢ url: "../agreement/popup/popup_customer_list.html", data: {}, delta: {isSelects: true}, dataname: "customer", filter: "1 = 1", sceneCode: "add", //"add"//"browse", callback: function(data, callback) { let tableData = clone(me.tableData) data.map((e, index) => { let s = {} s.pay_type = "票折" s.customer_id = e.id s.customer_code = e.md_code s.customer_name = e.md_description s.province_code = e.province s.province_name = e.province_name tableData.push(s) }) me.tableData = tableData if (callback) { callback(); } } }; me.doPopupByPublic(config); }, 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 == "2add") { this.tableData2.unshift(row); } else if (type == "del") { this.tableData.remove(row); } else { } }, setPolicyReaded() { let me = this let param = { dataName: 'pkg_agm_record_xsrw', data: { agm_record_apply_xsrw: { 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(me.iscommit) { var bo = me.$refs.form1.checkForm(); if(!bo) { Root.message({ type: 'warning', message: '请填写必填项' }); return; } this.formData.readed = "F" } var entity_ = clone(this.formData); var entity = {}; for (var r in entity_) { if (entity_[r]) { entity[r] = entity_[r]; } } entity.update_time = "" if (tableData_ && tableData_.length > 0) { tableData_.map(e => { e.is_deposit = e.is_deposit? 'Y' : 'N' }) me.tableData = tableData_ } var tableData_ = []; this.tableData.map(r=>{ var row_ = {}; for (var k in r) { if (r[k]) { if (k == 'is_deposit') { if (r[k] === true) { row_[k] = "Y"; } else if (r[k] === false) { row_[k] = "N"; } else { row_[k] = r[k]; } } else { row_[k] = r[k]; } } } tableData_.push(row_); }) if (this.formData.trans_type == "trans") { tableData_.map(e => { if (e.termination_date) { let startDate = new Date(e.termination_date) startDate.setDate(startDate.getDate() + 1) e.start_date = dateFormat(startDate, "yyyy-MM-dd") } }) } let fileList = [] if (me.formData2.attachment_name && me.formData2.attachment_name.length > 0) { me.formData2.attachment_name.map(s => { fileList.push({ type: "agm_record", file_id: s.id, file_name: s.file_name }) }) } if (tableData_.length == 0) { Root.message({ type: 'warning', message: 'è¯·å…ˆæ·»åŠ æ˜Žç»†æ•°æ®' }); return } let param = { dataName: 'pkg_agm_record_xsrw', data: { agm_record_apply_xsrw: entity, agm_record_xsrw: tableData_, agm_record_xsrw_file: fileList }, } Server.call("rootjemin/data/saveEntity", param, function(result) { if (result.success) { if(me.iscommit){ me.iscommit = false; me.doSubmit(param.data.agm_record_apply_xsrw.id); } else { Root.message({ type: 'success', message: 'ä¿å˜æˆåŠŸ' }); me.saveAfter(); } } }); }, doSubmit(id) { let me = this; let pa = { dataName: "agm_record_apply", id: id, flow_id: this.formData.flow_id || "", business_type: "recordXsrw" } Server.call("rootjemin/data/Commit", pa, function(result) { if (result.success) { Root.message({ type: 'success', message: 'æäº¤æˆåŠŸ' }); 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:200px; width: 340px; overflow: auto;'>" + e.message else { str += "</br></br> " + e.message } }) Root.message({ dangerouslyUseHTMLString: true, type: 'error', message: str }); } }); } } }); }; 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; } /* .el-button--mini { color: #FFF; background-color: #2984e2; border-color: #409EFF; } */ </style> </body> </html>