Explorar o código

Merge branch 'feature/relation_type_item' of http://47.101.143.145:8090/77975466/pco into feature/relation_type_item

qzyReal %!s(int64=2) %!d(string=hai) anos
pai
achega
d850a1c78a
Modificáronse 1 ficheiros con 19 adicións e 0 borrados
  1. 19 0
      sp-admin/sa-view/tb-costomer/tb-costomer-add.html

+ 19 - 0
sp-admin/sa-view/tb-costomer/tb-costomer-add.html

@@ -39,6 +39,14 @@
 							<sa-item type="text" name="联系人" v-model="m.dutyPeople" placeholder="请输入联系人" br></sa-item>
 							<sa-item type="text" name="联系电话" v-model="m.phone" placeholder="请输入联系号码" br></sa-item>
 							<div class="c-item">
+								<label class="c-label">业务项:</label>
+								<el-select v-model="businessType" multiple :disabled="currentCustomerId!=='1'">
+									<el-option v-for="good in goodsList" :key="good.id"
+											   :label="good.name" :value="good.id">
+									</el-option>
+								</el-select>
+							</div>
+							<div class="c-item">
 								<label class="c-label">结算类型:</label>
 								<el-radio-group v-model="m.payType">
 									<el-radio :label="1" :disabled="currentCustomerId!=='1'">现结</el-radio>
@@ -70,8 +78,15 @@
 					m: null, // 实体对象 
 					options: [],
 					currentCustomerId: '1',
+					businessType: [],
+					goodsList: [],
 				},
 				methods: {
+					getGoodsList(){
+						sa.ajax('/TbGoods/getList', function(resp) {
+							this.goodsList = resp.data;
+						}.bind(this));
+					},
 					getCurrendCustomer() {
 						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
 							this.currentCustomerId = resp.data;
@@ -96,6 +111,8 @@
 					ok: function() {
 						// 表单校验 
 						let m = this.m;
+						m.businessType = this.businessType.join(",");
+						sa.checkNull(m.businessType, '请选择 [业务项]');
 						sa.checkNull(m.name, '请输入 [企业名称]');
 						if (!sa.isPhone(m.phone)) {
 							sa.error('联系号码不正确')
@@ -127,12 +144,14 @@
 				},
 				mounted: function() {
 					this.getCurrendCustomer()
+					this.getGoodsList();
 					// 初始化数据 
 					if (this.id <= 0) {
 						this.m = this.createModel();
 					} else {
 						sa.ajax('/TbCostomer/getById?id=' + this.id, function(res) {
 							this.m = res.data;
+							this.businessType = this.m.businessType.split(',')
 							this.m.address_arry = res.data ? res.data.addressIds.split(",").map(id =>
 								parseInt(id)) : [];
 							if (res.data == null) {