Browse Source

新增采购商优化

qzy 7 months ago
parent
commit
53a1fdfed1
3 changed files with 80 additions and 70 deletions
  1. 2 12
      sa-view/tb-people/tb-people-list.html
  2. 77 57
      sa-view/tb-purchaser/tb-purchaser-add.html
  3. 1 1
      static/sa.js

+ 2 - 12
sa-view/tb-people/tb-people-list.html

@@ -60,25 +60,15 @@
 					<sa-td name="互助组名称" prop="groupName"></sa-td>
 					<sa-td name="互市区" prop="tradeAreaName"></sa-td>
 					<sa-td name="场所编码" prop="fieldCode"></sa-td>
-					<sa-td name="所属商铺" prop="shopName" width="200">
-						<template slot-scope="s">
-							<div>{{s.row.shopName}}
-								<el-link v-if="sa.isAuth('tb-people-bind-shop')&&s.row.shopName" type="primary"
-									@click="removeBind(s.row)" style="font-size: 12px;">(解绑)</el-link>
-							</div>
-							<el-link v-if="sa.isAuth('tb-people-bind-shop')&&!s.row.shopName" type="primary"
-								@click="selectShop(s.row)">选择</el-link>
-						</template>
-					</sa-td>
 					<sa-td name="创建时间" prop="createTime"></sa-td>
 					<el-table-column label="操作" width="260px" fixed="right">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success" icon="el-icon-view"
 								@click="get(s.row)">查看</el-button>
 							<el-button class="c-btn" type="primary" icon="el-icon-edit"
-								@click="editFn(s.row)">修改手机</el-button>
+								@click="editFn(s.row)">手机</el-button>
 							<el-button class="c-btn" type="primary" icon="el-icon-edit"
-								@click="updateBankInfo(s.row.id)">银行卡修改</el-button>
+								@click="updateBankInfo(s.row.id)">银行卡</el-button>
 						</template>
 					</el-table-column>
 				</el-table>

+ 77 - 57
sa-view/tb-purchaser/tb-purchaser-add.html

@@ -3,7 +3,8 @@
 	<head>
 		<title>收购商-添加/修改</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 		<!-- 所有的 css js 资源 -->
 		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
@@ -15,27 +16,36 @@
 		<script src="../../static/sa.js"></script>
 		<script src="../../static/kj/upload-util.js"></script>
 		<style type="text/css">
-			.c-panel .el-form .c-label{width: 7em !important;}
-			.c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+
 			table {
-			  font-family: arial, sans-serif;
-			  border-collapse: collapse;
-			  width: 90%;
-			  margin-top: 22px ;
-			  margin-left: auto;
-			  margin-right: auto;
+				font-family: arial, sans-serif;
+				border-collapse: collapse;
+				width: 90%;
+				margin-top: 22px;
+				margin-left: auto;
+				margin-right: auto;
 			}
+
 			th {
-			  border: 1px solid darkgray;
-			  text-align: left;
-			  height: 22px;
-			  padding: 8px;
-			  background-color: #dddddd;
+				border: 1px solid darkgray;
+				text-align: left;
+				height: 22px;
+				padding: 8px;
+				background-color: #dddddd;
 			}
+
 			td {
-			  border: 1px solid darkgray;
-			  text-align: left;
-			  padding: 8px;
+				border: 1px solid darkgray;
+				text-align: left;
+				padding: 8px;
 			}
 		</style>
 	</head>
@@ -44,7 +54,7 @@
 			<!-- ------- 内容部分 ------- -->
 			<div class="s-body">
 				<div class="c-panel">
-                    <div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-if="id == 0">数据添加</div>
 					<div class="c-title" v-else>数据修改</div>
 					<el-form v-if="m">
 						<table>
@@ -79,22 +89,25 @@
 								</td>
 							</tr>
 							<tr>
-								<th>银行账号</th>
+								<th>银行名称</th>
 								<td>
-									<el-input type="text" v-model="m.bankAccount" placeholder="请输入银行账号"></el-input>
+									<el-select v-model="m.bankName" placeholder="请选择" filterable size="mini">
+										<el-option v-for="(item,index) in banckList" :key="index" :label="item.name"
+											:value="item.value"> </el-option>
+									</el-select>
 								</td>
-								<th>银行名称</th>
+								<th>银行账号</th>
 								<td>
-									<el-input type="text" v-model="m.bankName" placeholder="请输入银行名称"></el-input>
+									<el-input type="text" v-model="m.bankAccount" placeholder="请输入银行账号"></el-input>
 								</td>
+
 							</tr>
 							<tr>
 								<th>地址</th>
-								<td>
-									<el-input type="text" v-model="m.address" placeholder="请输入地址"></el-input>
+								<td colspan="3">
+									<el-input type="text" v-model="m.address"  placeholder="请输入地址"></el-input>
 								</td>
