|
@@ -573,6 +573,34 @@ Vue.component('keep-component', {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+function checkRequiredKeys (keys, target) {
|
|
|
+ try {
|
|
|
+ // 职位/部门特殊处理, 满足时移除部门校验
|
|
|
+ if (keys.indexOf('branch') !== -1 && keys.indexOf('position') !== -1) {
|
|
|
+ if (target['position'] === '总裁' || target['position'] === '总经理') {
|
|
|
+ keys.splice(keys.indexOf('branch'), 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return !keys.some(function (k) {
|
|
|
+ var tempValue = target[k]
|
|
|
+ var result = false
|
|
|
+ if (typeof tempValue === 'number') {
|
|
|
+ tempValue = tempValue.toString()
|
|
|
+ }
|
|
|
+ if (typeof tempValue === 'string') {
|
|
|
+ result = tempValue.trim() !== ''
|
|
|
+ }
|
|
|
+ if (typeof tempValue === 'boolean') {
|
|
|
+ result = true
|
|
|
+ }
|
|
|
+ return !result
|
|
|
+ })
|
|
|
+ } catch (e) {
|
|
|
+ console.warn(e)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 检查返回是否需要继续下一步
|
|
|
function checkBackSuccess () {
|
|
|
var isBackSuccess = sessionStorage.getItem('salesBackStatus') || false
|