<!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">
|
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
|
<title>字典编辑</title>
|
<script src="../../../js/vue/vue.js"></script>
|
<script src="../../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../../js/vue/page.js?v=20220615"></script>
|
<script src="../../../js/myelement.js?v=20220615"></script>
|
|
<link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../css/myelement.css?v=20220425" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../css/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_mkoo966o0uo.css" rel="stylesheet">
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" >
|
<div class="el-dialog_header header">
|
<div class="dialog-title title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{formAttr.title}} </span>
|
</div>
|
</div>
|
<div class="el-dialog_body" style="height: 340px;padding: 30px;">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
v-on:select-change="selectChange"
|
>
|
</h-form>
|
</div>
|
|
<div class="el-dialog_footer">
|
<el-button-group style="margin: 0px 20px;">
|
<el-button v-if="notdisabled" type="primary" @click="saveFormData">保 存</el-button>
|
</el-button-group>
|
<el-button type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
</div>
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;z-index: 9999;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
new ListVue({
|
el: "#vbody",
|
data: {
|
notdisabled: true,
|
formAttr: {
|
istitle: false,
|
title: "字典编辑",
|
columnnumber: 2,
|
labelwidth: "120px",
|
labelposition: "right",
|
size: "medium",
|
disabled: false,
|
border: "0px solid #c6c6c600"
|
},
|
formFields: [
|
{isshow: "T", field: "code", name: "发货主体编码", disabled: true,required:true},
|
{isshow: "T", field: "factory_code", name: "mdm编码"},
|
{isshow: "T", field: "name", name: "发货主体名称"},
|
{isshow: "T", field: "short_name", name: "药业"},
|
{isshow: "T", field: "book_no", name: "U8账套号"},
|
|
{isshow: "T", field: "sap", name: "是否sap",formatterjson:"{\"true\":\"是\",\"false\":\"否\"}", type: "select", options: dataRoot.database.boolean_type},
|
{isshow: "T", field: "organization_code", name: "sap组织编码"},
|
{isshow: "T", field: "channel", name: "sap连接编码"},
|
{isshow: "T", field: "product_group_code", name: "sap产品组编码"},
|
|
{isshow: "T", field: "fw_code", name: "销管编码"},
|
{isshow: "T", field: "revocation_address", name: "退货地址", width: "200"},
|
{isshow: "T", field: "address", name: "地址", align: "left", width: "250"},
|
|
{isshow: "T", field: "bank_name", name: "银行", align: "left", width: "250",defaultval:""},
|
{isshow: "T", field: "bank_no", name: "卡号", width: "200",defaultval:""},
|
{isshow: "T", field: "phone", name: "电话",defaultval:""},
|
{isshow: "T", field: "uscc", name: "USCC", width: "200",defaultval:""},
|
|
|
{isshow: "T", field: "only_open", name: "是否开启", width: "80",formatterjson:"{\"true\":\"是\",\"false\":\"否\"}", type: "select", options: dataRoot.database.boolean_type},
|
{isshow: "T", field: "only_sales", name: "是否销售", width: "80" ,formatterjson:"{\"true\":\"是\",\"false\":\"否\"}", type: "select", options: dataRoot.database.boolean_type},
|
{isshow: "T", field: "is_poxy", name: "是否代理", width: "80" ,formatterjson:"{\"true\":\"是\",\"false\":\"否\"}", type: "select", options: dataRoot.database.boolean_type},
|
{isshow: "T", field: "approve_node", name: "是否新增产品", width: "130" ,formatterjson:"{\"true\":\"是\",\"false\":\"否\"}", type: "select", options: dataRoot.database.boolean_type},
|
{isshow: "T", field: "has_gsp", name: "是否gsp证书", width: "130" ,formatterjson:"{\"true\":\"是\",\"false\":\"否\"}", type: "select", options: dataRoot.database.boolean_type},
|
],
|
authorize: {
|
edit: true,
|
},
|
tableFields: [],
|
|
tableData: [],
|
selectrow: {},
|
dataname: "delivery_message",
|
linkdataname: "",
|
|
tableHeight2: 320,
|
isEditTableData:true,
|
isWithinEditTableData:false,
|
formData: {},
|
isRefresh: true,
|
selectFormField: {},
|
|
pagesize: 10,
|
pagenum: 1,
|
total: 0,
|
},
|
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
|
if (this.popupParames.delta) {
|
if (this.popupParames.delta.type == "1") { //发货主体
|
|
}
|
if (this.popupParames.delta.type == "2") { //字典
|
this.dataname = "dict_message"
|
this.formAttr.columnnumber = 1
|
this.formFields = [
|
{isshow: "T", field: "code", name: "编码", disabled: true},
|
{isshow: "T", field: "value", name: "显示名称"},
|
{isshow: "T", field: "name", name: "上级名称", type: "select", options: [], props: {value: "name", label: "name", checkStrictly: true}, disabled: true},
|
{isshow: "T", field: "parent_id", name: "上级ID", disabled: true},
|
]
|
|
this.getOptions();
|
}
|
if (this.popupParames.delta.type == "3") { //业务部门
|
this.dataname = "department"
|
this.formAttr.columnnumber = 1
|
this.formFields = [
|
{isshow: "T", field: "code", name: "编码", width: "200"},
|
{isshow: "T", field: "name", name: "名称", align: "left"},
|
{isshow: "T", field: "line_type", name: "业务类型", align: "left"},
|
]
|
}
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {
|
this.formFields.map(e => {
|
if (e.field == "code" || e.field == "name" || e.field == "delivery_part_code") {
|
e.disabled = false
|
}
|
})
|
}
|
if (this.popupParames.sceneCode == "edit") {
|
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
document.getElementById('page_root').style.display = "block";
|
document.getElementById('page_loading').style.display = "none";
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
document.getElementById('page_root').classList.add("z_popup-page");
|
let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
getOptions() {
|
let me = this
|
|
let parames = {
|
isClientMode: false,
|
dataname: "dict_message",
|
}
|
|
Server.call("root/data/getEntitySet", parames, function(result) {
|
console.log(result)
|
if (result.data && result.data.entityset) {
|
let data = result.data.entityset
|
|
let arr = []
|
data.map(e => {
|
let list = {}
|
list.name = e.name
|
list.id = e.parent_id
|
|
arr.push(list)
|
})
|
|
for (let i = 0; i < arr.length; i++) {
|
for (let j = i+1; j < arr.length; j++) {
|
if (arr[i].id == arr[j].id) {
|
arr.splice(j, 1)
|
j--
|
}
|
}
|
}
|
|
let formFields = clone(me.formFields)
|
|
formFields.map(e => {
|
if (e.field == "name") {
|
e.options = arr
|
}
|
})
|
|
me.formFields = clone(formFields)
|
}
|
})
|
},
|
|
selectChange(obj){
|
if(obj.fieldobj.field == "name") {
|
let formData_ = clone(this.formData);
|
obj.fieldobj.options.map(e => {
|
if (e.name == obj.data.name) {
|
formData_.parent_id = e.id
|
}
|
})
|
this.formData = formData_;
|
}
|
},
|
|
closeDialog() {
|
let me = this;
|
if(this.popupParames.totab) {
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, true);
|
}else {
|
Root.hidePopup();
|
}
|
},
|
onServerInitData(data) {
|
|
},
|
|
saveFormData() {
|
let me = this
|
|
let parames = this.formData
|
parames.isClientMode = false
|
parames.dataName = this.dataname
|
if (this.popupParames.delta.type == "1") { //发货主体
|
Server.call("root/popedom/insertOrUpdateDelivery", parames, function(result) {
|
console.log(result);
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
})
|
|
me.saveRowTable();
|
}
|
});
|
}else(
|
Server.call("root/data/saveEntity", parames, function(result) {
|
console.log(result);
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
})
|
|
me.saveRowTable();
|
}
|
})
|
)
|
},
|
|
saveRowTable() {
|
if(this.popupParames.callback) {
|
let obj = {
|
row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
Root.hidePopup();
|
});
|
}
|
else {
|
alert("该按键事件缺失!")
|
}
|
},
|
}
|
});
|
</script>
|
|
<style>
|
.el-input__inner{
|
padding: 0 2px;
|
}
|
.title {
|
position: absolute;
|
top: 10px;
|
left: 24px;
|
height: 30px;
|
z-index: 11;
|
}
|
.header {
|
height: 21px;
|
}
|
.el-dialog__header {
|
border-bottom: 0;
|
}
|
.el-dialog__body {
|
text-align: center;
|
/* height: 200px; */
|
}
|
</style>
|
|
</body>
|
</html>
|