follow_project.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. 123{extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-3">
  5. <div class="gg-form-bar border-t border-x">
  6. <form id="taskForm" class="layui-form" lay-filter="barsearchform">
  7. <div class="layui-input-inline" style="width:100px;">
  8. <select name="project_status" lay-filter="status">
  9. <option value="">项目状态</option>
  10. <option value="1">财政局立项中</option>
  11. <option value="2">审批中</option>
  12. <option value="3">待接收</option>
  13. <option value="4">分配中</option>
  14. <option value="5">作业中</option>
  15. <option value="6">归档中</option>
  16. <option value="7">退审中</option>
  17. <option value="8">已归档</option>
  18. <option value="9">已退审</option>
  19. </select>
  20. </div>
  21. <div class="layui-input-inline" style="width:100px;">
  22. <select id="province" lay-filter="province" name="province">
  23. <option value="">省</option>
  24. </select>
  25. </div>
  26. <div class="layui-input-inline" style="width:100px;">
  27. <select id="city" lay-filter="city" name="city">
  28. <option value="">市</option>
  29. </select>
  30. </div>
  31. <div class="layui-input-inline" style="width:100px;">
  32. <select id="area" lay-filter="area" name="area">
  33. <option value="">县</option>
  34. </select>
  35. </div>
  36. <div id="time_date" class="layui-input-inline" style="margin: 0;">
  37. <div class="layui-input-inline" style="width:150px;">
  38. <input type="text" id="start_time" name="project_start_time" readonly placeholder="起始日期"
  39. class="layui-input" value="">
  40. </div>
  41. <div class="layui-input-inline">-</div>
  42. <div class="layui-input-inline" style="width:150px;">
  43. <input type="text" id="end_time" name="project_end_time" readonly placeholder="截止日期"
  44. class="layui-input" value="">
  45. </div>
  46. </div>
  47. <div class="layui-input-inline" style="width:200px;">
  48. <input type="text" name="sent_review_unit_name" placeholder="送审单位" class="layui-input"
  49. autocomplete="off"/>
  50. </div>
  51. <div class="layui-input-inline" style="width:200px;">
  52. <input type="text" name="entrust_unit_name" placeholder="委托单位" class="layui-input"
  53. autocomplete="off"/>
  54. </div>
  55. <div class="layui-input-inline" style="width:200px;">
  56. <input type="text" name="keyword" placeholder="项目名称关键字" class="layui-input" autocomplete="off"/>
  57. </div>
  58. <div class="layui-input-inline" style="width:150px;">
  59. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform"><i
  60. class="layui-icon layui-icon-search mr-1"></i>搜索
  61. </button>
  62. <button class="layui-btn layui-btn-reset" lay-submit="" lay-filter="reset1">清空</button>
  63. </div>
  64. </form>
  65. </div>
  66. <table class="layui-hide" id="cost_project" lay-filter="cost_project"></table>
  67. </div>
  68. <!-- <script type="text/html" id="toolbarDemo">
  69. <div class="layui-btn-container">
  70. <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加造价项目">+ 添加造价项目</span>
  71. </div>
  72. </script> -->
  73. <!--<script type="text/html" id="barDemo">-->
  74. <!-- <div class="layui-btn-group">-->
  75. <!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
  76. <!-- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="finish">归档</a>-->
  77. <!-- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="dismissal">退审</a>-->
  78. <!-- </div>-->
  79. <!--</script>-->
  80. <script type="text/html" id="barDemo">
  81. {{# if(d.project_status==4 || d.project_status==5){ }}
  82. <div class="layui-clear-space">
  83. <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  84. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="more">
  85. 更多
  86. <i class="layui-icon layui-icon-down"></i>
  87. </a>
  88. </div>
  89. {{# } else { }}
  90. <div class="layui-btn-group">
  91. </div>
  92. {{# } }}
  93. </script>
  94. {/block}
  95. <!-- /主体 -->
  96. <!-- 脚本 -->
  97. {block name="script"}
  98. <script>
  99. const moduleInit = ['tool'];
  100. function gouguInit() {
  101. var table = layui.table, tool = layui.tool, form = layui.form;
  102. var dropdown = layui.dropdown;
  103. var allcount;
  104. layui.laydate.render({
  105. elem: '#time_date',
  106. range: ['#start_time', '#end_time'],
  107. rangeLinked: true
  108. });
  109. layui.pageTable = table.render({
  110. elem: '#cost_project',
  111. title: '造价项目',
  112. toolbar: '#toolbarDemo',
  113. url: '/admin/project.cost_company/followProject',
  114. page: true,
  115. limit: 20,
  116. parseData: function (res) { // 数据解析回调函数
  117. // 在这里可以获取数据总数
  118. allcount = res.count;
  119. return {
  120. code: res.code, // 数据状态码
  121. msg: res.msg, // 状态信息
  122. count: res.count, // 数据总数
  123. data: res.data // 当前页数据
  124. };
  125. },
  126. cols: [
  127. [
  128. {
  129. fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
  130. templet: function (d) {
  131. return allcount - (d.LAY_NUM - 1);
  132. }
  133. },
  134. {
  135. fixed: 'left',
  136. field: 'project_status',
  137. title: '项目状态',
  138. align: 'center',
  139. width: 100,
  140. templet: function (item) {
  141. var html;
  142. if (item.project_status === 5) {
  143. html = '<span class="layui-badge layui-bg-blue" style="background-color: #1e9fff !important">作业中</span> ';
  144. } else if (item.project_status === 4) {
  145. html = '<span class="layui-badge" style="background-color: #005fa8 !important">分配中</span> ';
  146. } else if (item.project_status === 6) {
  147. html = '<span class="layui-badge layui-bg-orange" style="background-color: #007244 !important">归档中</span> ';
  148. } else if (item.project_status === 8) {
  149. html = '<span class="layui-badge layui-bg-green" style="background-color: #16b777 !important">已归档</span> ';
  150. } else if (item.project_status === 7) {
  151. html = '<span class="layui-badge layui-bg-orange" style="background-color: #881f1f !important">退审中</span> ';
  152. } else if (item.project_status === 9) {
  153. html = '<span class="layui-badge layui-bg-green" style="background-color: #d81e06 !important">已退审</span> ';
  154. }
  155. return html;
  156. }
  157. },
  158. {
  159. fixed: 'left',
  160. field: 'report_status',
  161. title: '报告状态',
  162. align: 'center',
  163. width: 100,
  164. hide: false,
  165. templet: function (item) {
  166. var html;
  167. if (item.report_status === 0) {
  168. html = '<span>初稿中</span> ';
  169. } else if (item.report_status === 1) {
  170. html = '<span>对数中</span> ';
  171. } else if (item.report_status === 2) {
  172. html = '<span>审定中</span> ';
  173. } else if (item.report_status === 3) {
  174. html = '<span>已审定</span> ';
  175. }else {
  176. html = '<span >未知</span> ';
  177. }
  178. return html;
  179. }
  180. },
  181. {
  182. fixed: 'left',
  183. field: 'project_name',
  184. title: '项目名称',
  185. align: 'center',
  186. width: 400,
  187. templet: function (d) {
  188. var html = "";
  189. if (d.red) {
  190. //判断是否有新消息,有就有new
  191. html = '<a class="side-a" lay-event="read" lay-event="read">' + d.project_name + ' <span class="layui-badge-dot hongdian"></span></a>';
  192. } else {
  193. html = '<a class="side-a" lay-event="read" lay-event="read">' + d.project_name + '</a>';
  194. }
  195. return '<div style="text-align:left">' + html + '</div>'
  196. }
  197. },
  198. {
  199. field: 'project_num',
  200. title: '项目编号',
  201. align: 'center',
  202. width: 150,
  203. },
  204. {
  205. field: 'project_time',
  206. title: '项目周期',
  207. align: 'center',
  208. width: 270,
  209. templet: function (item) {
  210. let outcome = Math.round(new Date().getTime() / 1000).toString();
  211. var advent_time = item.project_end_time - outcome
  212. var time = getDuration(advent_time);
  213. var timestr = "<span style='color: green'>" + "剩余" + time + "</span>";
  214. if (advent_time < 0) {
  215. advent_time = -advent_time
  216. time = getDuration(advent_time);
  217. timestr = "<span style='color: red'>" + "逾期" + time + "</span>";
  218. }
  219. var html;
  220. if (item.project_status == 8 || item.project_status == 9 ){
  221. html =
  222. "<div>" +
  223. layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
  224. "至" +
  225. layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
  226. "</div>";
  227. }else{
  228. html =
  229. "<div>" +
  230. layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
  231. "至" +
  232. layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
  233. "&nbsp;&nbsp;" + timestr +
  234. "</div>";
  235. }
  236. function getDuration(second) {
  237. var duration
  238. var days = Math.floor(second / 86400);
  239. var hours = Math.floor((second % 86400) / 3600);
  240. if (days > 0) duration = days + "天";
  241. else if (hours > 0) duration = "不足一天";
  242. else if (hours == 0) duration = "不足一天";
  243. return duration;
  244. }
  245. return html;
  246. }
  247. },
  248. {
  249. field: 'entrust_unit_name',
  250. title: '委托单位',
  251. align: 'center',
  252. width: 150,
  253. },
  254. {
  255. field: 'entrust_maker_name',
  256. title: '委托单位负责人',
  257. align: 'center',
  258. width: 150,
  259. },
  260. {
  261. field: 'entrust_phone',
  262. title: '委托单位负责人电话',
  263. align: 'center',
  264. width: 150,
  265. },
  266. {
  267. field: 'sent_review_unit_name',
  268. title: '送审单位',
  269. align: 'center',
  270. width: 150,
  271. },
  272. {
  273. field: 'sent_review_head_name',
  274. title: '送审单位负责人',
  275. align: 'center',
  276. width: 150,
  277. },
  278. {
  279. field: 'sent_review_phone',
  280. title: '送审单位负责人电话',
  281. align: 'center',
  282. width: 150,
  283. },
  284. {
  285. field: 'project_scale',
  286. title: '项目规模',
  287. align: 'center',
  288. width: 150,
  289. },
  290. {
  291. field: 'engineering_category',
  292. title: '工程类别',
  293. align: 'center',
  294. width: 150,
  295. },
  296. {
  297. field: 'engineering_type',
  298. title: '项目类型',
  299. align: 'center',
  300. width: 150,
  301. },
  302. {
  303. field: 'project_region',
  304. title: '项目区域',
  305. align: 'center',
  306. width: 150,
  307. },
  308. {
  309. field: 'fiscal_nature',
  310. title: '财政性质',
  311. align: 'center',
  312. width: 150,
  313. },
  314. {
  315. field: 'sent_review_cost',
  316. title: '送审服务费',
  317. align: 'center',
  318. width: 100,
  319. },
  320. {
  321. field: 'sent_review_amount',
  322. title: '送审金额',
  323. align: 'center',
  324. width: 150,
  325. },
  326. {
  327. field: 'authorize_amount',
  328. title: '审定金额',
  329. align: 'center',
  330. width: 150,
  331. },
  332. {
  333. field: 'review_add_amount',
  334. title: '审增额',
  335. align: 'center',
  336. width: 150,
  337. },
  338. {
  339. field: 'review_reduce_amount',
  340. title: '审减额',
  341. align: 'center',
  342. width: 150,
  343. },
  344. {
  345. field: 'review_add_reduce_rate',
  346. title: '审增减率',
  347. align: 'center',
  348. width: 150,
  349. },
  350. {
  351. field: 'report_time',
  352. title: '报告时间',
  353. align: 'center',
  354. width: 150,
  355. templet: function (d) {
  356. if (d.report_time) {
  357. return layui.util.toDateString(d.report_time * 1000, "yyyy-MM-dd")
  358. } else {
  359. return "";
  360. }
  361. }
  362. },
  363. {
  364. field: 'charge_standard',
  365. title: '收费标准',
  366. align: 'center',
  367. width: 150,
  368. },
  369. {
  370. field: 'operate_head_name',
  371. title: '作业负责人',
  372. align: 'center',
  373. width: 150,
  374. },
  375. {
  376. field: 'operate_team_names',
  377. title: '作业成员',
  378. align: 'center',
  379. width: 300,
  380. },
  381. {
  382. field: 'creator',
  383. title: '创建人',
  384. align: 'center',
  385. width: 150,
  386. },
  387. {
  388. field: 'create_time',
  389. title: '项目创建日期',
  390. align: 'center',
  391. width: 180,
  392. },
  393. {
  394. field: 'project_dead_time',
  395. title: '项目归档日期',
  396. align: 'center',
  397. width: 120,
  398. templet: function (d) {
  399. if (d.project_dead_time) {
  400. return layui.util.toDateString(d.project_dead_time * 1000, "yyyy-MM-dd")
  401. } else {
  402. return "";
  403. }
  404. }
  405. },
  406. {fixed: 'right', title: '操作', align: 'center', width: 170, toolbar: '#barDemo'},
  407. ]
  408. ]
  409. });
  410. //监听表头工具栏事件
  411. table.on('toolbar(cost_project)', function (obj) {
  412. if (obj.event === 'add') {
  413. tool.side("/admin/project.cost_company/add");
  414. return false;
  415. }
  416. });
  417. //监听表格行工具事件
  418. table.on('tool(cost_project)', function (obj) {
  419. var data = obj.data;
  420. if (obj.event === 'read') {
  421. tool.side('/admin/project.cost_company/read?id=' + obj.data.id);
  422. } else if (obj.event === 'edit') {
  423. if (obj.data.project_status < 6) {
  424. tool.side('/admin/project.cost_company/edit?id=' + obj.data.id);
  425. } else {
  426. layer.msg("已归档/已退审")
  427. }
  428. } else if (obj.event === 'finish') {
  429. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  430. var ttxx = layer.prompt({
  431. title: '请输入<span style="color: red">归档</span>原因',
  432. formType: 2,
  433. area: ['35vw', '15vw']
  434. }, function (text, index) {
  435. let callback = function (e) {
  436. window.location.reload()
  437. layer.msg(e.msg);
  438. setTimeout(function () {
  439. layer.close(index);
  440. }, 2000)
  441. }
  442. if (text !== "") {
  443. tool.post("/admin/project.cost_company/finish", {
  444. id: data.id,
  445. finish_reason: text
  446. }, callback);
  447. } else {
  448. layer.msg("归档原因不能为空")
  449. }
  450. });
  451. } else {
  452. layer.msg("已归档/已退审")
  453. }
  454. } else if (obj.event === 'dismissal') {
  455. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  456. var ttxx = layer.prompt({
  457. title: '请输入<span style="color: red">退审</span>原因',
  458. formType: 2,
  459. area: ['35vw', '15vw']
  460. }, function (text, index) {
  461. let callback = function (e) {
  462. window.location.reload()
  463. layer.msg(e.msg);
  464. setTimeout(function () {
  465. layer.close(index);
  466. }, 2000)
  467. }
  468. if (text !== "") {
  469. tool.post("/admin/project.cost_company/dismissal", {
  470. id: data.id,
  471. dismissal_reason: text,
  472. }, callback);
  473. } else {
  474. layer.msg("退审原因不能为空")
  475. }
  476. });
  477. } else {
  478. layer.msg("已归档/已退审")
  479. }
  480. } else if (obj.event === 'more') {
  481. // 更多 - 下拉菜单
  482. dropdown.render({
  483. elem: this, // 触发事件的 DOM 对象
  484. show: true, // 外部事件触发即显示
  485. data: [
  486. {
  487. title: '状态',
  488. id: 'set_status',
  489. templet: function () {
  490. return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="set_status" class="dropbtn">状态</button>';
  491. }
  492. },{
  493. title: '归档',
  494. id: 'finish',
  495. templet: function () {
  496. return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="finish" class="dropbtn">归档</button>';
  497. }
  498. }, {
  499. title: '退审',
  500. id: 'dismissal',
  501. templet: function () {
  502. return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="dismissal" class="dropbtn">退审</button>';
  503. }
  504. }
  505. ],
  506. click: function (menudata) {
  507. if (menudata.id === 'finish') {
  508. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  509. var ttxx = layer.prompt({
  510. title: '请输入<span style="color: red">归档</span>原因',
  511. formType: 2,
  512. area: ['35vw', '15vw']
  513. }, function (text, index) {
  514. let callback = function (e) {
  515. window.location.reload()
  516. layer.msg(e.msg);
  517. setTimeout(function () {
  518. layer.close(index);
  519. }, 2000)
  520. }
  521. if (text !== "") {
  522. tool.post("/admin/project.cost_company/finish", {
  523. id: data.id,
  524. finish_reason: text
  525. }, callback);
  526. } else {
  527. layer.msg("归档原因不能为空")
  528. }
  529. });
  530. } else {
  531. layer.msg("已归档/已退审")
  532. }
  533. } else if (menudata.id === 'dismissal') {
  534. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  535. var ttxx = layer.prompt({
  536. title: '请输入<span style="color: red">退审</span>原因',
  537. formType: 2,
  538. area: ['35vw', '15vw']
  539. }, function (text, index) {
  540. let callback = function (e) {
  541. window.location.reload()
  542. layer.msg(e.msg);
  543. setTimeout(function () {
  544. layer.close(index);
  545. }, 2000)
  546. }
  547. if (text !== "") {
  548. tool.post("/admin/project.cost_company/dismissal", {
  549. id: data.id,
  550. dismissal_reason: text,
  551. }, callback);
  552. } else {
  553. layer.msg("退审原因不能为空")
  554. }
  555. });
  556. } else {
  557. layer.msg("已归档/已退审")
  558. }
  559. }else if (menudata.id === 'set_status') {
  560. setStatus(data.id);
  561. }
  562. },
  563. align: 'center', // 右对齐弹出
  564. style: 'min-width: 0px' // 设置额外样式
  565. })
  566. }
  567. return false;
  568. });
  569. function setStatus(project_id) {
  570. layer.open({
  571. title: '选择状态',
  572. type:1,
  573. area: ['480px', '336px'],
  574. content: '<div class="picker-table"><div id="boxselect"></div></div>',
  575. success: function() {
  576. table_a = table.render({
  577. elem: '#boxselect',
  578. cols: [
  579. [{
  580. type: 'radio',
  581. title: '选择',
  582. width: 100
  583. }, {
  584. field: 'title',
  585. title: '状态'
  586. }]
  587. ],
  588. data: [{
  589. "type": "0",
  590. "title": "初稿中"
  591. },{
  592. "type": "1",
  593. "title": "对数中"
  594. }, {
  595. "type": "2",
  596. "title": "审定中"
  597. }]
  598. });
  599. },
  600. btn:['确定'],
  601. yes: function(index) {
  602. var checkStatus = table.checkStatus(table_a.config.id);
  603. var data = checkStatus.data;
  604. console.log(checkStatus,data);
  605. if (data.length > 0) {
  606. let callbacl = function (e) {
  607. layui.pageTable.reload();
  608. layer.msg(e.msg)
  609. }
  610. data = {project_id:project_id,report_status:data[0].type}
  611. tool.post("/admin/project.api/set_status",data,callbacl);
  612. layer.close(index);
  613. }
  614. else{
  615. layer.msg('选择合同性质');
  616. }
  617. }
  618. })
  619. }
  620. //监听搜索提交
  621. form.on('submit(webform)', function (data) {
  622. console.log(data.field)
  623. layui.pageTable.reload({where: data.field});
  624. return false;
  625. });
  626. form.on('submit(reset1)', function () {
  627. $(".layui-form").reset();
  628. layui.pageTable.reload();
  629. return false;
  630. });
  631. layui.use(['form', 'jquery'], function () {
  632. var form = layui.form;
  633. const $ = layui.jquery;
  634. let adress;
  635. $.ajax({
  636. type: "get", //使用get方式
  637. url: "/static/assets/layui/adress.json", //json文件相对于这个HTML的路径
  638. dataType: "json",
  639. async: false,
  640. success: function (data) {
  641. //这个data就是json数据
  642. adress = data
  643. var province = Object.keys(adress)
  644. var proStrs = '<option value="">省</option>';
  645. for (var i = 0; i < province.length; i++) {
  646. proStrs += '<option value="' + province[i] + '">' + province[i] + '</option>';
  647. }
  648. $("#province").html(proStrs);
  649. layui.form.render("select")
  650. },
  651. error: function () {
  652. layui.alert("地址请求失败!! ");
  653. }
  654. });
  655. function getFirstAttr(obj) {
  656. for (var k in obj) return k;
  657. }
  658. function selectOption(selectedProvince, selectedCity = '', selectedArea = '') {
  659. var proStr = '<option value="">省</option>', cityStr = '<option value="">市</option>',
  660. areaStr = '<option value="">县</option>';
  661. var pro = adress[selectedProvince], ci = adress[selectedProvince][selectedCity];
  662. for (var province in adress) {
  663. if (province == selectedProvince) proStr += '<option value="' + province + '" selected>' + province + '</option>';
  664. else proStr += '<option value="' + province + '">' + province + '</option>';
  665. }
  666. $("#province").html(proStr);
  667. for (var city in pro) {
  668. if (city == selectedCity) cityStr += '<option value="' + city + '" selected>' + city + '</option>';
  669. else cityStr += '<option value="' + city + '">' + city + '</option>';
  670. }
  671. $("#city").html(cityStr);
  672. for (var area in ci) {
  673. if (area == "remove") {
  674. continue;
  675. }
  676. if (ci[area] == selectedArea) areaStr += '<option value="' + ci[area] + '" selected>' + ci[area] + '</option>';
  677. else areaStr += '<option value="' + ci[area] + '">' + ci[area] + '</option>';
  678. }
  679. $("#area").html(areaStr);
  680. form.render();
  681. }
  682. /*selectOption(1,2, 3);*/
  683. form.on('select(province)', function (data) {
  684. let thisProvince = data.value;
  685. let thisCity = getFirstAttr(adress[thisProvince]);
  686. selectOption(data.value);
  687. });
  688. form.on('select(city)', function (data) {
  689. selectOption($("#province").val(), data.value, getFirstAttr(data.value));
  690. });
  691. window.hongdianselect = function () {
  692. let num = $(document).find('.hongdian').length
  693. console.log(num, '我是数量')
  694. if (num === 0) {
  695. parent.showhongdian()
  696. console.log('2执行了')
  697. }
  698. }
  699. })
  700. }
  701. </script>
  702. {/block}
  703. <!-- /脚本 -->