fun.ejs 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. <% include ./sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main">
  5. <h2>功能设置</h2>
  6. </div>
  7. </div>
  8. <div class="content-wrap">
  9. <div class="c-body">
  10. <div class="sjs-height-0">
  11. <div class="row m-0 mt-3">
  12. <div class="col-8">
  13. <div class=row>
  14. <div class="col-6">
  15. <div class="card mb-3">
  16. <div class="card-header d-flex justify-content-between">
  17. <div>台账分解</div>
  18. </div>
  19. <div class="card-body">
  20. <div class="form-group mb-1">
  21. <div>
  22. <div class="form-check">
  23. <input class="form-check-input" type="checkbox" id="pos_calc_detail" name="pos_calc_detail" <% if(ctx.subProject.page_show.posCalcDetail) { %>checked<% } %> onchange="updateSetting();">
  24. <label class="form-check-label" for="pos_calc_detail">设计量明细</label>
  25. </div>
  26. <div class="form-check">
  27. <input class="form-check-input" type="checkbox" id="ledger_ass" name="ledger_ass" <% if(funRela.ledgerAss) { %>checked<% } %> onchange="updateSetting();">
  28. <label class="form-check-label" for="ledger_ass">台账协同</label>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="col-6">
  38. <div class="card mb-3">
  39. <div class="card-header d-flex justify-content-between">
  40. <div>超计控制</div>
  41. </div>
  42. <div class="card-body">
  43. <div class="form-group mb-1">
  44. <div>
  45. <div class="form-check">
  46. <input class="form-check-input" type="checkbox" id="ban_over" name="ban_over" <% if (funRela.banOver) { %>checked<% } %> onchange="updateSetting();">
  47. <label class="form-check-label" for="ban_over">超计时限制上报审批/审批通过</label>
  48. </div>
  49. <div class="form-check">
  50. <input class="form-check-input" type="checkbox" id="hint_over" name="hint_over" <% if (funRela.hintOver) { %>checked<% } %> onchange="updateSetting();">
  51. <label class="form-check-label" for="hint_over">超计时标红显示</label>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="col-6">
  59. <div class="card mb-3">
  60. <div class="card-header d-flex justify-content-between">
  61. <div>变更令调用控制</div>
  62. </div>
  63. <div class="card-body">
  64. <div class="form-group mb-1">
  65. <div>
  66. <div class="form-check form-check-inline">
  67. <input class="form-check-input" type="checkbox" id="ban_minus_cb" name="ban_minus_cb" <% if (funRela.banMinusChangeBills) { %>checked<% } %> onchange="updateSetting();">
  68. <label class="form-check-label" for="ban_minus_cb">强制调用负变更(限制上报审批/审批通过)</label>
  69. </div>
  70. <div class="alert-warning p-1"><i class="fa Example of exclamation-circle fa-exclamation-circle "></i> 变更令开始调用后,负变更清单必须在本期全部调用</div>
  71. </div>
  72. <div>
  73. <div class="form-check form-check-inline">
  74. <input class="form-check-input" type="checkbox" id="minusNoValue" name="minusNoValue" <% if (funRela.minusNoValue) { %>checked<% } %> onchange="updateSetting();">
  75. <label class="form-check-label" for="minusNoValue">计量不计价</label>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="row">
  84. <div class="col-6">
  85. <div class="card mb-3">
  86. <div class="card-header d-flex justify-content-between">
  87. <div>合同支付</div>
  88. </div>
  89. <div class="card-body">
  90. <div class="form-group mb-1">
  91. <div>
  92. <div class="form-check">
  93. <input class="form-check-input" type="checkbox" id="lockPayExpr" name="lockPayExpr" <% if (funRela.lockPayExpr) { %>checked<% } %> onchange="updateSetting();">
  94. <label class="form-check-label" for="lockPayExpr">锁定往期带基数计算的合同支付项</label>
  95. </div>
  96. <div class="form-check">
  97. <input class="form-check-input" type="checkbox" id="showMinusCol" name="showMinusCol" <% if (funRela.showMinusCol) { %>checked<% } %> onchange="updateSetting();">
  98. <label class="form-check-label" for="showMinusCol">显示扣款列</label>
  99. </div>
  100. <div class="alert-warning p-1"><i class="fa Example of exclamation-circle fa-exclamation-circle "></i> 隐藏此列不会修改本期应付计算,旧项目请谨慎修改,防止误解</div>
  101. <div class="form-check">
  102. <input class="form-check-input" type="checkbox" id="closeWapYfSf" <% if (ctx.subProject.page_show.closeWapYfSf) { %>checked<% } %> onchange="updateSetting();">
  103. <label class="form-check-label" for="closeWapYfSf">wap关闭「本期支付」相关信息 <a href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="本期计量关联的“本期应付“、”本期实付”均不显示"><i class="fa fa-question-circle "></i></a></label>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="col-6">
  111. <div class="card mb-3">
  112. <div class="card-header d-flex justify-content-between">
  113. <div>中间计量模式设置</div>
  114. </div>
  115. <div class="card-body">
  116. <div class="form-group mb-1">
  117. <div>
  118. <% for (const i in imType) { %>
  119. <div class="form-check form-check-inline">
  120. <input class="form-check-input" type="radio" id="radio_<%- i %>" value="<%- imType[i].value %>" <% if (funRela.imType === imType[i].value) { %>checked<% } %> name="im_type" onchange="updateSetting();">
  121. <label class="form-check-label" for="radio_<%- i %>" name="im_type"><%- imType[i].name %></label>
  122. </div>
  123. <% } %>
  124. </div>
  125. <div class="mt-3">
  126. <label class="form-text alert alert-danger">切换模式,仅对未开始第一期计量的标段生效。</label>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="row">
  134. <div class="col-6">
  135. <div class="card mb-3 ">
  136. <div class="card-header d-flex justify-content-between">
  137. <div>计量期上报/审批</div>
  138. </div>
  139. <div class="card-body pb-2">
  140. <div class="form-group mb-1">
  141. <nav class="nav nav-tabs">
  142. <a class="nav-link nav-item active" data-toggle="tab" name="stage-setting" type="audit" onclick="changeSettingTab(this);">审批</a>
  143. <a class="nav-link nav-item" data-toggle="tab" name="stage-setting" type="start" onclick="changeSettingTab(this);">上报</a>
  144. <div class="ml-auto">
  145. <div class="custom-control custom-switch" id="switch-stage-start" style="display: none;">
  146. <input type="checkbox" class="custom-control-input" id="openStageStart" <% if(ctx.subProject.page_show.openStageStart) { %>checked<% } %> onchange="updateSetting();">
  147. <label class="custom-control-label" for="openStageStart"></label>
  148. </div>
  149. <div class="custom-control custom-switch" id="switch-stage-audit">
  150. <input type="checkbox" class="custom-control-input" id="openStageAudit" <% if(ctx.subProject.page_show.openStageAudit) { %>checked<% } %> onchange="updateSetting();">
  151. <label class="custom-control-label" for="openStageAudit"></label>
  152. </div>
  153. </div>
  154. </nav>
  155. <div class="tab-content my-2">
  156. <div class="tab-pane fade active show" id="stage-audit-tab" role="tabpanel" aria-labelledby="home-tab">
  157. <div class="input-group input-group-sm mt-2 col-6">
  158. <div class="input-group-prepend">
  159. <span class="input-group-text">预警:</span>
  160. </div>
  161. <input type="number" class="form-control" value="<%- ctx.subProject.page_show.stageAuditEarly %>" <% if(!ctx.subProject.page_show.openStageAudit) { %>disabled<% } %> id="stage-audit-early" oninput="limitDecimal(this);" min="0" max="30" onchange="updateSetting();">
  162. <div class="input-group-append">
  163. <span class="input-group-text">天</span>
  164. </div>
  165. </div>
  166. <div class="text-muted ml-4 mt-2"><small>审批停留时长符合设置天数(包含节假日),审批流程提醒为预警</small></div>
  167. <div class="input-group input-group-sm mt-2 col-6">
  168. <div class="input-group-prepend">
  169. <span class="input-group-text">紧急:</span>
  170. </div>
  171. <input type="number" class="form-control" value="<%- ctx.subProject.page_show.stageAuditWorry %>" <% if(!ctx.subProject.page_show.openStageAudit) { %>disabled<% } %> id="stage-audit-worry" oninput="limitDecimal(this);" min="0" max="30" onchange="updateSetting();">
  172. <div class="input-group-append">
  173. <span class="input-group-text">天</span>
  174. </div>
  175. </div>
  176. <div class="text-muted ml-4 mt-2"><small>审批停留时长符合设置天数(包含节假日),审批流程提醒为紧急</small></div>
  177. </div>
  178. <div class="tab-pane fade" id="stage-start-tab" role="tabpanel" aria-labelledby="profile-tab">
  179. <div class="input-group input-group-sm mb-2">
  180. <div class="input-group-prepend">
  181. <span class="input-group-text">开始日期:</span>
  182. <span class="input-group-text" style="width: 90px;padding-left: 12px;">每月</span>
  183. </div>
  184. <select class="form-control form-control-sm" id="start_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
  185. <option value="0">请选择日</option>
  186. <% for (let i = 1; i <= 31;i++) { %>
  187. <option value="<%- i %>" <% if (funSet.stage_start.start_day === i) {%>selected<% } %>><%- i %></option>
  188. <% } %>
  189. </select>
  190. <span class="text-danger mx-2"></span>
  191. </div>
  192. <div class="input-group input-group-sm mb-2">
  193. <div class="input-group-prepend">
  194. <span class="input-group-text">截止日期:</span>
  195. </div>
  196. <select class="form-control form-control-sm" id="end_month" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
  197. <option value="0">请选择月</option>
  198. <% for (const i of endMonth) { %>
  199. <option value="<%- i.val %>" <% if (funSet.stage_start.end_month === i.val) {%>selected<% } %> ><%- i.name %></option>
  200. <% } %>
  201. </select>
  202. <select class="form-control form-control-sm" id="end_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
  203. <option value="0">请选择日</option>
  204. <% for (let i = 1; i <= 31;i++) { %>
  205. <option value="<%- i %>" <% if (funSet.stage_start.end_day === i) {%>selected<% } %>><%- i %></option>
  206. <% } %>
  207. </select>
  208. <span class="text-danger mx-2"></span>
  209. </div>
  210. <div class="mt-3">
  211. <label class="form-text alert alert-danger">开启选项后,超出范围内的日期,则不允许上报期计量。</label>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <div class="col-6">
  220. <div class="card mb-3">
  221. <div class="card-header d-flex justify-content-between">
  222. <div>计量相关设置</div>
  223. </div>
  224. <div class="card-body">
  225. <div class="form-group mb-1">
  226. <div class="form-check form-check-inline">
  227. <input class="form-check-input" type="checkbox" id="openContractExpr" <% if (ctx.subProject.page_show.openContractExpr) { %>checked<% } %> onchange="updateSetting();">
  228. <label class="form-check-label" for="openContractExpr">开启「本期合同计量设置公式」</label>
  229. </div>
  230. </div>
  231. <div class="form-group mb-1">
  232. <div class="form-check form-check-inline">
  233. <input class="form-check-input" type="checkbox" id="close1stStageCheckDealParam" <% if (ctx.subProject.page_show.close1stStageCheckDealParam) { %>checked<% } %> onchange="updateSetting();">
  234. <label class="form-check-label" for="close1stStageCheckDealParam">关闭「开始第一期计量判断合同参数」功能</label>
  235. </div>
  236. </div>
  237. <div class="form-group mb-1">
  238. <div class="form-check form-check-inline">
  239. <input class="form-check-input" type="checkbox" id="openMultiStageCalc" <% if (ctx.subProject.page_show.openMultiStageCalc) { %>checked<% } %> onchange="updateSetting();">
  240. <label class="form-check-label" for="openMultiStageCalc">开启「待上报时,允许新增下一期」功能</label>
  241. </div>
  242. </div>
  243. <div class="form-group mb-1">
  244. <div class="form-check form-check-inline">
  245. <input class="form-check-input" type="checkbox" id="correctCalcContractTp" <% if (ctx.subProject.page_show.correctCalcContractTp) { %>checked<% } %> onchange="updateSetting();">
  246. <label class="form-check-label" for="correctCalcContractTp">开启「反算本期合同计量」功能</label>
  247. <a href="" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启此选项,清单最后一次合同计量,将反算本期合同计量金额"><i class="fa fa-question-circle "></i></a>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. <div class="row">
  255. <div class="col-6">
  256. <div class="card mb-3">
  257. <div class="card-header d-flex justify-content-between">
  258. <div>工程变更</div>
  259. </div>
  260. <div class="card-body">
  261. <div class="alert alert-dark py-1 px-2 mb-2" role="alert">
  262. 页面显示
  263. </div>
  264. <div class="form-group mb-1">
  265. <div class="form-check form-check-inline">
  266. <input class="form-check-input" type="checkbox" id="openChangeProject" <% if(ctx.subProject.page_show.openChangeProject) { %>checked<% } %> onchange="updateSetting(1);">
  267. <label class="form-check-label" for="openChangeProject">显示「变更立项」页面</label>
  268. </div>
  269. </div>
  270. <div class="form-group mb-1">
  271. <div class="form-check form-check-inline">
  272. <input class="form-check-input" type="checkbox" id="openChangeApply" <% if(ctx.subProject.page_show.openChangeApply) { %>checked<% } %> onchange="updateSetting(2);">
  273. <label class="form-check-label" for="openChangeApply">显示「变更申请」页面</label>
  274. </div>
  275. </div>
  276. <div class="form-group mb-1">
  277. <div class="form-check form-check-inline">
  278. <input class="form-check-input" type="checkbox" id="openChangePlan" <% if(ctx.subProject.page_show.openChangePlan) { %>checked<% } %> onchange="updateSetting(3);">
  279. <label class="form-check-label" for="openChangePlan">显示「变更方案」页面</label>
  280. </div>
  281. <a class="pull-right mr-3" href="#bgplan" data-toggle="modal" data-target="#bgplan">重命名</a>
  282. </div>
  283. <div class="alert alert-dark py-1 px-2 mb-2" role="alert">
  284. 功能设置
  285. </div>
  286. <div class="mb-1">
  287. <div class="form-check form-check-inline">
  288. <input class="form-check-input" type="checkbox" id="inlineCheckbox11" checked disabled>
  289. <label class="form-check-label" for="inlineCheckbox11">开启自定义变更类别</label>
  290. </div>
  291. <a class="pull-right mr-3" href="#bgclass" data-toggle="modal" data-target="#bgclass">设置</a>
  292. </div>
  293. <div class="mb-1">
  294. <div class="form-check form-check-inline">
  295. <input class="form-check-input" type="checkbox" id="openChangeState" <% if (ctx.subProject.page_show.openChangeState) { %>checked<% } %> onchange="updateSetting();">
  296. <label class="form-check-label" for="openChangeState">开启变更令状态功能 </label>&nbsp;
  297. <a href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="变更令提供临时、立项、批复状态,可设置计量上限"><i class="fa fa-question-circle "></i></a>
  298. </div>
  299. <a class="pull-right mr-3 <% if (!ctx.subProject.page_show.openChangeState) { %>text-secondary<% } %>" href="javascript:void(0);" id="openBgStatus">设置</a>
  300. </div>
  301. <div class="mb-1">
  302. <div class="form-check form-check-inline">
  303. <input class="form-check-input" type="checkbox" id="openChangeWhiteList" <% if (ctx.subProject.page_show.openChangeWhiteList) { %>checked<% } %> onchange="updateSetting();">
  304. <label class="form-check-label" for="openChangeWhiteList">开启“添加空白清单”功能</label>
  305. </div>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <div class="col-6" <% if (!ctx.subProject.page_show.openMaterial) { %>style="display: none;"<% } %>>
  311. <div class="card mb-3">
  312. <div class="card-header d-flex justify-content-between">
  313. <div>材料调差</div>
  314. </div>
  315. <div class="card-body">
  316. <div class="form-group mb-1">
  317. <div class="form-check form-check-inline">
  318. <input class="form-check-input" type="checkbox" id="openMaterialTax" <% if(ctx.subProject.page_show.openMaterialTax) { %>checked<% } %> onchange="updateSetting();">
  319. <label class="form-check-label" for="openMaterialTax">使用材料税</label>
  320. </div>
  321. </div>
  322. <div class="form-group mb-1">
  323. <div class="form-check form-check-inline">
  324. <input class="form-check-input" type="checkbox" id="openMaterialChecklist" <% if(ctx.subProject.page_show.openMaterialChecklist) { %>checked<% } %> onchange="updateSetting();">
  325. <label class="form-check-label" for="openMaterialChecklist">开启「批量设置调差清单」添加调差工料功能</label>
  326. </div>
  327. </div>
  328. <div class="form-group mb-1">
  329. <div class="form-check form-check-inline">
  330. <input class="form-check-input" type="checkbox" id="openMaterialSelf" <% if(ctx.subProject.page_show.openMaterialSelf) { %>checked<% } %> onchange="updateSetting();">
  331. <label class="form-check-label" for="openMaterialSelf">开启调差清单-所属项目节「单独添加工料」功能
  332. <a href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启该选项,调差清单的所属项目节,允许单独添加工料"><i class="fa fa-question-circle "></i></a></label>
  333. </div>
  334. </div>
  335. <div class="form-group mb-1">
  336. <div class="form-check form-check-inline">
  337. <input class="form-check-input" type="checkbox" id="openMaterialEditForAudit" <% if(ctx.subProject.page_show.openMaterialEditForAudit) { %>checked<% } %> onchange="updateSetting();">
  338. <label class="form-check-label" for="openMaterialEditForAudit">开启「审核人修改数据」功能
  339. <a href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启该选项,审核人允许修改部分调差工料数据"><i class="fa fa-question-circle "></i></a></label>
  340. </div>
  341. </div>
  342. <div class="form-group mb-1">
  343. <div class="form-check form-check-inline">
  344. <input class="form-check-input" type="checkbox" id="openMaterialStageRepeat" <% if(ctx.subProject.page_show.openMaterialStageRepeat) { %>checked<% } %> onchange="updateSetting();">
  345. <label class="form-check-label" for="openMaterialStageRepeat">开启「材料调差重复使用计量期」</label>
  346. </div>
  347. </div>
  348. <div class="form-group mb-1">
  349. <div class="form-check form-check-inline">
  350. <input class="form-check-input" type="checkbox" id="openMaterialListQty" <% if(ctx.subProject.page_show.openMaterialListQty) { %>checked<% } %> onchange="updateSetting();">
  351. <label class="form-check-label" for="openMaterialListQty">开启「修改调差数量」功能
  352. <a href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启该选项,可在调差清单页修改本期调差数量"><i class="fa fa-question-circle "></i></a></label>
  353. </div>
  354. </div>
  355. </div>
  356. </div>
  357. </div>
  358. </div>
  359. <div class="card mb-3">
  360. <div class="card-header d-flex justify-content-between">
  361. <div>项目进度</div>
  362. </div>
  363. <div class="card-body">
  364. <div class="form-group mb-4">
  365. <div>
  366. <div class="form-check form-check-inline">
  367. <input class="form-check-input" type="checkbox" id="budget_zb" name="budget_zb" <% if (funRela.budgetZb) { %>checked<% } %> onchange="updateSetting();">
  368. <label class="form-check-label" for="budget_zb">招标预算</label>
  369. </div>
  370. </div>
  371. <div>
  372. <div class="form-check form-check-inline">
  373. <input class="form-check-input" type="checkbox" id="budget_ctrl" name="budget_ctrl" <% if (funRela.budgetCtrl) { %>checked<% } %> onchange="updateSetting();">
  374. <label class="form-check-label" for="budget_ctrl">控制目标</label>
  375. </div>
  376. </div>
  377. <div>
  378. <div class="form-check form-check-inline">
  379. <input class="form-check-input" type="checkbox" id="budget_real" name="budget_real" <% if (funRela.budgetReal) { %>checked<% } %> onchange="updateSetting();">
  380. <label class="form-check-label" for="budget_real">实际投资</label>
  381. </div>
  382. </div>
  383. <div>
  384. <div class="form-check form-check-inline">
  385. <input class="form-check-input" type="checkbox" id="need_gcl" name="need_gcl" <% if (funRela.needGcl) { %>checked<% } %> onchange="updateSetting();">
  386. <label class="form-check-label" for="need_gcl">显示清单信息</label>
  387. </div>
  388. </div>
  389. <div class="mt-3">
  390. <label class="form-text alert alert-danger">做施工图三级清单预算时,请进行勾选。</label>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <div class="row">
  396. <div class="col-6">
  397. <div class="card mb-3">
  398. <div class="card-header d-flex justify-content-between">
  399. <div>成本管理</div>
  400. </div>
  401. <div class="card-body">
  402. <div class="alert alert-dark py-1 px-2 mb-2" role="alert">成本分析-关联成本类型</div>
  403. <div class="d-flex">
  404. <div class="form-check form-check-inline">
  405. <input class="form-check-input" type="radio" id="radio_ledger" value="ledger" <% if (funRela.costAnalysisType === 'ledger') { %>checked<% } %> name="cost_analysis_type" onchange="updateSetting();">
  406. <label class="form-check-label" for="radio_ledger">成本报审</label>
  407. </div>
  408. <div class="form-check form-check-inline">
  409. <input class="form-check-input" type="radio" id="radio_book" value="book" <% if (funRela.costAnalysisType === 'book') { %>checked<% } %> name="cost_analysis_type" onchange="updateSetting();">
  410. <label class="form-check-label" for="radio_book">财务账面</label>
  411. </div>
  412. <label class="form-text alert alert-warning py-1 px-2 mb-2"><i class="fa fa-exclamation-circle mr-1"></i>切换关联成本,对已创建的成本分析期数据无效。</label>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. </div>
  424. <script src="/public/js/setting.js"></script>
  425. <script>
  426. let changeClass = JSON.parse(unescape('<%- escape(JSON.stringify(funSet.change_class)) %>'));
  427. let changeState = JSON.parse(unescape('<%- escape(JSON.stringify(funSet.change_state)) %>'));
  428. const changeSettingTab = function(tab) {
  429. const type = tab.getAttribute('type');
  430. if (type === 'start') {
  431. $('#switch-stage-start').show();
  432. $('#switch-stage-audit').hide();
  433. $('#stage-start-tab').addClass('active').addClass('show');
  434. $('#stage-audit-tab').removeClass('active').removeClass('show');
  435. } else if (type === 'audit') {
  436. $('#switch-stage-start').hide();
  437. $('#switch-stage-audit').show();
  438. $('#stage-audit-tab').addClass('active').addClass('show');
  439. $('#stage-start-tab').removeClass('active').removeClass('show');
  440. }
  441. }
  442. $(() => {
  443. autoFlashHeight();
  444. $('#set_change_plan_btn').click(function () {
  445. updateSetting(false, 3);
  446. });
  447. // 自定义变更类别
  448. $('body').on('click', '#change_class_div input[type="checkbox"]', function () {
  449. if ($(this).is(':checked')) {
  450. $(this).parents('.input-group-prepend').siblings('input').removeAttr('readonly');
  451. } else {
  452. $(this).parents('.input-group-prepend').siblings('input').attr('readonly', true).val('');
  453. }
  454. });
  455. $('body').on('change', '#change_class_div input[type="text"]', function () {
  456. if ($(this).val().length > 8) {
  457. toastr.error('类别名称不能超过8个字符');
  458. }
  459. });
  460. $("#bgclass").on('show.bs.modal', function () {
  461. let html = '';
  462. for (const cc of changeClass) {
  463. html += `<div class="input-group input-group-sm mb-1">
  464. <div class="input-group-prepend">
  465. <div class="input-group-text">
  466. <input type="checkbox" value="${cc.value}" aria-label="Checkbox for following text input" ${cc.checked ? 'checked' : ''}>
  467. </div>
  468. <span class="input-group-text">${cc.name}</span>
  469. </div>
  470. <input type="text" class="form-control" value="${cc.new_name}" ${!cc.checked ? 'readonly' : ''} aria-label="Text input with checkbox" placeholder="">
  471. </div>`;
  472. }
  473. $('#change_class_div').html(html);
  474. });
  475. $('#set_change_class_btn').click(function () {
  476. updateSetting(false, 1);
  477. });
  478. $('#openBgStatus').click(function () {
  479. if ($('#openChangeState').is(':checked')) {
  480. $('#bgstatus').modal('show');
  481. }
  482. });
  483. $("#bgstatus").on('show.bs.modal', function () {
  484. let html = '';
  485. for (const cs of changeState) {
  486. html += `<tr data-order="${cs.order}">
  487. <td>${cs.name}</td>
  488. <td>
  489. <div class="input-group input-group-sm" style="width:90px">
  490. <input type="number" class="form-control" max="100" min="0" step="1" value="${cs.value}">
  491. <div class="input-group-append">
  492. <span class="input-group-text" id="set_change_state_btn">%</span>
  493. </div>
  494. </div>
  495. </td>
  496. </tr>`;
  497. }
  498. $('#change_state_table').html(html);
  499. });
  500. $('#set_change_state_btn').click(function () {
  501. if ($('#openChangeState').is(':checked')) {
  502. updateSetting(false, 2);
  503. } else {
  504. toastr.error('未开启变更令状态功能,不能设置计量上限默认值');
  505. }
  506. });
  507. });
  508. // 根据Min Max限制Input输入
  509. function limitInputMinMax (obj) {
  510. if (obj.max && _.toNumber(obj.value) > _.toNumber(obj.max)) {
  511. obj.value = obj.max;
  512. }
  513. if(obj.min && _.toNumber(obj.value) < _.toNumber(obj.min)) {
  514. obj.value = obj.min;
  515. }
  516. }
  517. // 根据Maxlength限制input输入
  518. function limitMaxLength (obj) {
  519. if (obj.maxLength >= 0 && obj.value.length > obj.maxLength) {
  520. obj.value = obj.value.substr(0, obj.maxLength);
  521. }
  522. }
  523. // 根据正则限制输入
  524. function limitReg(obj, reg) {
  525. obj.value = obj.value.replace(reg, '');
  526. }
  527. // 小数位数 input 输入限制
  528. function limitDecimal(obj) {
  529. limitReg(obj, /[^\d]/g);
  530. limitMaxLength(obj);
  531. limitInputMinMax(obj);
  532. }
  533. const updateSetting = function (tab = false, set_type = 0) {
  534. if (!$('#openChangeApply')[0].checked && $('#openChangeProject')[0].checked && tab === 1) {
  535. $('#openChangeApply').prop('checked', true);
  536. $('#openChangePlan').prop('checked', true);
  537. } else if (!$('#openChangeApply')[0].checked && $('#openChangeProject')[0].checked && tab === 2) {
  538. $('#openChangeProject').prop('checked', false);
  539. }
  540. if (!$('#openChangePlan')[0].checked && $('#openChangeApply')[0].checked && tab === 2) {
  541. $('#openChangePlan').prop('checked', true);
  542. } else if (!$('#openChangePlan')[0].checked && $('#openChangeApply')[0].checked && tab === 3) {
  543. $('#openChangeApply').prop('checked', false);
  544. $('#openChangeProject').prop('checked', false);
  545. }
  546. const pushData = {};
  547. if($('#openStageStart')[0].checked) {
  548. // 判断是否已选开始日,截止月日
  549. const startDay = parseInt($('#start_day').val());
  550. const endMonth = parseInt($('#end_month').val());
  551. const endDay = parseInt($('#end_day').val());
  552. let flag = false;
  553. if (startDay === 0) {
  554. $('#start_day').siblings('span').text('请选择日');
  555. flag = true;
  556. } else {
  557. $('#start_day').siblings('span').text('');
  558. }
  559. const endErrorMsg = [];
  560. if (endMonth === 0) {
  561. endErrorMsg.push('请选择月');
  562. flag = true;
  563. }
  564. if (endDay === 0) {
  565. endErrorMsg.push('请选择日');
  566. flag = true;
  567. }
  568. if (endErrorMsg.length > 0) {
  569. $('#end_day').siblings('span').text(endErrorMsg.join(' '));
  570. } else {
  571. // 本月截止日不允许小于开始日
  572. if (endMonth === 1 && startDay > endDay) {
  573. $('#end_day').siblings('span').text('截止日期选择不正确,请重新选择');
  574. flag = true;
  575. } else if (endMonth === 2 && startDay <= endDay){
  576. $('#end_day').siblings('span').text('次月截止日不允许大于开始日');
  577. flag = true;
  578. } else {
  579. $('#end_day').siblings('span').text('');
  580. }
  581. }
  582. if (flag) {
  583. $('#openStageStart')[0].checked = 0;
  584. $('#openStageStart').prop('checked', false);
  585. return;
  586. }
  587. pushData.stage_start = {
  588. start_day: startDay,
  589. end_month: endMonth,
  590. end_day: endDay,
  591. }
  592. $('#start_day').attr('disabled', true);
  593. $('#end_month').attr('disabled', true);
  594. $('#end_day').attr('disabled', true);
  595. } else {
  596. $('#start_day').removeAttr('disabled');
  597. $('#end_month').removeAttr('disabled');
  598. $('#end_day').removeAttr('disabled');
  599. }
  600. if ($('#openStageAudit')[0].checked) {
  601. $('#stage-audit-early').removeAttr('disabled');
  602. $('#stage-audit-worry').removeAttr('disabled');
  603. } else {
  604. $('#stage-audit-early').attr('disabled', 'disabled');
  605. $('#stage-audit-worry').attr('disabled', 'disabled');
  606. }
  607. if (set_type === 1) {
  608. // 自定义变更类别
  609. const change_class = [];
  610. let flag = false;
  611. let allUnchecked = true;
  612. $('#change_class_div .input-group').each(function () {
  613. const one_class = _.find(changeClass, { value: parseInt($(this).find('input[type="checkbox"]').val())});
  614. if ($(this).find('input[type="checkbox"]').is(':checked') && $(this).find('input[type="text"]').val().length > 8) {
  615. toastr.error(one_class.name + ' 类别名称字符不能超过8个');
  616. flag = true;
  617. }
  618. const new_name = $(this).find('input[type="checkbox"]').is(':checked') ? $(this).find('input[type="text"]').val() : '';
  619. if (new_name) {
  620. const classInfo = _.find(changeClass, function(item) {
  621. return item.name === new_name && item.value !== one_class.value;
  622. })
  623. if (classInfo) {
  624. toastr.error(one_class.name + '的类别名称不能与其他变更名称相同');
  625. flag = true;
  626. }
  627. if (_.findIndex(change_class, { new_name }) !== -1) {
  628. toastr.error(one_class.name + '的类别名称不能与其他类别名称相同');
  629. flag = true;
  630. }
  631. }
  632. if ($(this).find('input[type="checkbox"]').is(':checked')) {
  633. allUnchecked = false;
  634. }
  635. const one_updateClass = {
  636. value: one_class.value,
  637. name: one_class.name,
  638. new_name,
  639. checked: $(this).find('input[type="checkbox"]').is(':checked'),
  640. }
  641. change_class.push(one_updateClass);
  642. });
  643. if (flag) {
  644. return;
  645. }
  646. if (allUnchecked) {
  647. toastr.error('至少保留一个变更类别');
  648. return;
  649. }
  650. pushData.change_class = change_class;
  651. } else if (set_type === 2) {
  652. // 变更令状态功能-设置计量调用上限
  653. const change_state = [];
  654. let flag = false;
  655. const reg = /^(\d{1,2}|100)$/;
  656. $('#change_state_table tr').each(function () {
  657. const one_state = _.find(changeState, { order: parseInt($(this).attr('data-order'))});
  658. const value = parseFloat($(this).find('input[type="number"]').val());
  659. if (!(_.isNumber(value) && reg.test(value))) {
  660. toastr.error(one_state.name + '的计量上限默认值只能输入0-100之间的整数');
  661. flag = true;
  662. }
  663. const one_updateState = {
  664. order: one_state.order,
  665. name: one_state.name,
  666. value: value,
  667. }
  668. change_state.push(one_updateState);
  669. });
  670. if (flag) {
  671. return;
  672. }
  673. pushData.change_state = change_state;
  674. } else if (set_type === 3) {
  675. const name = $('#change_plan_name').val().trim();
  676. if (name.length > 5) {
  677. toastr.error('变更方案名称字符不能超过5个');
  678. return;
  679. }
  680. pushData.change_plan_name = name;
  681. }
  682. postData('/sp/<%- ctx.subProject.id %>/setting/fun/update', {
  683. imType: parseInt($('[name=im_type]:checked').val()),
  684. costAnalysisType: $('[name=cost_analysis_type]:checked').val(),
  685. banOver: $('[name=ban_over]')[0].checked,
  686. hintOver: $('#hint_over')[0].checked,
  687. banMinusChangeBills: $('[name=ban_minus_cb]')[0].checked,
  688. minusNoValue: $('[name=minusNoValue]')[0].checked,
  689. lockPayExpr: $('#lockPayExpr')[0].checked,
  690. showMinusCol: $('#showMinusCol')[0].checked,
  691. needGcl: $('#need_gcl')[0].checked,
  692. budgetZb: $('#budget_zb')[0].checked,
  693. budgetCtrl: $('#budget_ctrl')[0].checked,
  694. budgetReal: $('#budget_real')[0].checked,
  695. openChangeProject: $('#openChangeProject')[0].checked,
  696. openChangeApply: $('#openChangeApply')[0].checked,
  697. openChangePlan: $('#openChangePlan')[0].checked,
  698. openChangeWhiteList: $('#openChangeWhiteList')[0].checked,
  699. openChangeState: $('#openChangeState')[0].checked,
  700. openMaterialTax: $('#openMaterialTax')[0].checked,
  701. openMaterialChecklist: $('#openMaterialChecklist')[0].checked,
  702. openMaterialSelf: $('#openMaterialSelf')[0].checked,
  703. openMaterialEditForAudit: $('#openMaterialEditForAudit')[0].checked,
  704. openMaterialStageRepeat: $('#openMaterialStageRepeat')[0].checked,
  705. openMaterialListQty: $('#openMaterialListQty')[0].checked,
  706. openStageStart: $('#openStageStart')[0].checked,
  707. openContractExpr: $('#openContractExpr')[0].checked,
  708. correctCalcContractTp: $('#correctCalcContractTp')[0].checked,
  709. close1stStageCheckDealParam: $('#close1stStageCheckDealParam')[0].checked,
  710. openMultiStageCalc: $('#openMultiStageCalc')[0].checked,
  711. closeWapYfSf: $('#closeWapYfSf')[0].checked,
  712. addFunSet: _.size(pushData) !== 0 ? pushData : null,
  713. openStageAudit: $('#openStageAudit')[0].checked,
  714. stageAuditEarly: parseInt($('#stage-audit-early').val()),
  715. stageAuditWorry: parseInt($('#stage-audit-worry').val()),
  716. posCalcDetail: $('#pos_calc_detail')[0].checked ? 1 : 0,
  717. ledgerAss: $('#ledger_ass')[0].checked,
  718. }, function (result) {
  719. if ($('#openChangeState').is(':checked')) {
  720. $('#openBgStatus').removeClass('text-secondary');
  721. } else {
  722. $('#openBgStatus').addClass('text-secondary');
  723. }
  724. if (set_type === 1) {
  725. changeClass = pushData.change_class;
  726. toastr.success('设置成功');
  727. $('#bgclass').modal('hide');
  728. } else if (set_type === 2) {
  729. changeState = pushData.change_state;
  730. toastr.success('设置成功');
  731. $('#bgstatus').modal('hide');
  732. } else if (set_type === 3) {
  733. toastr.success('设置成功');
  734. window.location.reload();
  735. }
  736. });
  737. }
  738. </script>