-								<th>提交时间</th>
-								<td>{{sa.forDate(m.createTime, 2)}}</td>
+						
 							</tr>
 						</table>
 						<sa-item name="" class="s-ok" br>
@@ -109,87 +122,94 @@
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
 		</div>
-        <script>
-
+		<script>
 			var app = new Vue({
 				components: {
 					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
 				},
 				el: '.vue-box',
 				data: {
-					id: sa.p('id', 0),		// 获取超链接中的id参数(0=添加,非0=修改)
-					m: null,		// 实体对象
+					banckList: [{
+						name: '麻栗坡农商银行',
+						value: '麻栗坡农商银行'
+					}],
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
+					m: null, // 实体对象
 				},
 				methods: {
+
 					// 创建一个 默认Model
 					createModel: function() {
 						return {
-							name: '',		// 名称
-							legalPerson: '',		// 法人
-							idCard: '',		// 身份证号
-							contact: '',		// 手机号码
-							businessLicense: '',		// 营业执照
-							bankNo: '',		// 银行编号
-							bankName: '',		// 银行名称
-							bankAccount: '',		// 银行账号
-							dutyParagraph: '',		// 税号
-							addressIds: '',		// 地址编号
-							address: '',		// 地址
+							name: '', // 名称
+							legalPerson: '', // 法人
+							idCard: '', // 身份证号
+							contact: '', // 手机号码
+							businessLicense: '', // 营业执照
+							bankNo: '', // 银行编号
+							bankName: '麻栗坡农商银行', // 银行名称
+							bankAccount: '', // 银行账号
+							dutyParagraph: '', // 税号
+							addressIds: '', // 地址编号
+							address: '', // 地址
 							// judgeStatus: '',		// 审核状态(0=未通过,1=已通过)
 							// judgeContent: '',		// 审核意见
 							// judgeTime: '',		// 上次审核时间
-							personId: '',		// 人脸编号
+							personId: '', // 人脸编号
 							// deleteStatus: '',		// 删除状态(0=禁用,1=启用)
 						}
 					},
 					// 提交数据
-					ok: function(){
+					ok: function() {
 						// 表单校验
 						let m = this.m;
 						sa.checkNull(m.name, '请输入 [名称]');
 						sa.checkNull(m.legalPerson, '请输入 [法人]');
 						sa.checkNull(m.idCard, '请输入 [身份证号]');
-						sa.checkNull(m.contact, '请输入 [手机号码]');
-						sa.checkNull(m.businessLicense, '请输入 [营业执照]');
+						let contact = m.contact;
+						if (!sa.isPhone(contact)) {
+							sa.error('手机号不正确');
+							return;
+						}
+						sa.checkNull(m.businessLicense, '请上传 [营业执照]');
 						sa.checkNull(m.bankName, '请输入 [银行名称]');
 						sa.checkNull(m.bankAccount, '请输入 [银行账号]');
 						sa.checkNull(m.dutyParagraph, '请输入 [税号]');
 						// 开始增加或修改
-						if(this.id <= 0) {	// 添加
-							sa.ajax('/level-two-server/TbPurchaser/add', m, function(res){
+						if (this.id <= 0) { // 添加
+							sa.ajax('/level-two-server/TbPurchaser/add', m, function(res) {
 								sa.alert('增加成功', this.clean);
 							}.bind(this));
-						} else {	// 修改
-							sa.ajax('/level-two-server/TbPurchaser/update', m, function(res){
+						} else { // 修改
+							sa.ajax('/level-two-server/TbPurchaser/update', m, function(res) {
 								sa.alert('修改成功', this.clean);
 							}.bind(this));
 						}
 					},
 					// 添加/修改 完成后的动作
 					clean: function() {
-						if(this.id == 0) {
+						if (this.id == 0) {
 							this.m = this.createModel();
 						} else {
-							parent.app.f5();		// 刷新父页面列表
-							sa.closeCurrIframe();	// 关闭本页
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页
 						}
 					}
 				},
-				mounted: function(){
+				mounted: function() {
 					// 初始化数据
-					if(this.id <= 0) {
+					if (this.id <= 0) {
 						this.m = this.createModel();
 					} else {
 						sa.ajax('/level-two-server/TbPurchaser/getById?id=' + this.id, function(res) {
 							this.m = res.data;
-							if(res.data == null) {
+							if (res.data == null) {
 								sa.alert('未能查找到 id=' + this.id + " 详细数据");
 							}
 						}.bind(this))
 					}
 				}
 			})
-
 		</script>
 	</body>
-</html>
+</html>

+ 1 - 1
static/sa.js

@@ -9,7 +9,7 @@ var sa = {
 (function() {
 	// 公司开发环境
 	var cfg_dev = {
-		 api_url: 'http://127.0.0.1:8080', // 所有ajax请求接口父地址
+		 api_url: 'http://192.168.3.15:8080', // 所有ajax请求接口父地址
 		web_url: 'http://www.baidu.com' // 此项目前台地址 (此配置项非必须)
 	}
 	// 服务器测试环境