tb-costomer-judge.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>客户审核</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="名称" v-model="p.name"></sa-item>
  25. <sa-item type="text" name="联系号码" v-model="p.phone"></sa-item>
  26. <sa-item type="text" name="负责人" v-model="p.dutyPeople"></sa-item>
  27. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  28. <br/>
  29. <sa-item name="综合排序">
  30. <el-radio-group v-model="p.sortType" class="s-radio-text">
  31. <el-radio :label="0">默认</el-radio>
  32. <el-radio :label="2">名称</el-radio>
  33. <el-radio :label="8">创建时间</el-radio>
  34. </el-radio-group>
  35. </sa-item>
  36. </el-form>
  37. <el-button type="success" icon="el-icon-view" @click="getBySelect()">查看</el-button>
  38. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  39. <!-- ------------- 数据列表 ------------- -->
  40. <el-table class="data-table" ref="data-table" :data="dataList">
  41. <sa-td type="selection"></sa-td>
  42. <sa-td name="名称" prop="name"></sa-td>
  43. <sa-td name="联系号码" prop="phone"></sa-td>
  44. <sa-td name="负责人" prop="dutyPeople"></sa-td>
  45. <sa-td name="结算类型" prop="payType" type="enum" :jv="{1: '现结', 2: '月结'}"></sa-td>
  46. <sa-td name="地址" prop="addressStr"></sa-td>
  47. <sa-td name="营业执照" prop="businessLicence" type="img"></sa-td>
  48. <sa-td name="创建时间" prop="creareTime"></sa-td>
  49. <sa-td name="审核状态" prop="judgeStatus" type="enum" :jv="{1: '未审核', 2: '已通过', 3: '不通过'}"></sa-td>
  50. <el-table-column label="操作" fixed="right" width="280px">
  51. <template slot-scope="s">
  52. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  53. <el-button class="c-btn" type="success" icon="el-icon-view" @click="judgeFn(s.row)">
  54. 审核
  55. </el-button>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <!-- ------------- 分页 ------------- -->
  60. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  61. </div>
  62. <el-dialog title="审核" :visible="modal.visible" width="500px">
  63. <el-form size="mini">
  64. <div class="c-item br">
  65. <label class="c-label"><label style="color: red">*</label>审核意见:</label>
  66. <el-input placeholder="请输入审核意见" v-model="modal.form.judgeContent"></el-input>
  67. </div>
  68. </el-form>
  69. <span slot="footer" class="dialog-footer">
  70. <el-button @click="closeFn">关闭</el-button>
  71. <el-button type="danger" @click="sureJudge(3)">不通过</el-button>
  72. <el-button type="primary" @click="sureJudge(2)">通过</el-button>
  73. </span>
  74. </el-dialog>
  75. </div>
  76. <script>
  77. var app = new Vue({
  78. components: {
  79. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  80. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  81. },
  82. el: '.vue-box',
  83. data: {
  84. modal: {
  85. visible: false,
  86. form: {
  87. id: '',
  88. judgeContent: '审核通过'
  89. }
  90. },
  91. p: { // 查询参数
  92. id: '', // 主键
  93. name: '', // 名称
  94. phone: '', // 联系号码
  95. dutyPeople: '', // 负责人
  96. addressIds: '', // 地址id
  97. addressStr: '', // 地址
  98. status: '', // 状态(0=否,1=是)
  99. creareTime: '', // 创建时间
  100. judgeStatus: '', // 审核状态(1=未审核,2审核通过,3审核不通过)
  101. judgeTime: '', // 审核时间
  102. judgeContent: '', // 审核意见
  103. pageNo: 1, // 当前页
  104. pageSize: 10, // 页大小
  105. sortType: 0 // 排序方式
  106. },
  107. dataCount: 0,
  108. dataList: [], // 数据集合
  109. currentCustomerId: '1',
  110. },
  111. methods: {
  112. closeFn() {
  113. this.modal.visible = false;
  114. },
  115. judgeFn(data) {
  116. Object.assign(this.modal, {
  117. visible: true,
  118. form: {
  119. id: data.id,
  120. judgeContent: data.judgeContent,
  121. judgeStatus: data.judgeStatus
  122. }
  123. })
  124. },
  125. sureJudge(status) {
  126. if (this.modal.form.judgeStatus == 2) {
  127. sa.error('已审核通过,无需再审核')
  128. return;
  129. }
  130. let content = "审核通过";
  131. if (status == 3) {
  132. if (!this.modal.form.judgeContent) {
  133. sa.error('请输入审核意见');
  134. return;
  135. }
  136. } else {
  137. this.modal.form.judgeContent = content;
  138. }
  139. this.modal.form.judgeStatus = status;
  140. sa.ajax('/TbCostomer/judge', this.modal.form, function (resp) {
  141. this.modal.visible = false;
  142. this.f5();
  143. }.bind(this))
  144. },
  145. getCustomer() {
  146. sa.ajax('/TbCostomer/getCurrentCustomerId', function (resp) {
  147. this.currentCustomerId = resp.data;
  148. }.bind(this));
  149. },
  150. userFn(data) {
  151. sa.showIframe('企业用户', 'customer-admin-list.html?customerId=' + data.id, '1050px', '90%');
  152. },
  153. // 刷新
  154. f5: function () {
  155. sa.ajax('/TbCostomer/getList', sa.removeNull(this.p), function (res) {
  156. this.dataList = res.data; // 数据
  157. this.dataCount = res.dataCount; // 数据总数
  158. sa.f5TableHeight(); // 刷新表格高度
  159. }.bind(this));
  160. },
  161. // 查看
  162. get: function (data) {
  163. sa.showIframe('数据详情', 'tb-costomer-info.html?id=' + data.id, '1050px', '90%');
  164. },
  165. // 查看 - 根据选中的
  166. getBySelect: function (data) {
  167. var selection = this.$refs['data-table'].selection;
  168. if (selection.length == 0) {
  169. return sa.msg('请选择一条数据')
  170. }
  171. this.get(selection[0]);
  172. },
  173. // 修改
  174. update: function (data) {
  175. sa.showIframe('修改数据', 'tb-costomer-add.html?id=' + data.id, '1000px', '90%');
  176. },
  177. // 新增
  178. add: function (data) {
  179. sa.showIframe('新增数据', 'tb-costomer-add.html?id=-1', '550px', '80%');
  180. },
  181. // 删除
  182. del: function (data) {
  183. sa.confirm('是否删除,此操作不可撤销', function () {
  184. sa.ajax('/TbCostomer/delete?id=' + data.id, function (res) {
  185. sa.arrayDelete(this.dataList, data);
  186. sa.ok('删除成功');
  187. sa.f5TableHeight(); // 刷新表格高度
  188. }.bind(this))
  189. }.bind(this));
  190. },
  191. // 批量删除
  192. deleteByIds: function () {
  193. // 获取选中元素的id列表
  194. let selection = this.$refs['data-table'].selection;
  195. let ids = sa.getArrayField(selection, 'id');
  196. if (selection.length == 0) {
  197. return sa.msg('请至少选择一条数据')
  198. }
  199. // 提交删除
  200. sa.confirm('是否批量删除选中数据?此操作不可撤销', function () {
  201. sa.ajax('/TbCostomer/deleteByIds', {ids: ids.join(',')}, function (res) {
  202. sa.arrayDelete(this.dataList, selection);
  203. sa.ok('删除成功');
  204. sa.f5TableHeight(); // 刷新表格高度
  205. }.bind(this))
  206. }.bind(this));
  207. },
  208. // 改 - 状态(0=否,1=是)
  209. updateStatus: function (data) {
  210. // 声明变量记录是否成功
  211. var isOk = false;
  212. var oldValue = data.status;
  213. var ajax = sa.ajax('/TbCostomer/updateStatus', {id: data.id, value: data.status}, function (res) {
  214. isOk = true;
  215. sa.msg('修改成功');
  216. }.bind(this));
  217. // 如果未能修改成功, 则回滚
  218. $.when(ajax).done(function () {
  219. if (isOk == false) {
  220. data.status = oldValue;
  221. }
  222. })
  223. },
  224. },
  225. created: function () {
  226. this.f5();
  227. this.getCustomer();
  228. sa.onInputEnter();
  229. }
  230. })
  231. </script>
  232. </body>
  233. </html>