|  |  | @ -1,46 +1,46 @@ | 
			
		
	
		
			
				
					|  |  |  | <template> | 
			
		
	
		
			
				
					|  |  |  |   <el-dialog | 
			
		
	
		
			
				
					|  |  |  |     :visible.sync="visible" | 
			
		
	
		
			
				
					|  |  |  |   <el-dialog :visible.sync="visible" | 
			
		
	
		
			
				
					|  |  |  |              :title="'编辑外部应用'" | 
			
		
	
		
			
				
					|  |  |  |              :close-on-click-modal="false" | 
			
		
	
		
			
				
					|  |  |  |              :before-close="handleClose" | 
			
		
	
		
			
				
					|  |  |  |     :close-on-press-escape="false" | 
			
		
	
		
			
				
					|  |  |  |   > | 
			
		
	
		
			
				
					|  |  |  |     <el-form | 
			
		
	
		
			
				
					|  |  |  |       :inline="true" | 
			
		
	
		
			
				
					|  |  |  |              :close-on-press-escape="false"> | 
			
		
	
		
			
				
					|  |  |  |     <el-form :inline="true" | 
			
		
	
		
			
				
					|  |  |  |              :model="dataForm" | 
			
		
	
		
			
				
					|  |  |  |              :rules="dataRule" | 
			
		
	
		
			
				
					|  |  |  |              ref="dataForm" | 
			
		
	
		
			
				
					|  |  |  |       :label-width="'120px'" | 
			
		
	
		
			
				
					|  |  |  |     > | 
			
		
	
		
			
				
					|  |  |  |       <el-form-item label="应用名称" prop="appName"> | 
			
		
	
		
			
				
					|  |  |  |         <el-input | 
			
		
	
		
			
				
					|  |  |  |           class="item_width_1" | 
			
		
	
		
			
				
					|  |  |  |              :label-width="'120px'"> | 
			
		
	
		
			
				
					|  |  |  |       <el-form-item label="应用名称" | 
			
		
	
		
			
				
					|  |  |  |                     prop="appName"> | 
			
		
	
		
			
				
					|  |  |  |         <el-input class="item_width_1" | 
			
		
	
		
			
				
					|  |  |  |                   v-model="dataForm.appName" | 
			
		
	
		
			
				
					|  |  |  |           placeholder="应用名称" | 
			
		
	
		
			
				
					|  |  |  |         ></el-input> | 
			
		
	
		
			
				
					|  |  |  |                   placeholder="应用名称"></el-input> | 
			
		
	
		
			
				
					|  |  |  |       </el-form-item> | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |       <el-form-item label="所属客户" prop="customerId"> | 
			
		
	
		
			
				
					|  |  |  |         <el-select | 
			
		
	
		
			
				
					|  |  |  |           class="item_width_1" | 
			
		
	
		
			
				
					|  |  |  |       <el-form-item label="所属客户" | 
			
		
	
		
			
				
					|  |  |  |                     prop="customerId"> | 
			
		
	
		
			
				
					|  |  |  |         <div> | 
			
		
	
		
			
				
					|  |  |  |           <el-radio-group v-model="dataForm.customerType" | 
			
		
	
		
			
				
					|  |  |  |                           @change="onSelectedCustomerTypeChange"> | 
			
		
	
		
			
				
					|  |  |  |             <el-radio label="external">外部客户</el-radio> | 
			
		
	
		
			
				
					|  |  |  |             <el-radio label="internal">内部客户</el-radio> | 
			
		
	
		
			
				
					|  |  |  |           </el-radio-group> | 
			
		
	
		
			
				
					|  |  |  |         </div> | 
			
		
	
		
			
				
					|  |  |  |         <el-select class="item_width_1" | 
			
		
	
		
			
				
					|  |  |  |                    v-model="dataForm.customerId" | 
			
		
	
		
			
				
					|  |  |  |                    placeholder="请选择" | 
			
		
	
		
			
				
					|  |  |  |           clearable | 
			
		
	
		
			
				
					|  |  |  |         > | 
			
		
	
		
			
				
					|  |  |  |           <el-option | 
			
		
	
		
			
				
					|  |  |  |             v-for="item in customerList" | 
			
		
	
		
			
				
					|  |  |  |                    clearable> | 
			
		
	
		
			
				
					|  |  |  |           <el-option v-for="item in customerList" | 
			
		
	
		
			
				
					|  |  |  |                      :key="item.customerId" | 
			
		
	
		
			
				
					|  |  |  |                      :label="item.customerName" | 
			
		
	
		
			
				
					|  |  |  |             :value="item.customerId" | 
			
		
	
		
			
				
					|  |  |  |           > | 
			
		
	
		
			
				
					|  |  |  |                      :value="item.customerId"> | 
			
		
	
		
			
				
					|  |  |  |           </el-option> | 
			
		
	
		
			
				
					|  |  |  |         </el-select> | 
			
		
	
		
			
				
					|  |  |  |       </el-form-item> | 
			
		
	
		
			
				
					|  |  |  |     </el-form> | 
			
		
	
		
			
				
					|  |  |  |     <template slot="footer"> | 
			
		
	
		
			
				
					|  |  |  |       <el-button @click="visible = false">{{ $t("cancel") }}</el-button> | 
			
		
	
		
			
				
					|  |  |  |       <el-button type="primary" @click="saveForm()">{{ | 
			
		
	
		
			
				
					|  |  |  |       <el-button type="primary" | 
			
		
	
		
			
				
					|  |  |  |                  @click="saveForm()">{{ | 
			
		
	
		
			
				
					|  |  |  |         $t("confirm") | 
			
		
	
		
			
				
					|  |  |  |       }}</el-button> | 
			
		
	
		
			
				
					|  |  |  |     </template> | 
			
		
	
	
		
			
				
					|  |  | @ -58,7 +58,7 @@ const requestUrlPrefix = isMockEnv ? mockUrlPrefix : ""; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | let loading; // 加载动画 | 
			
		
	
		
			
				
					|  |  |  | export default { | 
			
		
	
		
			
				
					|  |  |  |   data() { | 
			
		
	
		
			
				
					|  |  |  |   data () { | 
			
		
	
		
			
				
					|  |  |  |     return { | 
			
		
	
		
			
				
					|  |  |  |       visible: false, | 
			
		
	
		
			
				
					|  |  |  |       type: "", // 操作类型A/U | 
			
		
	
	
		
			
				
					|  |  | @ -67,6 +67,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         appName: "", | 
			
		
	
		
			
				
					|  |  |  |         customerId: "", | 
			
		
	
		
			
				
					|  |  |  |         customerName: "", | 
			
		
	
		
			
				
					|  |  |  |         customerType: "internal", | 
			
		
	
		
			
				
					|  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |       customerList: [ | 
			
		
	
		
			
				
					|  |  |  |         // { | 
			
		
	
	
		
			
				
					|  |  | @ -76,11 +77,11 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |       ], | 
			
		
	
		
			
				
					|  |  |  |     }; | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   created() { | 
			
		
	
		
			
				
					|  |  |  |   mounted () { | 
			
		
	
		
			
				
					|  |  |  |     this.queryCustomerList(); | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   computed: { | 
			
		
	
		
			
				
					|  |  |  |     dataRule() { | 
			
		
	
		
			
				
					|  |  |  |     dataRule () { | 
			
		
	
		
			
				
					|  |  |  |       return { | 
			
		
	
		
			
				
					|  |  |  |         customerId: [ | 
			
		
	
		
			
				
					|  |  |  |           { | 
			
		
	
	
		
			
				
					|  |  | @ -100,7 +101,16 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   methods: { | 
			
		
	
		
			
				
					|  |  |  |     async queryCustomerList() { | 
			
		
	
		
			
				
					|  |  |  |     async queryCustomerList () { | 
			
		
	
		
			
				
					|  |  |  |       if (this.dataForm.customerType === 'external') { | 
			
		
	
		
			
				
					|  |  |  |         this.queryExternalCustomerList(); | 
			
		
	
		
			
				
					|  |  |  |       } else { | 
			
		
	
		
			
				
					|  |  |  |         this.queryInternalCustomerList(); | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 加载外部客户列表 | 
			
		
	
		
			
				
					|  |  |  |     async queryExternalCustomerList () { | 
			
		
	
		
			
				
					|  |  |  |       debugger | 
			
		
	
		
			
				
					|  |  |  |       const { data, code, msg } = await requestPost( | 
			
		
	
		
			
				
					|  |  |  |         requestUrlPrefix + "/commonservice/externalcustomer/list", | 
			
		
	
		
			
				
					|  |  |  |         { | 
			
		
	
	
		
			
				
					|  |  | @ -108,27 +118,47 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |           pageSize: 1000, | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       ); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |       if (code === 0) { | 
			
		
	
		
			
				
					|  |  |  |         this.customerList = data.list; | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     init(dataForm, type) { | 
			
		
	
		
			
				
					|  |  |  |     // 加载内部客户列表 | 
			
		
	
		
			
				
					|  |  |  |     queryInternalCustomerList () { | 
			
		
	
		
			
				
					|  |  |  |       window.app.ajax.get( | 
			
		
	
		
			
				
					|  |  |  |         "/oper/crm/customer/getvalidcustomerlist", | 
			
		
	
		
			
				
					|  |  |  |         {}, | 
			
		
	
		
			
				
					|  |  |  |         (data, rspMsg) => { | 
			
		
	
		
			
				
					|  |  |  |           this.customerList = data; | 
			
		
	
		
			
				
					|  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |         (rspMsg, data) => { | 
			
		
	
		
			
				
					|  |  |  |           this.$message.error(rspMsg) | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       ) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 客户类型单选框变化 | 
			
		
	
		
			
				
					|  |  |  |     onSelectedCustomerTypeChange (value) { | 
			
		
	
		
			
				
					|  |  |  |       this.dataForm.customerType = value; | 
			
		
	
		
			
				
					|  |  |  |       this.queryCustomerList(); | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     init (dataForm, type) { | 
			
		
	
		
			
				
					|  |  |  |       this.type = type; | 
			
		
	
		
			
				
					|  |  |  |       this.visible = true; | 
			
		
	
		
			
				
					|  |  |  |       // this.dataForm=dataForm | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |       this.$nextTick(() => { | 
			
		
	
		
			
				
					|  |  |  |         Object.assign(this.dataForm, dataForm); | 
			
		
	
		
			
				
					|  |  |  |         this.queryCustomerList(); | 
			
		
	
		
			
				
					|  |  |  |       }); | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     addRequest() { | 
			
		
	
		
			
				
					|  |  |  |     addRequest () { | 
			
		
	
		
			
				
					|  |  |  |       this.dataForm.domainNameList.push(""); | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     delRequest(index) { | 
			
		
	
		
			
				
					|  |  |  |     delRequest (index) { | 
			
		
	
		
			
				
					|  |  |  |       this.dataForm.domainNameList.splice(index, 1); | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     saveForm() { | 
			
		
	
		
			
				
					|  |  |  |     saveForm () { | 
			
		
	
		
			
				
					|  |  |  |       this.$refs["dataForm"].validate((valid) => { | 
			
		
	
		
			
				
					|  |  |  |         if (!valid) { | 
			
		
	
		
			
				
					|  |  |  |           this.$message.error("表单验证失败!"); | 
			
		
	
	
		
			
				
					|  |  | @ -159,12 +189,12 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       }); | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     handleClose() { | 
			
		
	
		
			
				
					|  |  |  |     handleClose () { | 
			
		
	
		
			
				
					|  |  |  |       this.visible = false; | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     // 开启加载动画 | 
			
		
	
		
			
				
					|  |  |  |     startLoading() { | 
			
		
	
		
			
				
					|  |  |  |     startLoading () { | 
			
		
	
		
			
				
					|  |  |  |       loading = Loading.service({ | 
			
		
	
		
			
				
					|  |  |  |         lock: true, // 是否锁定 | 
			
		
	
		
			
				
					|  |  |  |         text: "正在加载……", // 加载中需要显示的文字 | 
			
		
	
	
		
			
				
					|  |  | @ -172,7 +202,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |       }); | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 结束加载动画 | 
			
		
	
		
			
				
					|  |  |  |     endLoading() { | 
			
		
	
		
			
				
					|  |  |  |     endLoading () { | 
			
		
	
		
			
				
					|  |  |  |       // clearTimeout(timer); | 
			
		
	
		
			
				
					|  |  |  |       if (loading) { | 
			
		
	
		
			
				
					|  |  |  |         loading.close(); | 
			
		
	
	
		
			
				
					|  |  | 
 |