| | |
| | | dataname: "agm_agreement", |
| | | //Tab项设置 |
| | | tabs_d: [//agm_agreement |
| | | {code: "Input", name: "费用单申请", dataname: "agm_agreement", filterTxt: " (agm_agreement.state_code='Input' or agm_agreement.state_code='Rejected' or agm_agreement.state_code='OpeningApproval')", orderby: "agm_agreement.update_time desc",}, |
| | | {code: "Open", name: "生效", dataname: "agm_agreement", filterTxt: " agm_agreement.state_code='Open'", orderby: "agm_agreement.update_time desc", }, |
| | | {code: "Close", name: "终止", dataname: "agm_agreement", filterTxt: " (agm_agreement.state_code='Closed' or date_to < NOW())", orderby: "agm_agreement.update_time desc",}, |
| | | {code: "All", name: "全部", dataname: "agm_agreement", filterTxt: "1=1", orderby: "agm_agreement.update_time desc",}, |
| | | {code: "Input", name: "费用单申请", dataname: "fee_payment", filterTxt: "state_code='Input'", orderby: "",}, |
| | | {code: "Open", name: "生效", dataname: "fee_payment", filterTxt: "state_code='Open'", orderby: "", }, |
| | | {code: "Close", name: "终止", dataname: "fee_payment", filterTxt: "state_code='Repeal'", orderby: "",}, |
| | | {code: "All", name: "全部", dataname: "fee_payment", filterTxt: "1=1", orderby: "",}, |
| | | ], |
| | | default_tableFields: [ |
| | | { field: "state_name", name: "状态", isshow: "T", width: "80",input_type_filter:"select",filter_field:"state_code",inputtype:"capsuletag",options_pattern:"{^草稿^:^info^,^生效^:^success^,^审批中^:^warning^}"}, |
| | | // { field: "state_name", name: "状态", isshow: "T", width: "80"}, |
| | | { field: "state_code", name: "状态", isshow: "F", width: "80" }, |
| | | { field: "id", name: "费用单编号", isshow: "T", width: "120", isfilter: true }, |
| | | { field: "province", name: "省份", isshow: "T" ,width: "100"}, |
| | | { field: "rate", name: "费率", isshow: "T" ,width: "100"}, |
| | | { field: "amt_rate", name: "付款比例", isshow: "T" ,width: "100"}, |
| | | { field: "customer_code", name: "服务供应商编码", isshow: "T" ,width: "110"}, |
| | | { field: "customer_name", name: "服务供应商", isshow: "T" ,width: "200",align:"left"}, |
| | | { field: "amt", name: "应付金额", isshow: "T" ,width: "100",formatter:'formatter_money'}, |
| | | { field: "other_deduction", name: "其余扣款", isshow: "T", align: "center", width: "100",formatter:'formatter_money' }, |
| | | { field: "after_deduction_amt", name: "扣款后金额", isshow: "T", align: "center", width: "100",formatter:'formatter_money' }, |
| | | { field: "applicant", name: "申请人", isshow: "T", align: "center", width: "100" }, |
| | | { field: "apply_date", name: "申请时间", isshow: "T", align: "center", width: "100" ,formatter:'formatter_date'}, |
| | | { field: "order_state", name: "尾款状态", isshow: "T", align: "center", width: "100" }, |
| | | { field: "order_code", name: "关联首款单号", isshow: "T", align: "center", width: "100", isfilter: true }, |
| | | { field: "province_order_code", name: "省级费用单号", isshow: "T", align: "center", width: "100", isfilter: true }, |
| | | { field: "payment", name: "付款金额", isshow: "T", align: "center", width: "100",formatter:'formatter_money' }, |
| | | { field: "payment_date", name: "付款时间", isshow: "T", align: "center", width: "100", isfilter: true ,formatter:'formatter_date'}, |
| | | { field: "freeze", name: "冻结状态", isshow: "T", align: "center", width: "100" }, |
| | | ], |
| | | |
| | | |
| | | // d_tabs: { |
| | | // Input: true, |
| | | // Working: true, |
| | |
| | | me.tableButtonClick(); |
| | | this.doQueryByTab(function(result, callback) {//查询后的回调,用于获取字段的 |
| | | if (result.meta && result.meta[me.selectTabObj.dataname] && result.meta[me.selectTabObj.dataname].fields) { |
| | | var metas = clone(result.meta[me.selectTabObj.dataname].fields); |
| | | // var metas = clone(result.meta[me.selectTabObj.dataname].fields); |
| | | var filterFields_ = []; |
| | | var tableFields_ = []; |
| | | |
| | | metas.map(f=>{ |
| | | f.isshow = "T"; |
| | | me.default_tableFields.map(f=>{ |
| | | |
| | | if (me.selectTabObj.code == 'Input') { |
| | | if (f.field == 'contract_attachment_name') { |
| | | f.isshow = "F"; |
| | | } |
| | | } |
| | | |
| | | if (me.isCustomer && (f.field == "contact_department" || f.field == "contact_phone" |
| | | || f.field == "template_attachment_name" || f.field == "logistics_code" |
| | | || f.field == "creator_name" || f.field == "create_time" || f.field == "update_time" |
| | | )) { |
| | | f.isshow = "F" |
| | | f.isfilter = false |
| | | } |
| | | |
| | | if (me.isCustomer && me.selectTabObj.code != "Close" && (f.field == "suspend_date" || f.field == "suspend_remark")) { |
| | | f.isshow = "F" |
| | | f.isfilter = false |
| | | } |
| | | |
| | | if (f.isfilter) { |
| | | filterFields_.push(clone(f)); |
| | | } |
| | | else { |
| | | var filter_f = clone(f); |
| | | filter_f.isshow = "F"; |
| | | filterFields_.push(filter_f); |
| | | } |
| | | filterFields_.push(clone(f)); |
| | | |
| | | tableFields_.push(clone(f)); |
| | | }) |
| | | if (!me.selectTabObj.filterFields || (me.selectTabObj.filterFields && me.selectTabObj.filterFields.length == 0)) { |
| | | me.selectTabObj.filterFields = clone(filterFields_); |
| | | me.selectTabObj.tableFields = clone(tableFields_); |
| | | me.selectTabObj.tableFields = clone(me.default_tableFields); |
| | | |
| | | // me.selectTabObj.filterFields = clone(me.default_filterFields); |
| | | // me.selectTabObj.tableFields = clone(me.default_tableFields); |
| | |
| | | tablebuttonClick.Input = [ |
| | | { |
| | | // name: "新增", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.add ? me.cbuttons_r.add : false, |
| | | isbuttonshow: true, |
| | | code: "add", isselected: false, classname: "", |
| | | onclick: function(obj) { |
| | | // obj.selectedList |
| | | me.openAgreement('add', obj.selectedList[0]); |
| | | me.openPayment('add') |
| | | } |
| | | }, |
| | | { |
| | | // name: "提交", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.submit ? me.cbuttons_r.submit : false, type: "success", |
| | | code: "submit", isselected: true, classname: "", |
| | | isbuttonshow:true, type: "success", |
| | | code: "edit", isselected: true, classname: "", |
| | | disabled: function(selectRowList) { |
| | | var bo_ = true; |
| | | if (selectRowList[0] && selectRowList[0].state_code == "Input") { |
| | |
| | | return bo_ |
| | | }, |
| | | onclick: function(obj) { |
| | | |
| | | // obj.selectedList |
| | | // me.closeData('browse', obj.selectedList[0]); |
| | | // me.commitData(obj.selectedList[0]); |
| | | me.openAgreement('edit', obj.selectedList[0]); |
| | | me.openPayment('edit') |
| | | } |
| | | }, |
| | | { |
| | | // name: "详情", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.formdetail ? me.cbuttons_r.formdetail : false, |
| | | isbuttonshow: true, |
| | | code: "formdetail", isselected: true, classname: "", |
| | | disabled: function(selectRowList) { |
| | | var bo_ = true; |
| | |
| | | }, |
| | | onclick: function(obj) { |
| | | // obj.selectedList |
| | | me.openAgreement('browse', obj.selectedList[0]); |
| | | me.openPayment('browse') |
| | | } |
| | | }, |
| | | { |
| | | // name: "编辑", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.edit ? me.cbuttons_r.edit : false, |
| | | code: "edit", isselected: true, classname: "", |
| | | disabled: function(selectRowList) { |
| | | // name: "作废", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: true, type: "danger", |
| | | code: "cancel", isselected: true, classname: "", |
| | | islistselected: true, // 可以多选 |
| | | disabled: function(selectRowList, selectedList) { |
| | | var bo_ = true; |
| | | if (selectRowList[0] && selectRowList[0].state_code == "Input") { |
| | | if (selectedList.length) { // 可以多选 |
| | | bo_ = false; |
| | | } |
| | | return bo_ |
| | | }, |
| | | onclick: function(obj) { |
| | | // obj.selectedList |
| | | me.openAgreement('edit', obj.selectedList[0]); |
| | | } |
| | | }, |
| | | { |
| | | // name: "删除", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.delete ? me.cbuttons_r.delete : false, type: "danger", |
| | | isbuttonshow: true, type: "danger", |
| | | code: "delete", isselected: true, classname: "", |
| | | disabled: function(selectRowList) { |
| | | var bo_ = true; |
| | |
| | | // } |
| | | // }, |
| | | |
| | | { |
| | | name: "协议打印", type: "primary", icon: "el-icon-copy-document", |
| | | isbuttonshow: me.cbuttons_r.PDFFile ? me.cbuttons_r.PDFFile : false, |
| | | code: "PDFFile", isselected: true, classname: "", |
| | | disabled: function(selectRowList, selectedList) { |
| | | var bo_ = true; |
| | | if (selectRowList[0] && selectRowList[0].comeback_attachment_id) { |
| | | bo_ = false; |
| | | } |
| | | return bo_ |
| | | }, |
| | | onclick: function(obj) { |
| | | // obj.selectedList |
| | | me.showFileImgByFileId(me.selectTabObj.selectedrow, 'comeback_attachment_name', 'comeback_attachment_id', me.dataname) |
| | | } |
| | | }, |
| | | { |
| | | name: "协议回挂", type: "primary", icon: "el-icon-copy-document", |
| | | isbuttonshow: me.cbuttons_r.uploadFilePDF ? me.cbuttons_r.uploadFilePDF : false, |
| | | code: "uploadFilePDF", isselected: true, classname: "", |
| | | disabled: function(selectRowList, selectedList) { |
| | | var bo_ = true; |
| | | if (selectRowList[0]) { |
| | | bo_ = false; |
| | | } |
| | | return bo_ |
| | | }, |
| | | onclick: function(obj) { |
| | | // obj.selectedList |
| | | me.onPopupByUploadFile(me.selectTabObj.selectedrow, 'comeback_attachment_name', 'comeback_attachment_id', me.dataname) |
| | | } |
| | | }, |
| | | { |
| | | name: "续签", type: "primary", icon: "el-icon-copy-document", |
| | | isbuttonshow: me.cbuttons_r.agmCopy ? me.cbuttons_r.agmCopy : false, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | { |
| | | name: "变更", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.change ? me.cbuttons_r.change : false, |
| | | code: "change", isselected: true, classname: "", |
| | | disabled: function(selectRowList) { |
| | | var bo_ = true; |
| | | if (selectRowList[0] && selectRowList[0].state_code == "Open") { |
| | | bo_ = false; |
| | | } |
| | | return bo_ |
| | | }, |
| | | onclick: function(obj) { |
| | | // obj.selectedList |
| | | me.openAgreement('change', obj.selectedList[0]); |
| | | } |
| | | }, |
| | | |
| | | { |
| | | // name: "作废", // type: "primary", // icon: "el-icon-edit", |
| | | isbuttonshow: me.cbuttons_r.repeal ? me.cbuttons_r.repeal : false, type: "danger", |
| | |
| | | var tablefieldClick = {}; |
| | | //表格字段事件设置 |
| | | tablefieldClick = { |
| | | agreement_no: {//字段事件设置 |
| | | id: {//字段事件设置 |
| | | val: {//有值时的点击事件 |
| | | notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222" |
| | | notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"] |
| | | onclick: function(obj) {//数据值点击事件 |
| | | //打开 |
| | | me.onShowData(obj); |
| | | me.openPayment('browse'); |
| | | }, |
| | | }, |
| | | defaultval: { |
| | | val: "查看",//空值时的显示值 |
| | | onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效 |
| | | me.onShowData(obj); |
| | | } |
| | | }, |
| | | }, |
| | | state_name: {//状态 |
| | | val: {//有值时的点击事件 |
| | | notclick_val: ["草稿","草稿"], |
| | | notclick_bindfield: [], |
| | | onclick: function(obj) { |
| | | var config = { |
| | | totab: false, |
| | | width: "1100px", |
| | | height: "520px", |
| | | icon: "icon-product", |
| | | text: "流程步骤", |
| | | id: "popup_workflow_step_user" + obj.row.id, |
| | | url: "module/tool/page/popup_workflow_step_user.html?v=2023020703", |
| | | data: obj.row, |
| | | delta: {}, |
| | | sceneCode: "browse", |
| | | callback: function(obj, callback) { |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | }, |
| | | }, |
| | | template_attachment_name: {//字段事件设置 |
| | | val: {//有值时的点击事件 |
| | | notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222" |
| | | notclick_bindfield: [{field:"contract_attachment_id", val: null}],//当该字段值等于指定字段值时不可点击["filterfield": "111"] |
| | | onclick: function(obj) {//数据值点击事件 |
| | | //打开 |
| | | me.showFileImgByFileId(obj.row, "template_attachment_name", "contract_attachment_id", me.dataname); |
| | | }, |
| | | }, |
| | | }, |
| | | contract_attachment_name: {//字段事件设置 |
| | | defaultval: { |
| | | val: "原协议上传",//空值时的显示值 |
| | | onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效 |
| | | me.onPopupByUploadFile(obj.row, "contract_attachment_name", "contract_attachment_id", me.dataname); |
| | | } |
| | | }, |
| | | val:{ |
| | | onclick: function(obj){ |
| | | me.showFileImgByFileId(obj.row, "contract_attachment_name", "contract_attachment_id", me.dataname); |
| | | } |
| | | }, |
| | | suffixval: { |
| | | val: "原协议上传",//有值时的后缀,此后缀和单位后缀不同,如:详情,更多,查看等 |
| | | onclick: function(obj) {//有值时的后缀点击事件,此事件需要设置val才有效 |
| | | me.onPopupByUploadFile(obj.row, "contract_attachment_name", "contract_attachment_id", me.dataname); |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | comeback_attachment_name: {//字段事件设置 |
| | | defaultval: { |
| | | val: "协议回挂",//空值时的显示值 |
| | | onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效 |
| | | me.onPopupByUploadFile(obj.row, "comeback_attachment_name", "comeback_attachment_id", me.dataname); |
| | | } |
| | | }, |
| | | val:{ |
| | | onclick: function(obj){ |
| | | me.showFileImgByFileId(obj.row, "comeback_attachment_name", "comeback_attachment_id", me.dataname); |
| | | } |
| | | }, |
| | | suffixval: { |
| | | val: "协议回挂",//有值时的后缀,此后缀和单位后缀不同,如:详情,更多,查看等 |
| | | onclick: function(obj) {//有值时的后缀点击事件,此事件需要设置val才有效 |
| | | me.onPopupByUploadFile(obj.row, "comeback_attachment_name", "comeback_attachment_id", me.dataname); |
| | | } |
| | | }, |
| | | // defaultval: { |
| | | // val: "查看",//空值时的显示值 |
| | | // onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效 |
| | | // me.onShowData(obj); |
| | | // } |
| | | // }, |
| | | }, |
| | | }; |
| | | |
| | | tablefieldClickBeforeOpen = { |
| | | agreement_no: {//字段事件设置 |
| | | val: {//有值时的点击事件 |
| | | notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222" |
| | | notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"] |
| | | onclick: function(obj) {//数据值点击事件 |
| | | //打开 |
| | | me.onShowData(obj); |
| | | }, |
| | | }, |
| | | defaultval: { |
| | | val: "查看",//空值时的显示值 |
| | | onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效 |
| | | me.onShowData(obj); |
| | | } |
| | | }, |
| | | }, |
| | | state_name: {//状态 |
| | | val: {//有值时的点击事件 |
| | | notclick_val: ["草稿","草稿"], |
| | | notclick_bindfield: [], |
| | | onclick: function(obj) { |
| | | var config = { |
| | | totab: false, |
| | | width: "1100px", |
| | | height: "520px", |
| | | icon: "icon-product", |
| | | text: "流程步骤", |
| | | id: "popup_workflow_step_user" + obj.row.id, |
| | | url: "module/tool/page/popup_workflow_step_user.html?v=2023020703", |
| | | data: obj.row, |
| | | delta: {}, |
| | | sceneCode: "browse", |
| | | callback: function(obj, callback) { |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | }, |
| | | }, |
| | | template_attachment_name: {//字段事件设置 |
| | | val: {//有值时的点击事件 |
| | | notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222" |
| | | notclick_bindfield: [{field:"contract_attachment_id", val: null}],//当该字段值等于指定字段值时不可点击["filterfield": "111"] |
| | | onclick: function(obj) {//数据值点击事件 |
| | | //打开 |
| | | me.showFileImgByFileId(obj.row, "template_attachment_name", "contract_attachment_id", me.dataname); |
| | | }, |
| | | }, |
| | | }, |
| | | }; |
| | | |
| | | if (this.selectTabObj.code != 'Input') { |
| | | this.selectTabObj.tablefieldClick = tablefieldClick; |
| | | } else { |
| | | this.selectTabObj.tablefieldClick = tablefieldClickBeforeOpen; |
| | | } |
| | | this.selectTabObj.tablefieldClick = tablefieldClick; |
| | | }, |
| | | |
| | | onSuspend(callback) { |
| | |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | |
| | | onShowData(obj) { |
| | | var me = this; |
| | | var row = obj.row; |
| | | |
| | | //1. empty row |
| | | if (!row || !row.id) { |
| | | Root.message({ |
| | | type: 'warning', |
| | | message: '请选择要查看的数据' |
| | | }); |
| | | return false; |
| | | |
| | | openPayment(sceneCode){ |
| | | let me = this; |
| | | var row = {}; |
| | | if (sceneCode == "edit" || sceneCode == "browse") { |
| | | row = me.selectTabObj.selectedrow; |
| | | if (!row.id) { |
| | | Root.message({ |
| | | type: 'warning', |
| | | message: '请选择一条数据' |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var config = { |
| | | totab: true, //true: 以Tab导航的方式打开 |
| | | width: "900px", |
| | | height: "900px", |
| | | width: "1100px", |
| | | height: "520px", |
| | | icon: "icon-product", |
| | | text: "协议详情", |
| | | id: "apply_edit_b" + row.id, |
| | | url: "module/md/page/customer/page/customer_list_agreement_edit.html", |
| | | text: "单据信息" + (row.name ? row.name : ""), |
| | | id: "fee_payment" + (row.id? row.id : "add"),//totab: true时需设置,用于判断是否已打开此页面 |
| | | url: "module/fee/page/popup/popup_fee_payment.html", |
| | | data: row, |
| | | delta: {}, |
| | | sceneCode: "browse", //"add"//"browse", |
| | | sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", |
| | | callback: function(obj, callback) { |
| | | me.onQuery(); |
| | | if (callback) { |
| | |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | |
| | | onAddData() { |
| | | var me = this; |
| | | |
| | | var config = { |
| | | totab: true, //true: 以Tab导航的方式打开 |
| | | icon: "icon-product", |
| | | text: "协议信息", |
| | | id: "apply_edit",//totab: true时需设置,用于判断是否已打开此页面 |
| | | url: "module/md/page/customer/page/customer_list_agreement_edit.html", |
| | | data: {}, |
| | | delta: {}, |
| | | sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse", |
| | | callback: function(obj, callback) { |
| | | me.onQuery(); |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | |
| | | commitData(obj) { |
| | | var me = this; |
| | | Root.confirm('确定提交协议' + obj.agreement_no + '吗?', '提交提示', { |
| | | confirmButtonText: '提交', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | var param = { |
| | | dataname: me.selectTabObj.dataname, |
| | | id: obj.id, |
| | | // to_state: "OpeningApproval" |
| | | } |
| | | Server.call("root/data/commit", param, function(result) { |
| | | console.log(result); |
| | | if (result.success) { |
| | | Root.message({ |
| | | type: 'success', |
| | | message: '提交成功' |
| | | }); |
| | | me.onQuery(); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | Root.message({ |
| | | type: 'info', |
| | | message: '已取消' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | onEditData() { |
| | | var me = this; |
| | | var row = this.selectTabObj.selectedrow;; |
| | | |
| | | //1. empty row |
| | | if (!row || !row.id) { |
| | | Root.message({ |
| | | type: 'warning', |
| | | message: '请选择要编辑的数据' |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | var config = { |
| | | totab: true, //true: 以Tab导航的方式打开 |
| | | icon: "icon-product", |
| | | text: "协议信息", |
| | | id: "apply_edit" + row.id,//totab: true时需设置,用于判断是否已打开此页面 |
| | | url: "module/md/page/customer/page/customer_list_agreement_edit.html", |
| | | data: row, |
| | | delta: {}, |
| | | sceneCode: "edit",//"refuseedit",//"approval", //"add"//"browse", |
| | | callback: function(obj, callback) { |
| | | me.onQuery(); |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | delData: function(scope) { |
| | | let me = this; |
| | | var row = me.selectTabObj.selectedrow; |
| | |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | //作废模板 |
| | | cancelConfirm() { |
| | | let me = this; |
| | | data = me.selectTabObj.selectedrow; |
| | | Root.confirm('确定终止-' + data.agreement_no + '-吗?', '终止提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | me.onCancelData(); |
| | | }).catch(() => { |
| | | Root.message({ |
| | | type: 'info', |
| | | message: '已取消终止' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | onCancelData() { |
| | | var me = this; |
| | | |
| | | let param = { |
| | | dataname: me.dataname, |
| | | data: { |
| | | "agm_agreement" :{ |
| | | id: me.selectTabObj.selectedrow.id, |
| | | date_suspend: "", // 终止日期 |
| | | remark_suspend: "", // 终止说明 |
| | | state_code: "Cancel", |
| | | state_name: "终止", |
| | | } |
| | | }, |
| | | } |
| | | |
| | | Server.call("root/data/saveEntity", param, function(result) { |
| | | console.log(result); |
| | | Root.message({ |
| | | type: 'success', |
| | | message: '已作废' |
| | | }); |
| | | me.onQuery(); |
| | | }); |
| | | }, |
| | | |
| | | showFileImgByFileId(row, filenamefield, fileidfield, dataname) { |
| | | let me = this; |
| | | var file_name = row[filenamefield]; |
| | | var file_id = row[fileidfield]; |
| | | 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, |
| | | dataname: dataname |
| | | } |
| | | |
| | | var config = { |
| | | totab: false, |
| | | width: "1000px", |
| | | height: 800, |
| | | icon: "icon-product", |
| | | text: "附件预览", |
| | | id: "pdf_" + fileid, |
| | | url: "module/tool/page/popup_file_pdf.html", |
| | | data: row, |
| | | delta: {}, |
| | | callback: function(obj, callback) { |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | this.doPopupByPublic(config); |
| | | } |
| | | else {//只可下载,不可预览 |
| | | // handleDownloadUrl(fileid,false); |
| | | handleDownload(fileid, dataname); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onPopupByUploadFile(row, filenamefield, fileidfield, dataname) { |
| | | var me = this; |
| | | if (row.state_code != 'Open') { |
| | | Root.message({ |
| | | type: 'warning', |
| | | message: '仅生效数据可以进行协议回挂' |
| | | }); |
| | | return; |
| | | } |
| | | var txt_ = ""; |
| | | var isexists = false; |
| | | if (filenamefield == "comeback_attachment_name") { // 协议回挂 |
| | | txt_ = "重新进行协议回挂将替换原回挂协议"; |
| | | if (row.comeback_attachment_id) { |
| | | isexists = true; |
| | | } |
| | | } |
| | | else if (filenamefield == "contract_attachment_name") { // 协议原件 |
| | | txt_ = "重新上传协议原件将替换原协议原件"; |
| | | if (row.contract_attachment_id) { |
| | | isexists = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | if (isexists) { |
| | | Root.confirm(txt_, '上传提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | me.doPopupByUploadFile(row, filenamefield, fileidfield, dataname); |
| | | }).catch(() => { |
| | | Root.message({ |
| | | type: 'info', |
| | | message: '已取消上传' |
| | | }); |
| | | }); |
| | | } else { |
| | | me.doPopupByUploadFile(row, filenamefield, fileidfield, dataname); |
| | | } |
| | | }, |
| | | |
| | | doPopupByUploadFile(row, filenamefield, fileidfield, dataname) { |
| | | var me = this; |
| | | var analysistype_ = ""; |
| | | var delta_ = {filetypelist: []}//[".png", ".jpg", ".pdf"] |
| | | var config = { |
| | | totab: false, |
| | | width: "500px", |
| | | icon: "icon-product", |
| | | text: "附件上传", |
| | | id: "popupByUploadFile", |
| | | url: "module/tool/page/popup_uploadFile.html", |
| | | data: { |
| | | dataName: dataname, |
| | | fileidfieldName: fileidfield, |
| | | id: row.id, |
| | | fileNamefieldName: filenamefield |
| | | }, |
| | | delta: delta_, |
| | | callback: function(fileobj, callback) { |
| | | me.$message({ |
| | | showClose: true, |
| | | message: '上传成功!', |
| | | type: 'success' |
| | | }); |
| | | row[filenamefield] =decodeURI(fileobj.row[0].name); |
| | | row[fileidfield] = fileobj.row[0].id; |
| | | me.onQuery(); |
| | | |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | this.doPopupByPublic(config); |
| | | }, |
| | | |
| | | download() { |
| | |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | |
| | | |
| | | rowClick(obj){ |
| | | var me = this; |
| | | me.selectTabObj.selectedrow = obj.row; |
| | | }, |
| | | selectionChange(obj){ |
| | | var me = this; |
| | | me.selectTabObj.selectedrows = obj; |
| | | me.selectedrows = obj; |
| | | }, |
| | | saveShoppingcart(list) { |
| | | var me = this; |
| | | me.selectTabObj.selectedrows = list; |
| | | }, |
| | | onDownload() { |
| | | let me = this; |
| | | var ioname = "" |
| | | var filename = '协议导出' + String(new Date().getTime()); |
| | | var filter_ = "1 = 1"; |
| | | filter_ = this.getFilterData(filter_); |
| | | if (me.selectTabObj.code == "Input") { |
| | | ioname = "export_agm" |
| | | filename = '协议申请导出' + String(new Date().getTime()); |
| | | } |
| | | else if (me.selectTabObj.code == "Open") { |
| | | ioname = "export_agm_apply" |
| | | } |
| | | let param = { |
| | | sign: "agm_agreement", |
| | | filename: filename, |
| | | filter: filter_, |
| | | ioname:ioname, |
| | | orderby: "", |
| | | token: Root.getToken() |
| | | } |
| | | window.top.vue.textdownloadForm(param); |
| | | }, |
| | | |
| | | editLogisticsCode() { |
| | | var me = this; |
| | | var config = { |
| | | totab: false, //true: 以Tab导航的方式打开 |
| | | width: "500px", |
| | | height: "300px", |
| | | icon: "icon-product", |
| | | text: "编辑物流单号", |
| | | id: "delivery_info_expresscode" + me.selectTabObj.selectedrow.id,//totab: true时需设置,用于判断是否已打开此页面 |
| | | url: "module/md/page/customer/page/agreement-popup/delivery_info_expresscode.html", |
| | | data: me.selectTabObj.selectedrow, |
| | | delta: {}, |
| | | sceneCode: "edit",//"refuseedit",//"approval", //"add"//"browse", |
| | | callback: function(obj, callback) { |
| | | me.onQuery(); |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | |
| | | openAgreement(sceneCode, obj) { |
| | | let me = this; |
| | | var row = {} |
| | | if (sceneCode == "edit" || sceneCode == "browse" || sceneCode == "change") { |
| | | row = me.selectTabObj.selectedrow; |
| | | if(!row){ |
| | | Root.message({ |
| | | type: 'warning', |
| | | message: '请选择一条数据' |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var config = { |
| | | totab: true, //true: 以Tab导航的方式打开 |
| | | width: "1100px", |
| | | height: "520px", |
| | | icon: "icon-product", |
| | | text: "协议详情" + (row.customer_name ? ("-" + row.customer_name) : ""), |
| | | id: "customer_list_agreement_edit" + row.id + sceneCode,//totab: true时需设置,用于判断是否已打开此页面 |
| | | url: "module/md/page/customer/page/customer_list_agreement_edit.html", |
| | | data: row, |
| | | delta: {}, |
| | | sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", |
| | | callback: function(obj, callback) { |
| | | me.onQuery(); |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | me.doPopupByPublic(config); |
| | | }, |
| | | DownloadTemplate() { |
| | | var pathurl = ""; |
| | | if (this.selectTabObj.code == "Input") { |
| | | pathurl = "template/1.导入模板/0_协议申请导入.xlsx"; |
| | | } |
| | | handleDownload(pathurl); |
| | | }, |
| | | |
| | | |
| | | onPopupByUploadFileToDB() { |
| | | var me = this; |
| | | var delta_ = { |
| | | filetypelist: [], |
| | | isToDB: true, |
| | | dataname: this.selectTabObj.dataname, |
| | | tableFields: this.selectTabObj.tableFields, |
| | | otherSave: "salesBizLogic/saveDealerTargetByImport", |
| | | } |
| | | var config = { |
| | | totab: false, |
| | | width: "500px", |
| | | icon: "icon-product", |
| | | text: "数据文件上传", |
| | | id: "popup_uploadFileToDB", |
| | | url: "module/tool/page/popup_uploadFileToDB.html", |
| | | data: { |
| | | uploadType: "dealertarget", |
| | | tempTable: "temp_target_dealer", |
| | | operate_type: "dealertarget", |
| | | userid: me.userid, |
| | | ioname:"", |
| | | // position_id: me.position_id, |
| | | }, |
| | | delta: delta_, |
| | | callback: function(obj, callback) { |
| | | me.$message({ |
| | | showClose: true, |
| | | message: '上传成功!', |
| | | type: 'success' |
| | | }); |
| | | me.onQuery(); |
| | | if (callback) { |
| | | callback(); |
| | | } |
| | | } |
| | | }; |
| | | this.doPopupByPublic(config); |
| | | me.selectedrows = list; |
| | | }, |
| | | |
| | | } |
| | |
| | | <el-button v-show="cbuttons_r.Renew" @click="onCopy" :disabled="!(selectedrows.length > 0)">协议续签</el-button> |
| | | </el-button-group> --> |
| | | <el-button-group style="margin-left: 3px;"> |
| | | <el-button v-show="cbuttons_r.downloadTemplate && selectTabObj.code == 'Input'" @click="DownloadTemplate">模板下载</el-button> |
| | | <el-button v-show="cbuttons_r.import && selectTabObj.code == 'Input'" @click="onPopupByUploadFileToDB":icon="buttonsconfig.import.icon">{{buttonsconfig.import.name}}</el-button> |
| | | <el-button v-show="cbuttons_r.export && (selectTabObj.code == 'Input' || selectTabObj.code == 'Open')" type="primary" @click="onDownload" :icon="buttonsconfig.export.icon">{{buttonsconfig.export.name}}</el-button> |
| | | <el-button type="primary" @click="" :icon="buttonsconfig.export.icon">{{buttonsconfig.export.name}}</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | </div> |