follow_project.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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. }else if(item.project_status === 0){
  155. if(item.proprietor_status===0){
  156. html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800 !important">业主立项中</span> '
  157. }else if(item.proprietor_status===1){
  158. html = '<span class="layui-badge layui-bg-orange" style="background-color: #b30095 !important"">业主审核中</span> '
  159. }else if(item.proprietor_status===2){
  160. html = '<span class="layui-badge layui-bg-orange" style="background-color: #b88230 !important">财评待接收</span> '
  161. }
  162. }
  163. return html;
  164. }
  165. },
  166. {
  167. fixed: 'left',
  168. field: 'report_status',
  169. title: '报告状态',
  170. align: 'center',
  171. width: 100,
  172. hide: false,
  173. templet: function (item) {
  174. var html;
  175. if (item.report_status === 0) {
  176. html = '<span>初稿中</span> ';
  177. } else if (item.report_status === 1) {
  178. html = '<span>对数中</span> ';
  179. } else if (item.report_status === 2) {
  180. html = '<span>审定中</span> ';
  181. } else if (item.report_status === 3) {
  182. html = '<span>已审定</span> ';
  183. }else {
  184. html = '<span >未知</span> ';
  185. }
  186. return html;
  187. }
  188. },
  189. {
  190. fixed: 'left',
  191. field: 'project_name',
  192. title: '项目名称',
  193. align: 'center',
  194. width: 400,
  195. templet: function (d) {
  196. var html = "";
  197. if (d.red) {
  198. //判断是否有新消息,有就有new
  199. html = '<a class="side-a" lay-event="read" lay-event="read">' + d.project_name + ' <span class="layui-badge-dot hongdian"></span></a>';
  200. } else {
  201. html = '<a class="side-a" lay-event="read" lay-event="read">' + d.project_name + '</a>';
  202. }
  203. return '<div style="text-align:left">' + html + '</div>'
  204. }
  205. },
  206. {
  207. field: 'project_num',
  208. title: '项目编号',
  209. align: 'center',
  210. width: 150,
  211. },
  212. {
  213. field: 'project_time',
  214. title: '项目周期',
  215. align: 'center',
  216. width: 270,
  217. templet: function (item) {
  218. let outcome = Math.round(new Date().getTime() / 1000).toString();
  219. var advent_time = item.project_end_time - outcome
  220. var time = getDuration(advent_time);
  221. var timestr = "<span style='color: green'>" + "剩余" + time + "</span>";
  222. if (advent_time < 0) {
  223. advent_time = -advent_time
  224. time = getDuration(advent_time);
  225. timestr = "<span style='color: red'>" + "逾期" + time + "</span>";
  226. }
  227. var html;
  228. if (item.project_status == 8 || item.project_status == 9 ){
  229. html =
  230. "<div>" +
  231. layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
  232. "至" +
  233. layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
  234. "</div>";
  235. }else{
  236. html =
  237. "<div>" +
  238. layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
  239. "至" +
  240. layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
  241. "&nbsp;&nbsp;" + timestr +
  242. "</div>";
  243. }
  244. function getDuration(second) {
  245. var duration
  246. var days = Math.floor(second / 86400);
  247. var hours = Math.floor((second % 86400) / 3600);
  248. if (days > 0) duration = days + "天";
  249. else if (hours > 0) duration = "不足一天";
  250. else if (hours == 0) duration = "不足一天";
  251. return duration;
  252. }
  253. return html;
  254. }
  255. },
  256. {
  257. field: 'entrust_unit_name',
  258. title: '委托单位',
  259. align: 'center',
  260. width: 150,
  261. },
  262. {
  263. field: 'entrust_maker_name',
  264. title: '委托单位负责人',
  265. align: 'center',
  266. width: 150,
  267. },
  268. {
  269. field: 'entrust_phone',
  270. title: '委托单位负责人电话',
  271. align: 'center',
  272. width: 150,
  273. },
  274. {
  275. field: 'sent_review_unit_name',
  276. title: '送审单位',
  277. align: 'center',
  278. width: 150,
  279. },
  280. {
  281. field: 'sent_review_head_name',
  282. title: '送审单位负责人',
  283. align: 'center',
  284. width: 150,
  285. },
  286. {
  287. field: 'sent_review_phone',
  288. title: '送审单位负责人电话',
  289. align: 'center',
  290. width: 150,
  291. },
  292. {
  293. field: 'project_scale',
  294. title: '项目规模',
  295. align: 'center',
  296. width: 150,
  297. },
  298. {
  299. field: 'engineering_category',
  300. title: '工程类别',
  301. align: 'center',
  302. width: 150,
  303. },
  304. {
  305. field: 'engineering_type',
  306. title: '项目类型',
  307. align: 'center',
  308. width: 150,
  309. },
  310. {
  311. field: 'project_region',
  312. title: '项目区域',
  313. align: 'center',
  314. width: 150,
  315. },
  316. {
  317. field: 'fiscal_nature',
  318. title: '财政性质',
  319. align: 'center',
  320. width: 150,
  321. },
  322. {
  323. field: 'sent_review_cost',
  324. title: '送审服务费',
  325. align: 'center',
  326. width: 100,
  327. },
  328. {
  329. field: 'sent_review_amount',
  330. title: '送审金额',
  331. align: 'center',
  332. width: 150,
  333. },
  334. {
  335. field: 'authorize_amount',
  336. title: '审定金额',
  337. align: 'center',
  338. width: 150,
  339. },
  340. {
  341. field: 'review_add_amount',
  342. title: '审增额',
  343. align: 'center',
  344. width: 150,
  345. },
  346. {
  347. field: 'review_reduce_amount',
  348. title: '审减额',
  349. align: 'center',
  350. width: 150,
  351. },
  352. {
  353. field: 'review_add_reduce_rate',
  354. title: '审增减率',
  355. align: 'center',
  356. width: 150,
  357. },
  358. {
  359. field: 'report_time',
  360. title: '报告时间',
  361. align: 'center',
  362. width: 150,
  363. templet: function (d) {
  364. if (d.report_time) {
  365. return layui.util.toDateString(d.report_time * 1000, "yyyy-MM-dd")
  366. } else {
  367. return "";
  368. }
  369. }
  370. },
  371. {
  372. field: 'charge_standard',
  373. title: '收费标准',
  374. align: 'center',
  375. width: 150,
  376. },
  377. {
  378. field: 'operate_head_name',
  379. title: '作业负责人',
  380. align: 'center',
  381. width: 150,
  382. },
  383. {
  384. field: 'operate_team_names',
  385. title: '作业成员',
  386. align: 'center',
  387. width: 300,
  388. },
  389. {
  390. field: 'creator',
  391. title: '创建人',
  392. align: 'center',
  393. width: 150,
  394. },
  395. {
  396. field: 'create_time',
  397. title: '项目创建日期',
  398. align: 'center',
  399. width: 180,
  400. },
  401. {
  402. field: 'project_dead_time',
  403. title: '项目归档日期',
  404. align: 'center',
  405. width: 120,
  406. templet: function (d) {
  407. if (d.project_dead_time) {
  408. return layui.util.toDateString(d.project_dead_time * 1000, "yyyy-MM-dd")
  409. } else {
  410. return "";
  411. }
  412. }
  413. },
  414. {fixed: 'right', title: '操作', align: 'center', width: 170, toolbar: '#barDemo'},
  415. ]
  416. ]
  417. });
  418. //监听表头工具栏事件
  419. table.on('toolbar(cost_project)', function (obj) {
  420. if (obj.event === 'add') {
  421. tool.side("/admin/project.cost_company/add");
  422. return false;
  423. }
  424. });
  425. //监听表格行工具事件
  426. table.on('tool(cost_project)', function (obj) {
  427. var data = obj.data;
  428. if (obj.event === 'read') {
  429. tool.side('/admin/project.cost_company/read?id=' + obj.data.id);
  430. } else if (obj.event === 'edit') {
  431. if (obj.data.project_status < 6) {
  432. tool.side('/admin/project.cost_company/edit?id=' + obj.data.id);
  433. } else {
  434. layer.msg("已归档/已退审")
  435. }
  436. } else if (obj.event === 'finish') {
  437. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  438. var ttxx = layer.prompt({
  439. title: '请输入<span style="color: red">归档</span>原因',
  440. formType: 2,
  441. area: ['35vw', '15vw']
  442. }, function (text, index) {
  443. let callback = function (e) {
  444. window.location.reload()
  445. layer.msg(e.msg);
  446. setTimeout(function () {
  447. layer.close(index);
  448. }, 2000)
  449. }
  450. if (text !== "") {
  451. tool.post("/admin/project.cost_company/finish", {
  452. id: data.id,
  453. finish_reason: text
  454. }, callback);
  455. } else {
  456. layer.msg("归档原因不能为空")
  457. }
  458. });
  459. } else {
  460. layer.msg("已归档/已退审")
  461. }
  462. } else if (obj.event === 'dismissal') {
  463. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  464. var ttxx = layer.prompt({
  465. title: '请输入<span style="color: red">退审</span>原因',
  466. formType: 2,
  467. area: ['35vw', '15vw']
  468. }, function (text, index) {
  469. let callback = function (e) {
  470. window.location.reload()
  471. layer.msg(e.msg);
  472. setTimeout(function () {
  473. layer.close(index);
  474. }, 2000)
  475. }
  476. if (text !== "") {
  477. tool.post("/admin/project.cost_company/dismissal", {
  478. id: data.id,
  479. dismissal_reason: text,
  480. }, callback);
  481. } else {
  482. layer.msg("退审原因不能为空")
  483. }
  484. });
  485. } else {
  486. layer.msg("已归档/已退审")
  487. }
  488. } else if (obj.event === 'more') {
  489. // 更多 - 下拉菜单
  490. dropdown.render({
  491. elem: this, // 触发事件的 DOM 对象
  492. show: true, // 外部事件触发即显示
  493. data: [
  494. {
  495. title: '状态',
  496. id: 'set_status',
  497. templet: function () {
  498. return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="set_status" class="dropbtn">状态</button>';
  499. }
  500. },{
  501. title: '归档',
  502. id: 'finish',
  503. templet: function () {
  504. return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="finish" class="dropbtn">归档</button>';
  505. }
  506. }, {
  507. title: '退审',
  508. id: 'dismissal',
  509. templet: function () {
  510. return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="dismissal" class="dropbtn">退审</button>';
  511. }
  512. }
  513. ],
  514. click: function (menudata) {
  515. if (menudata.id === 'finish') {
  516. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  517. var ttxx = layer.prompt({
  518. title: '请输入<span style="color: red">归档</span>原因',
  519. formType: 2,
  520. area: ['35vw', '15vw']
  521. }, function (text, index) {
  522. let callback = function (e) {
  523. window.location.reload()
  524. layer.msg(e.msg);
  525. setTimeout(function () {
  526. layer.close(index);
  527. }, 2000)
  528. }
  529. if (text !== "") {
  530. tool.post("/admin/project.cost_company/finish", {
  531. id: data.id,
  532. finish_reason: text
  533. }, callback);
  534. } else {
  535. layer.msg("归档原因不能为空")
  536. }
  537. });
  538. } else {
  539. layer.msg("已归档/已退审")
  540. }
  541. } else if (menudata.id === 'dismissal') {
  542. if (obj.data.project_status == 5 || obj.data.project_status == 4) {
  543. var ttxx = layer.prompt({
  544. title: '请输入<span style="color: red">退审</span>原因',
  545. formType: 2,
  546. area: ['35vw', '15vw']
  547. }, function (text, index) {
  548. let callback = function (e) {
  549. window.location.reload()
  550. layer.msg(e.msg);
  551. setTimeout(function () {
  552. layer.close(index);
  553. }, 2000)
  554. }
  555. if (text !== "") {
  556. tool.post("/admin/project.cost_company/dismissal", {
  557. id: data.id,
  558. dismissal_reason: text,
  559. }, callback);
  560. } else {
  561. layer.msg("退审原因不能为空")
  562. }
  563. });
  564. } else {
  565. layer.msg("已归档/已退审")
  566. }
  567. }else if (menudata.id === 'set_status') {
  568. setStatus(data.id);
  569. }
  570. },
  571. align: 'center', // 右对齐弹出
  572. style: 'min-width: 0px' // 设置额外样式
  573. })
  574. }
  575. return false;
  576. });
  577. function setStatus(project_id) {
  578. layer.open({
  579. title: '选择状态',
  580. type:1,
  581. area: ['480px', '336px'],
  582. content: '<div class="picker-table"><div id="boxselect"></div></div>',
  583. success: function() {
  584. table_a = table.render({
  585. elem: '#boxselect',
  586. cols: [
  587. [{
  588. type: 'radio',
  589. title: '选择',
  590. width: 100
  591. }, {
  592. field: 'title',
  593. title: '状态'
  594. }]
  595. ],
  596. data: [{
  597. "type": "0",
  598. "title": "初稿中"
  599. },{
  600. "type": "1",
  601. "title": "对数中"
  602. }, {
  603. "type": "2",
  604. "title": "审定中"
  605. }]
  606. });
  607. },
  608. btn:['确定'],
  609. yes: function(index) {
  610. var checkStatus = table.checkStatus(table_a.config.id);
  611. var data = checkStatus.data;
  612. console.log(checkStatus,data);
  613. if (data.length > 0) {
  614. let callbacl = function (e) {
  615. layui.pageTable.reload();
  616. layer.msg(e.msg)
  617. }
  618. data = {project_id:project_id,report_status:data[0].type}
  619. tool.post("/admin/project.api/set_status",data,callbacl);
  620. layer.close(index);
  621. }
  622. else{
  623. layer.msg('选择合同性质');
  624. }
  625. }
  626. })
  627. }
  628. //监听搜索提交
  629. form.on('submit(webform)', function (data) {
  630. console.log(data.field)
  631. layui.pageTable.reload({where: data.field});
  632. return false;
  633. });
  634. form.on('submit(reset1)', function () {
  635. $(".layui-form").reset();
  636. layui.pageTable.reload();
  637. return false;
  638. });
  639. layui.use(['form', 'jquery'], function () {
  640. var form = layui.form;
  641. const $ = layui.jquery;
  642. let adress;
  643. $.ajax({
  644. type: "get", //使用get方式
  645. url: "/static/assets/layui/adress.json", //json文件相对于这个HTML的路径
  646. dataType: "json",
  647. async: false,
  648. success: function (data) {
  649. //这个data就是json数据
  650. adress = data
  651. var province = Object.keys(adress)
  652. var proStrs = '<option value="">省</option>';
  653. for (var i = 0; i < province.length; i++) {
  654. proStrs += '<option value="' + province[i] + '">' + province[i] + '</option>';
  655. }
  656. $("#province").html(proStrs);
  657. layui.form.render("select")
  658. },
  659. error: function () {
  660. layui.alert("地址请求失败!! ");
  661. }
  662. });
  663. function getFirstAttr(obj) {
  664. for (var k in obj) return k;
  665. }
  666. function selectOption(selectedProvince, selectedCity = '', selectedArea = '') {
  667. var proStr = '<option value="">省</option>', cityStr = '<option value="">市</option>',
  668. areaStr = '<option value="">县</option>';
  669. var pro = adress[selectedProvince], ci = adress[selectedProvince][selectedCity];
  670. for (var province in adress) {
  671. if (province == selectedProvince) proStr += '<option value="' + province + '" selected>' + province + '</option>';
  672. else proStr += '<option value="' + province + '">' + province + '</option>';
  673. }
  674. $("#province").html(proStr);
  675. for (var city in pro) {
  676. if (city == selectedCity) cityStr += '<option value="' + city + '" selected>' + city + '</option>';
  677. else cityStr += '<option value="' + city + '">' + city + '</option>';
  678. }
  679. $("#city").html(cityStr);
  680. for (var area in ci) {
  681. if (area == "remove") {
  682. continue;
  683. }
  684. if (ci[area] == selectedArea) areaStr += '<option value="' + ci[area] + '" selected>' + ci[area] + '</option>';
  685. else areaStr += '<option value="' + ci[area] + '">' + ci[area] + '</option>';
  686. }
  687. $("#area").html(areaStr);
  688. form.render();
  689. }
  690. /*selectOption(1,2, 3);*/
  691. form.on('select(province)', function (data) {
  692. let thisProvince = data.value;
  693. let thisCity = getFirstAttr(adress[thisProvince]);
  694. selectOption(data.value);
  695. });
  696. form.on('select(city)', function (data) {
  697. selectOption($("#province").val(), data.value, getFirstAttr(data.value));
  698. });
  699. window.hongdianselect = function () {
  700. let num = $(document).find('.hongdian').length
  701. console.log(num, '我是数量')
  702. if (num === 0) {
  703. parent.showhongdian()
  704. console.log('2执行了')
  705. }
  706. }
  707. })
  708. }
  709. </script>
  710. {/block}
  711. <!-- /脚本 -->