|
|
@@ -6,23 +6,20 @@ window.$swEvent.setup("bpm.sys.user.area.area", { |
|
|
|
setup(page) { |
|
|
|
const {$params, $refs, $widgets, $model, $utils, $tabRouter, $api} = page || {}; |
|
|
|
const {$$message, $$http} = $utils || {}; |
|
|
|
const custom = {}; |
|
|
|
const typeMap = {2: 105100, 4: 105101, 6: 105102, 9: 105103, 12: 105104}; |
|
|
|
// |
|
|
|
const focusName = () => { |
|
|
|
custom.name = $model.areacard.getFormVal("ar_name"); |
|
|
|
|
|
|
|
}; |
|
|
|
const changeName = (value) => { |
|
|
|
if ($model.areacard.getFormVal("ar_full_name") === custom.name) |
|
|
|
$model.areacard.setFormVal("ar_full_name", value); |
|
|
|
$model.areacard.setFormVal("ar_full_name", value); |
|
|
|
}; |
|
|
|
|
|
|
|
const focusCode = () => { |
|
|
|
custom.code = $model.areacard.getFormVal("ar_code"); |
|
|
|
|
|
|
|
}; |
|
|
|
const changeCode = (value) => { |
|
|
|
if ($model.areacard.getFormVal("ar_seq") === custom.code) |
|
|
|
$model.areacard.setFormVal("ar_seq", value); |
|
|
|
$model.areacard.setFormVal("ar_seq", value); |
|
|
|
//根据编码长度设置区划级别 |
|
|
|
$model.areacard.setFormVal("ar_type", typeMap[value.length]); |
|
|
|
$model.areacard.setFormVal("ar_parent_id", getParentArea(value)); |
|
|
@@ -42,6 +39,9 @@ window.$swEvent.setup("bpm.sys.user.area.area", { |
|
|
|
if (value.length == 4) { |
|
|
|
return value.substring(0, 2); |
|
|
|
} |
|
|
|
if (value.length == 2) { |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
return { |
|
|
|
focusName, changeName, focusCode, changeCode |
|
|
|