tb-people-tax-account-add.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>边民-税务开户信息-添加/修改</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <style type="text/css">
  17. .c-panel .el-form .c-label{width: 7em !important;}
  18. .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
  19. table {
  20. font-family: arial, sans-serif;
  21. border-collapse: collapse;
  22. width: 90%;
  23. margin-top: 22px;
  24. margin-left: auto;
  25. margin-right: auto;
  26. }
  27. th {
  28. border: 1px solid darkgray;
  29. text-align: left;
  30. height: 22px;
  31. padding: 8px;
  32. background-color: #dddddd;
  33. }
  34. td {
  35. border: 1px solid darkgray;
  36. text-align: left;
  37. padding: 8px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
  43. <!-- ------- 内容部分 ------- -->
  44. <div class="s-body">
  45. <div class="c-panel">
  46. <div class="c-title" v-if="id == 0">数据添加</div>
  47. <div class="c-title" v-else>数据修改</div>
  48. <el-form v-if="m">
  49. <table>
  50. <tr>
  51. <th>经营者</th>
  52. <td>{{m.name}}</td>
  53. <th>身份证</th>
  54. <td>{{m.idCard}}</td>
  55. </tr>
  56. <tr>
  57. <th>名称</th>
  58. <td>
  59. <el-input type="text" v-model="m.businessName" placeholder="请输入名称"></el-input>
  60. </td>
  61. <th>社会统一信用代码</th>
  62. <td>
  63. <el-input type="text" v-model="m.dutyParagraph" placeholder="请输入社会统一信用代码"></el-input>
  64. </td>
  65. </tr>
  66. <tr>
  67. <th>开户行</th>
  68. <td>
  69. <el-input type="text" v-model="m.bankName" placeholder="请输入开户行"></el-input>
  70. </td>
  71. <th>银行账号</th>
  72. <td>
  73. <el-input type="text" v-model="m.bankCode" placeholder="请输入银行账号"></el-input>
  74. </td>
  75. </tr>
  76. <tr>
  77. <th>联系人</th>
  78. <td>
  79. <el-input type="text" v-model="m.contacts" placeholder="请输入联系人"></el-input>
  80. </td>
  81. <th>联系电话</th>
  82. <td>
  83. <el-input type="text" v-model="m.phone" placeholder="请输入联系电话"></el-input>
  84. </td>
  85. </tr>
  86. <tr>
  87. <th>组成形式</th>
  88. <td>
  89. <el-input type="text" v-model="m.form" placeholder="请输入组成形式"></el-input>
  90. </td>
  91. <th>经营状态</th>
  92. <td>
  93. <el-input type="text" v-model="m.businessStatus" placeholder="请输入经营状态"></el-input>
  94. </td>
  95. </tr>
  96. <tr>
  97. <th>开票商</th>
  98. <td>
  99. <el-input type="text" v-model="m.invoiceBusiness" placeholder="请输入开票商"></el-input>
  100. </td>
  101. <th>开票人</th>
  102. <td>
  103. <el-input type="text" v-model="m.invoicePeople" placeholder="请输入开票人"></el-input>
  104. </td>
  105. </tr>
  106. <tr>
  107. <th>收款人</th>
  108. <td>
  109. <el-input type="text" v-model="m.payee" placeholder="请输入收款人"></el-input>
  110. </td>
  111. <th>复核人</th>
  112. <td>
  113. <el-input type="text" v-model="m.checker" placeholder="请输入复核人"></el-input>
  114. </td>
  115. </tr>
  116. <!--<tr>
  117. <th>互市区</th>
  118. <td>{{m.tradeAreaName}}</td>
  119. <th>创建时间</th>
  120. <td>{{sa.forDate(m.createTime, 2)}}</td>
  121. </tr>-->
  122. <tr>
  123. <th>经营场所</th>
  124. <td colspan="3">
  125. <el-input type="text" v-model="m.businessAddress" placeholder="请输入经营场所" style="width: 95%;"></el-input>
  126. </td>
  127. </tr>
  128. <tr>
  129. <th>经营范围</th>
  130. <td colspan="3" >
  131. <el-input type="text" v-model="m.businessScope" placeholder="请输入经营范围" style="width: 95%;"></el-input>
  132. </td>
  133. </tr>
  134. </table>
  135. <sa-item name="" class="s-ok" br>
  136. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  137. </sa-item>
  138. </el-form>
  139. </div>
  140. </div>
  141. <!-- ------- 底部按钮 ------- -->
  142. <div class="s-foot">
  143. <el-button type="primary" @click="ok()">确定</el-button>
  144. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  145. </div>
  146. </div>
  147. <script>
  148. var app = new Vue({
  149. components: {
  150. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  151. },
  152. el: '.vue-box',
  153. data: {
  154. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  155. type: sa.p('type', 0),
  156. m: null, // 实体对象
  157. peopleInfo: {}
  158. },
  159. methods: {
  160. // 创建一个 默认Model
  161. createModel: function() {
  162. return {
  163. id: '', // 主键id
  164. peopleId: '', // 边民表ID
  165. businessName: '', // 个体户名称
  166. dutyParagraph: '', // 社会统一信用代码
  167. name: '', // 经营者(边民)
  168. address: '', // 地址
  169. form: '', // 组成形式
  170. contacts: '', // 联系人
  171. phone: '', // 联系电话
  172. businessAddress: '', // 经营场所
  173. businessScope: '', // 经营范围
  174. businessStatus: '', // 经营状态
  175. idCard: '', // 身份证
  176. bankName: '', // 开户行
  177. bankCode: '', // 银行账号
  178. invoiceBusiness: '', // 开票商
  179. invoicePeople: '', // 开票人
  180. payee: '', // 收款人
  181. checker: '', // 复核人
  182. }
  183. },
  184. // 提交数据
  185. ok: function(){
  186. // 表单校验
  187. let m = this.m;
  188. sa.checkNull(m.businessName, '请输入 [名称]');
  189. sa.checkNull(m.dutyParagraph, '请输入 [社会统一信用代码]');
  190. sa.checkNull(m.bankName, '请输入 [开户行]');
  191. sa.checkNull(m.bankCode, '请输入 [银行账号]');
  192. sa.checkNull(m.contacts, '请输入 [联系人]');
  193. sa.checkNull(m.phone, '请输入 [联系电话]');
  194. sa.checkNull(m.form, '请输入 [组成形式]');
  195. sa.checkNull(m.businessStatus, '请输入 [经营状态]');
  196. // 开始增加或修改
  197. if(this.type === 'addPeople' && this.id > 0) { // 添加
  198. sa.ajax('/level-one-server/TbPeopleTaxAccount/add', m, function(res){
  199. sa.alert('增加成功', this.clean);
  200. }.bind(this));
  201. } else { // 修改
  202. sa.ajax('/level-one-server/TbPeopleTaxAccount/update', m, function(res){
  203. sa.alert('修改成功', this.clean);
  204. }.bind(this));
  205. }
  206. },
  207. // 添加/修改 完成后的动作
  208. clean: function() {
  209. parent.app.f5(); // 刷新父页面列表
  210. sa.closeCurrIframe(); // 关闭本页
  211. }
  212. },
  213. mounted: function(){
  214. console.log("---type----="+this.type)
  215. console.log("---id----="+this.id)
  216. // 初始化数据
  217. if(this.type === 'addPeople' && this.id > 0) {
  218. this.m = this.createModel();
  219. sa.ajax('/level-one-server/TbPeople/getById', {id: this.id}, function(res) {
  220. this.peopleInfo = res.data; // 数据
  221. this.m.peopleId = this.peopleInfo.id
  222. this.m.name = this.peopleInfo.name
  223. this.m.idCard = this.peopleInfo.idCard
  224. this.m.phone = this.peopleInfo.phone
  225. this.m.tradeAreaId = this.peopleInfo.tradeAreaId
  226. this.m.tradeAreaName = this.peopleInfo.tradeAreaName
  227. sa.f5TableHeight(); // 刷新表格高度
  228. }.bind(this));
  229. } else {
  230. sa.ajax('/level-one-server/TbPeopleTaxAccount/getById?id=' + this.id, function(res) {
  231. this.m = res.data;
  232. if(res.data == null) {
  233. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  234. }
  235. }.bind(this))
  236. }
  237. }
  238. })
  239. </script>
  240. </body>
  241. </html>