<!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 type="text/javascript">
|
var pageVue = null;
|
function loadJsCss(callback) {
|
var jscss_urls = [];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
|
function initVue() {
|
new BasicsVue({
|
el: "#vbody",
|
data: {
|
//dataname: "agm_record",
|
form_dataname: "agm_record",
|
//table_dataname: "agm_record_price_detail",
|
//table_dataname_terminal: "agm_record_terminal_detail",
|
dataRequest: [
|
// {
|
// name: "agm_category",
|
// //url: "root/front/getOneDictionary",
|
// //paramsobj: { code: "OrgType", },
|
// isnotoption: false, //true:不是选项
|
// code:"id",//是下拉选项时设置
|
// label:"name",//是下拉选项时设置
|
// },
|
|
{
|
name: "agm_template",
|
//url: "root/front/getOneDictionary",
|
//paramsobj: { code: "OrgType", },
|
filter: " type='record' and state_code = 'Open'",
|
isnotoption: false, //true:不是选项
|
code:"id",//是下拉选项时设置
|
label:"name",//是下拉选项时设置
|
orderby: "create_time"
|
},
|
|
{
|
name: "md_province",
|
filter: " 1=1",
|
isnotoption: false, //true:不是选项
|
code:"name",//是下拉选项时设置
|
label:"name",//是下拉选项时设置
|
},
|
],
|
|
title: "授权书申请",
|
formAttr: {
|
istitle: false,
|
title: "备案编辑",
|
columnnumber: 2,
|
labelwidth: "110px",
|
labelposition: "left",// right
|
size: "medium",
|
border: "10px solid #c6c6c600"
|
},
|
|
formFieldsAll: [
|
{isshow: "T", field: "area", name: "区域", type: "select", options: dataRoot.database.province, props:{value: "value", label: "label"}, notvalunit: true},
|
{isshow: "T", field: "customer_name", name: "客户名称", type: "popup", notvalunit: true},
|
{isshow: "T", field: "product_name", name: "产品名称", type: "popup", notvalunit: true},
|
{isshow: "T", field: "customer_code", name: "客户编码", type: "span", notvalunit: true},
|
{isshow: "T", field: "product_code", name: "产品编码", type: "span", notvalunit: true},
|
{isshow: "T", field: "price_raw", name: "原始价格/政策价格", labelwidth: "140px", align: "right", notvalunit: true},
|
{isshow: "T", field: "rate", name: "扣率", align: "right", valunit: "%"},
|
{isshow: "T", field: "price", name: "价格/补偿单价", align: "right", notvalunit: true},
|
{isshow: "T", field: "date_from", name: "生效时间", type: "date", notvalunit: true},
|
{isshow: "T", field: "date_to", name: "失效时间", type: "date", notvalunit: true},
|
{isshow: "T", field: "remark", name: "备注", type: "input", notvalunit: true},
|
],
|
formFields_default: [
|
{isshow: "T", field: "type_name", name: "备案模板", type: "span", notvalunit: true},
|
{isshow: "T", field: "creator_name", name: "创建人", type: "span", notvalunit: true},
|
{isshow: "T", field: "create_time", name: "创建时间", type: "span", notvalunit: true},
|
{isshow: "T", field: "code", name: "备案号", type: "span", notvalunit: true},
|
{isshow: "T", field: "versionno", name: "版本号", type: "span", formatter: "versionno", notvalunit: true},
|
],
|
|
formFields: [
|
{isshow: "T", field: "creator_name", name: "创建人", type: "span", notvalunit: true},
|
{isshow: "T", field: "create_time", name: "创建时间", type: "span", notvalunit: true},
|
{isshow: "T", field: "field213213", name: "授权书编号", type: "span", notvalunit: true},
|
{isshow: "T", field: "type_code", name: "授权书类型", type: "select", options: [], props: {value: "id", label: "name", checkStrictly: true}, notvalunit: true},
|
{isshow: "T", field: "customer_name", name: "经销商名称", type: "popup", notvalunit: true},
|
{isshow: "T", field: "customer_code", name: "经销商编码", type: "span", notvalunit: true ,colspan: 1},
|
{isshow: "F", field: "field11", name: "授权产品", type: "checkboxobj", options: [
|
{code: "PFO", name: "PFO"},
|
{code: "ASD", name: "ASD"},
|
{code: "PaA", name: "PaA"},
|
{code: "VSD", name: "VSD"},
|
{code: "PDA", name: "PDA"},
|
{code: "输送系统", name: "输送系统"},
|
{code: "网篮导丝", name: "网篮导丝"},
|
{code: "导丝", name: "导丝"},
|
],},
|
],
|
|
newRowDefault: {
|
batchno: createCode("RP"),
|
create_time: createDatetime(),
|
state_code: "Draft",
|
state_name: "草稿",
|
creator_name: Root.userInfo.name,
|
type_code: "",
|
type_name: "",
|
field11: [],
|
},
|
formData: {},
|
templateData: {},
|
|
editTableButton: {
|
edit: {
|
isshow: false,
|
txt:"编辑"
|
},
|
del: {
|
isshow: true,
|
txt:"删除"
|
},
|
save: {
|
isshow: false,
|
txt:"保存"
|
},
|
},
|
isEditTableData:true,
|
isWithinEditTableData:false,
|
tableFieldsAll: [
|
{isshow: "T", field: "code", name: "备案号", type: "span", width: "150"},
|
{isshow: "T", field: "date_from", name: "生效时间", type: "date", width: "150"},
|
{isshow: "T", field: "date_to", name: "失效时间", type: "date", width: "150"},
|
{isshow: "T", field: "customer_code", name: "客户编码", type: "span", width: "100"},
|
{isshow: "T", field: "customer_name", name: "客户名称", type: "popup", width: "180"},
|
{isshow: "T", field: "area", name: "区域省份", type: "span", width: "100"},
|
{isshow: "T", field: "terminal_name", name: "终端名称", type: "popup", width: "160"},
|
{isshow: "T", field: "product_code", name: "产品编码", type: "span", width: "100"},
|
{isshow: "T", field: "product_name", name: "产品名称", type: "popup", width: "160"},
|
{isshow: "T", field: "spec", name: "规格", width: "120"},
|
{isshow: "T", field: "pack", name: "包装", width: "160"},
|
{isshow: "T", field: "price_bidding_type", name: "中标价类型", type: "select", options: [], optionsgroup: "price_bidding_type", width: "160"},
|
{isshow: "T", field: "price_bidding", name: "中标价", type: "input", width: "100", align: "right"},
|
{isshow: "T", field: "price_invoice", name: "开票价(出厂价)", type: "input", width: "120", align: "right"},
|
{isshow: "T", field: "price_raw", name: "申请价格/调整价格", type: "input", width: "150", align: "right"},
|
{isshow: "T", field: "rate", name: "折扣率", type: "input", width: "120", align: "right"},
|
{isshow: "T", field: "price_rebate", name: "折扣价", type: "input", width: "120", align: "right"},
|
{isshow: "T", field: "price", name: "销售价", type: "input", width: "120", align: "right"},
|
{isshow: "T", field: "remark", name: "备注", type: "input", width: "200"},
|
],
|
tableTerminalFieldsAll: [
|
{isshow: "T", field: "terminal_name", name: "终端", type: "popup", width: "160"},
|
{isshow: "T", field: "amt_target_year", name: "年度指标金额", type: "input", width: "140", align: "right"},
|
{isshow: "T", field: "qty_target_year", name: "年度指标数量", type: "input", width: "140", align: "right"},
|
],
|
|
tableFields: [
|
{isshow: "T", field: "field0", name: "医院编码", width: "120", align: "center"},
|
{isshow: "T", field: "fieldhospital", name: "医院名称", type: "popup", width: "200", align: "left"},
|
{isshow: "T", field: "field6", name: "生效日期", type: "date", width: "150", align: "center"},
|
{isshow: "T", field: "field7", name: "失效日期", type: "date", width: "150", align: "center"},
|
{isshow: "T", field: "field8", name: "备注", width: "300", align: "left"},
|
{isshow: "T", field: "field9", name: "创建人", width: "100", align: "center"},
|
{isshow: "T", field: "field11", name: "创建日期", width: "150", align: "center", type: "date"},
|
{isshow: "T", field: "field12", name: "更新日期", width: "150", align: "center", type: "date"},
|
],
|
tableTerminalFields: [],
|
tableData: [],
|
tableTerminaData: [],
|
tableHeight: 320,
|
|
notdisabled: true,
|
Approval: false,
|
|
isCommit: false,
|
|
dialog_template: false,
|
value_template: "",
|
props_template: {value: "id", label: "name"},
|
options_templateobj: {},
|
options_category: [],
|
|
record_fields: [],
|
record_detail_fields: [],
|
record_terminal_detail_fields: [],
|
|
agm_record_obj: {},
|
agm_record_detail_obj: {},
|
agm_record_terminal_detail_obj: {},
|
|
orgobj: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
cname:"1",
|
|
t_height:null,
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
if (this.popupParames.delta) {
|
if (this.popupParames.delta.org) {//指定客户的备案申请
|
this.orgobj = clone(this.popupParames.delta.org);
|
}
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "browse") {
|
this.formAttr.disabled = true;
|
this.isWithinEditTableData = false;
|
this.notdisabled = false;
|
this.Approval = false;
|
}
|
else if (this.popupParames.sceneCode == "add") {
|
// this.dialog_template = true;
|
this.isWithinEditTableData = true;
|
if (this.newRowDefault) {
|
let formData_ = clone(this.formData);
|
|
for (var k in this.newRowDefault) {
|
formData_[k] = this.newRowDefault[k];
|
}
|
this.formData = formData_;
|
}
|
}
|
else if (this.popupParames.sceneCode == "draw") {
|
this.formAttr.disabled = true;
|
this.isWithinEditTableData = false;
|
this.notdisabled = false;
|
this.Approval = false;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
|
me.t_height = document.documentElement.clientHeight*1 - 91;
|
//预加载数据
|
if (this.dataRequest.length) {
|
var result = {};
|
//me.dataRequestObj.md_province
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
if (data.agm_template) {
|
data.agm_template.map(c=>{
|
me.options_templateobj[c[me.props_template.value]] = c;
|
})
|
|
let agm_template_ = ArrayToTree(clone(data.agm_template), "name", "parent_id");
|
me.options_category = data.agm_template;
|
|
var formFields_ = clone(me.formFields);
|
formFields_.map(f=>{
|
if (f.field == "type_code") {
|
f.options = data.agm_template;
|
}
|
})
|
|
me.formFields = clone(formFields_);
|
}
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
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
|
let filter_table = "";
|
var dataname_ = "agm_record"
|
this.getMetaByDataName(dataname_, function(result) {
|
if (result.meta && result.meta[dataname_]) {
|
var metas = clone(result.meta[dataname_]);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
var record_no = {};
|
metas.map(f=>{
|
f.isshow = "T";
|
|
if (f.field == "code") {
|
record_no = clone(f);
|
}
|
else {
|
if (f.field == "versionno") {
|
tableFields_.push(record_no);
|
}
|
else if (f.field == "customer_name") {
|
if (me.orgobj.id) {
|
f.type = "span"
|
}
|
}
|
|
tableFields_.push(clone(f));
|
}
|
})
|
me.tableFieldsAll = clone(tableFields_);
|
|
me.tableFieldClick();
|
}
|
})
|
},
|
|
tableFieldClick() {
|
var me = this;
|
this.formfieldClick = {
|
type_code: {//字段事件设置
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
// me.templateChange(obj);
|
}
|
},
|
},
|
customer_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_customerlist(obj)
|
}
|
},
|
},
|
product_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_productlist(obj)
|
}
|
},
|
},
|
|
};
|
//表格字段事件设置
|
this.tablefieldClick = {
|
area: {//字段事件设置
|
visible: {
|
onchange: function(obj) {//下拉展开事件
|
|
}
|
},
|
},
|
terminal_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_terminallist(obj)
|
}
|
},
|
},
|
product_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_productlist(obj)
|
}
|
},
|
},
|
fieldhospital: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_hospital(obj)
|
}
|
},
|
},
|
|
};
|
},
|
|
templateChange(obj) {
|
var me = this;
|
// this.formData.type_code = val[val.length - 1];
|
// this.formData.type_name = this.options_templateobj[val[val.length - 1]][this.props_template.label];
|
// this.formData.type_code = val;
|
// this.formData.type_name = this.options_templateobj[val][this.props_template.label];
|
|
if (this.tableData && this.tableData.length) {
|
Root.confirm('更改备案模板将清空备案数据?', '模板更改提示', {
|
confirmButtonText: '确 定',
|
cancelButtonText: '取 消',
|
type: 'warning'
|
}).then(() => {
|
me.tableData = [];
|
|
me.formData.type_code = obj.selectoption.id;
|
me.formData.type_name = obj.selectoption.name;
|
me.templateData = clone(obj.selectoption);
|
|
//根据不同的类型显示不同的字段
|
me.getFieldDataByTemplate();
|
}).catch(() => {
|
var formData_ =clone(me.formData);
|
formData_.type_code = clone(me.templateData.id);
|
formData_.type_name = clone(me.templateData.name);
|
me.formData =clone(formData_);
|
Root.message({
|
type: 'info',
|
message: '已取消更改'
|
});
|
});
|
}
|
else {
|
me.formData.type_code = obj.selectoption.id;
|
me.formData.type_name = obj.selectoption.name;
|
me.templateData = clone(obj.selectoption);
|
|
//根据不同的类型显示不同的字段
|
me.getFieldDataByTemplate();
|
}
|
|
|
},
|
|
templateSave() {
|
//根据不同的类型显示不同的字段
|
this.getFieldDataByTemplate();
|
|
this.dialog_template = false;
|
},
|
|
getFieldDataByTemplate() {
|
var me = this;
|
let filter_table = "";
|
|
if (this.formData.type_code) {
|
filter_table = "parent_id = '" + this.formData.type_code + "'";
|
}
|
|
let param_table = {
|
|
dataname: "agm_template_field_mapping",
|
filter: filter_table,
|
}
|
|
Server.call("root/data/getEntitySet", param_table, function(result) {
|
var agm_record_ = [];
|
var agm_record_detail_ = [];
|
var agm_record_terminal_detail_ = [];
|
var agm_record_obj_ = {};
|
var agm_record_detail_obj_ = {};
|
var agm_record_terminal_detail_obj_ = {};
|
|
result.data.entityset.map(entity=>{
|
if (entity.table_name == "agm_record") {
|
agm_record_.push(entity)
|
agm_record_obj_[entity.field] = entity;
|
}
|
// else if (entity.table_name == "agm_record_price_detail") {
|
// agm_record_detail_.push(entity)
|
// agm_record_detail_obj_[entity.field] = entity;
|
// }
|
// else if (entity.table_name == "agm_record_terminal_detail") {
|
// agm_record_terminal_detail_.push(entity)
|
// agm_record_terminal_detail_obj_[entity.field] = entity;
|
// }
|
})
|
me.record_fields = clone(agm_record_);
|
// me.record_detail_fields = clone(agm_record_detail_);
|
// me.record_terminal_detail_fields = clone(agm_record_terminal_detail_);
|
|
me.agm_record_obj = clone(agm_record_obj_);
|
// me.agm_record_detail_obj = clone(agm_record_detail_obj_);
|
// me.agm_record_terminal_detail_obj = clone(agm_record_terminal_detail_obj_);
|
|
me.setFormFields();
|
// me.setTableFields();
|
// me.setTableTerminalFields();
|
|
});
|
},
|
|
setFormFields() {
|
var me = this;
|
// var tableFields_ = [];
|
// this.tableFieldsAll.map(f=>{
|
// if (this.agm_record_obj[f.field]) {
|
// if (f.field == "terminal_province") {
|
// f.options = this.dataRequestObj.md_province
|
// f.props = {value: "name", label: "name"}
|
// }
|
|
// tableFields_.push(f);
|
// }
|
// })
|
|
var tableFields_ = [
|
{isshow: "T", field: "field0", name: "医院编码", width: "120", align: "center"},
|
{isshow: "T", field: "fieldhospital", name: "医院名称", type: "popup", width: "200", align: "left"},
|
{isshow: "T", field: "field6", name: "生效日期", type: "date", width: "150", align: "center"},
|
{isshow: "T", field: "field7", name: "失效日期", type: "date", width: "150", align: "center"},
|
{isshow: "T", field: "field8", name: "备注", width: "300", align: "left"},
|
{isshow: "T", field: "field9", name: "创建人", width: "100", align: "center"},
|
{isshow: "T", field: "field11", name: "创建日期", width: "150", align: "center", type: "date"},
|
{isshow: "T", field: "field12", name: "更新日期", width: "150", align: "center", type: "date"},
|
];
|
this.tableFields = clone(tableFields_);
|
|
this.$nextTick(function() {
|
this.$refs.table1.$refs.table1.doLayout();
|
})
|
},
|
|
// setTableFields() {
|
// var me = this;
|
// var tableFields_ = [];
|
// this.tableFieldsAll.map(f=>{
|
// if (this.agm_record_detail_obj[f.field]) {
|
// tableFields_.push(f);
|
// }
|
// })
|
|
// this.tableFields = clone(tableFields_);
|
// },
|
|
// setTableTerminalFields() {
|
// var me = this;
|
// var tableFields_ = [];
|
// this.tableTerminalFieldsAll.map(f=>{
|
// if (this.agm_record_terminal_detail_obj[f.field]) {
|
// tableFields_.push(f);
|
// }
|
// })
|
|
// this.tableTerminalFields = clone(tableFields_);
|
// },
|
|
submitRowTable() {
|
this.isCommit = true;
|
this.saveRowTable();
|
},
|
|
saveRowTable() {
|
var me = this;
|
|
var operator_ = "save";//保存
|
if(me.isCommit) {
|
operator_ = "commit";//提交
|
}
|
if (this.tableData.length) {
|
this.doSaveRowTable(operator_, this.tableData);
|
}
|
else {
|
Root.message({
|
type: 'warning',
|
message: '请先添加一条备案'
|
});
|
}
|
},
|
|
doSaveRowTable(operator_, datalist) {
|
var me = this;
|
var datalist_ = clone(datalist);
|
var entity_ = datalist_[0];
|
var entity = {};
|
var formdata_ = clone(this.formData);
|
|
for (var fr in formdata_) {
|
if (formdata_[fr]) {
|
entity[fr] = formdata_[fr];
|
}
|
}
|
|
for (var r in entity_) {
|
if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
let param = {
|
|
dataname: this.form_dataname,
|
// operator: operator_,
|
data: {},
|
}
|
param.data[this.form_dataname] = entity;
|
Server.call("root/data/saveEntity", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
datalist_.remove(entity_);
|
if (datalist_.length > 0) {
|
me.doSaveRowTable(operator_, datalist_);
|
return
|
}
|
|
if(me.isCommit){
|
me.isCommit = false;
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.saveAfter();
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
|
});
|
},
|
|
//原备案保存
|
saveRowTable_bak() {
|
var me = this;
|
|
var operator_ = "save";//保存
|
if(me.isCommit) {
|
operator_ = "commit";//提交
|
}
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
let param = {
|
|
dataname: this.form_dataname,
|
// operator: operator_,
|
data: {},
|
}
|
param.data[this.form_dataname] = entity;
|
// param.data[this.table_dataname] = tableData;
|
// param.data[this.table_dataname_terminal] = tableTerminaData;
|
|
Server.call("root/data/saveEntity", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
if(me.isCommit){
|
me.isCommit = false;
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.saveAfter();
|
// let param = {
|
//
|
// dataname: me.form_dataname,
|
// operator: "commit",
|
// id: result.data.id,
|
// //state: "working"//"commit"
|
// }
|
// Server.call("root/data/exec", param, function(result) {
|
// console.log(result);
|
|
// Root.message({
|
// type: 'success',
|
// message: '提交成功'
|
// });
|
// me.saveAfter();
|
// });
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
|
});
|
},
|
|
|
selectOptionOperate(obj) {
|
let me = this;
|
if (obj.type == "add") {
|
if (obj.fieldobj.field == "type_code") {
|
|
|
/* Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.customer_name = obj.row.md_description;
|
formData_.customer_code = obj.row.md_code;
|
formData_.customer_id = obj.row.id;
|
formData_.province_name = obj.row.province;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
}); */
|
}
|
}
|
|
},
|
|
formChange(obj) {
|
let me = this;
|
if (obj.fieldobj.field == "type_code") {
|
obj.data.type_name = clone(obj.selectoption.label);
|
}
|
|
},
|
|
selectChange(obj) {
|
let me = this;
|
if (obj.fieldobj.field == "type_code") {
|
obj.data.type_name = clone(obj.selectoption.label);
|
}
|
},
|
|
showPopup(obj) {
|
let me = this;
|
this.selectFormField = obj.obj;
|
if (this.selectFormField.field == "customer_name") {
|
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.customer_name = obj.row.md_description;
|
formData_.customer_code = obj.row.md_code;
|
formData_.customer_id = obj.row.id;
|
// formData_.province_name = obj.row.province;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
else if (this.selectFormField.field == "delivery_part_name") {
|
Root.showPopup({
|
url: "../org/company/popup/managesubject_list.html",
|
width: 800,
|
height: 550,
|
dataname:"getDelivery_part_name",
|
type :"managesubjectname",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.delivery_part_name = obj.row.delivery_part_name;
|
formData_.delivery_part_code = obj.row.delivery_part_code;
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
|
else if (this.selectFormField.field == "terminal_name") {
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.customer_name = obj.row.md_description;
|
formData_.customer_code = obj.row.md_code;
|
formData_.customer_id = obj.row.id;
|
// formData_.province_name = obj.row.province;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
else if (this.selectFormField.field == "product_name") {
|
Root.showPopup({
|
url: "../md/product/popup/sku_list.html",
|
width: 800,
|
height: 550,
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
|
formData_.product_id = obj.row.id;
|
formData_.product_code = obj.row.md_code;
|
formData_.product_name = obj.row.md_description;
|
//formData_.spec = obj.row.pack_specification;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
},
|
|
tablepopup_hospital(obj){
|
var me = this;
|
Root.showPopup({
|
icon: "icon-product",
|
text: "医院选择",
|
url: "module/md/page/customer/page/popup/hospital_list.html",
|
width: 800,
|
height: 550,
|
data: {},
|
sceneCode: "add",
|
callback: function(callbackobj, callback) {
|
// obj.row.product_id = callbackobj.row.id;
|
// obj.row.product_code = callbackobj.row.code;
|
// obj.row.product_name = callbackobj.row.name;
|
// obj.row.spec = callbackobj.row.spec;
|
// obj.row.pack = callbackobj.row.pack;
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
tablepopup_customerlist(obj) {
|
var me = this;
|
var filter_ = " type_code='Dealer' and state_code = 'Open'";
|
// if (me.orgobj.name) {
|
// filter_ = " name= '" + me.orgobj.name + "'";
|
// }
|
Root.showPopup({
|
icon: "icon-product",
|
text: "选择客户",
|
url: "module/agreement/page/popup_customer.html",
|
width: 800,
|
height: 550,
|
data: {},
|
sceneCode: "add",
|
filter: filter_,
|
callback: function(callbackobj, callback) {
|
console.log(me.formFields);
|
me.cname = "2";
|
var formFields_ = clone(me.formFields)
|
formFields_.map(e=>{
|
if(e.field == "field11"){
|
e.isshow = "T";
|
}
|
})
|
me.formFields = formFields_;
|
|
me.formData.customer_name = callbackobj.row.name;
|
me.formData.customer_code = callbackobj.row.code;
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
tablepopup_terminallist(obj) {
|
var me = this;
|
var filter_ = "type_code='Hospital'";
|
if (obj.row.area) {
|
filter_ += " and province='" + obj.row.area + "'";
|
}
|
Root.showPopup({
|
icon: "icon-product",
|
text: "选择终端",
|
url: "module/agreement/page/popup_customer.html",
|
width: 800,
|
height: 550,
|
data: {},
|
sceneCode: "add",
|
dataname: "md_customer",
|
filter: filter_,
|
callback: function(callbackobj, callback) {
|
obj.row.terminal_id = callbackobj.row.id
|
obj.row.terminal_name = callbackobj.row.name
|
obj.row.terminal_code = callbackobj.row.code
|
obj.row.terminal_province = callbackobj.row.province
|
obj.row.terminal_city = callbackobj.row.city
|
obj.row.terminal_type = callbackobj.row.type_name;
|
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
tablepopup_productlist(obj) {
|
var me = this;
|
Root.showPopup({
|
icon: "icon-product",
|
text: "选择SKU",
|
url: "module/agreement/page/popup_sku.html",
|
width: 800,
|
height: 550,
|
data: {},
|
sceneCode: "add",
|
callback: function(callbackobj, callback) {
|
obj.row.product_id = callbackobj.row.id;
|
obj.row.product_code = callbackobj.row.code;
|
obj.row.product_name = callbackobj.row.name;
|
obj.row.spec = callbackobj.row.spec;
|
obj.row.pack = callbackobj.row.pack;
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
addPriceDetail() {
|
let me = this;
|
var data_ = dateFormat(new Date(), "yyyy-MM-dd")
|
let row_ = {
|
product_name: "",
|
}
|
// let row_ = {
|
// code: createCode("BA"),
|
// versionno: "1",
|
// customer_code: "",
|
// customer_name: "",
|
// terminal_id: "",
|
// terminal_name: "",
|
// product_id: "",
|
// product_code: "",
|
// product_name: "",
|
// spec: "",
|
// pack: "",
|
// amt_target_year: "",
|
// qty_target_year:"",
|
// price_bidding_type: "",
|
// date_from: data_
|
// };
|
|
// if (me.orgobj.id) {
|
// row_.customer_id = me.orgobj.id;
|
// row_.customer_code = me.orgobj.code;
|
// row_.customer_name = me.orgobj.name;
|
// row_.area = me.orgobj.province;
|
// }
|
|
me.rowChange(row_, "add", "agm_record_price_detail");
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
Root.confirm('确定删除-' + row.product_name + '-吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.rowChange(row, "del", "agm_record_price_detail");
|
}).catch(() => {
|
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
rowChange(row, type, tablename) {
|
var me = this;
|
if (type == "add") {
|
if (tablename == "agm_record_price_detail") {
|
this.tableData.push(row);
|
}
|
else if (tablename == "agm_record_terminal_detail") {
|
this.tableTerminaData.push(row);
|
}
|
|
//this.computeForm();
|
}
|
else if (type == "del") {
|
if (row.id) {
|
let param = {
|
|
dataname: tablename,
|
id: row.id
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
if (tablename == "agm_record_price_detail") {
|
me.tableData.remove(row);
|
}
|
else if (tablename == "agm_record_terminal_detail") {
|
me.tableTerminaData.remove(row);
|
}
|
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
//me.computeForm();
|
}
|
});
|
|
}
|
else {
|
if (tablename == "agm_record_price_detail") {
|
this.tableData.remove(row);
|
}
|
else if (tablename == "agm_record_terminal_detail") {
|
this.tableTerminaData.remove(row);
|
}
|
|
//this.computeForm();
|
}
|
}
|
else {
|
//this.computeForm();
|
}
|
|
this.$nextTick(function() {
|
this.$refs.table1.$refs.table1.doLayout();
|
})
|
},
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
</head>
|
|
<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}} - {{formData.type_name}}</span>
|
</div>
|
</div>
|
|
<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
|
<!-- <div style="height: 550px; 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>
|
<div style="padding-left: 20px;">
|
<div style="width: 100%; display: inline-block; text-align: right;">
|
<el-button-group v-if="notdisabled">
|
<el-button :disabled="cname==1" @click="addPriceDetail">新增数据</el-button>
|
</el-button-group>
|
</div>
|
|
<h-table
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:is-within-edit-table-data= "isWithinEditTableData"
|
:table-height="tableHeight"
|
:is-pagination="false"
|
:is-show-index="true"
|
:edit-table-button="editTableButton"
|
:table-field-click="tablefieldClick"
|
|
v-on:del-data="delData"
|
>
|
</h-table>
|
</div>
|
</div>
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="notdisabled" type="primary" @click="saveRowTable":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button>
|
<el-button size="small" v-if="notdisabled" type="success" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button>
|
</div>
|
</div>
|
|
<el-dialog title="选择备案模板"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
:show-close="false"
|
:visible.sync="dialog_template" height="50%">
|
<el-select style="width: 100%;" v-model="value_template" @change="templateChange">
|
<el-option
|
v-for="item in options_category"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id">
|
</el-option>
|
</el-select>
|
<!-- <el-cascader style="width: 100%;" v-model="value_template"
|
:options="options_category"
|
:props="props_template"
|
:show-all-levels="false"
|
@change="templateChange"></el-cascader> -->
|
|
<div slot="footer" class="dialog-footer" >
|
<span v-if="value_template.length == 0" style="color: red; font-size: 10px; margin-right: 10px;">请先选择备案模板</span>
|
<el-button size="small" :disabled="value_template.length == 0" type="primary" @click="templateSave">确 定</el-button>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
</el-dialog>
|
</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>
|
</div>
|
|
</body>
|
</html>
|