dep_ps.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8">
  4. <meta name="viewport" content="widtd=device-widtd, initial-scale=1.0">
  5. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  6. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
  7. <link rel="stylesheet" type="text/css" href="/static/css/layer.css">
  8. <link rel="stylesheet" type="text/css" href="/static/css/css.css">
  9. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
  10. <link rel="stylesheet" type="text/css" href="/static/css/macf.css">
  11. <script src="/static/js/jquery.min.js"></script>
  12. <script src="/static/js/bootstrap.min.js"></script>
  13. <script src="/static/js/vue-2.4.0.js"></script>
  14. <script src="/static/js/axios.min.js"></script>
  15. <!-- 用户操作cookie -->
  16. <script src="/static/js/vue-Cookies.js"></script>
  17. <!-- 下拉搜索插件 -->
  18. <script type="text/javascript" src="/static/js/jquery.select.js"></script>
  19. <script src="/static/js/bootstrap-select_new.js"></script>
  20. <script src="/static/js/layer.js"></script>
  21. <title>Document</title>
  22. </head>
  23. <body>
  24. <div id="app">
  25. <!-- navbar-default这个类是设置导航栏 -->
  26. <div class="navbar navbar-default">
  27. <div class="container">
  28. <!-- navbar-header用于设置内容横向显示 -->
  29. <div class="navbar-header">
  30. <a href="/index" class="navbar-brand"></a>
  31. </div>
  32. <!-- navbar-nav用来设置横向显示 -->
  33. <!-- navbar-right用来设置右浮动 -->
  34. <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
  35. <div class="hidden-xs">
  36. <ul class="nav navbar-nav">
  37. <li class="dropdown">
  38. <!--订单一览表-->
  39. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  40. 订单一览表
  41. <b class="caret"></b>
  42. </a>
  43. <ul class="nav dropdown-menu">
  44. <li><a href="/index">订单一览表</a></li>
  45. </ul>
  46. </li>
  47. <li class="dropdown">
  48. <!--月度产能评估表-->
  49. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  50. 月度产能评估表
  51. <b class="caret"></b>
  52. </a>
  53. <ul class="nav dropdown-menu">
  54. <li><a href="/depps">月度产能评估表</a></li>
  55. <li><a href="/dessettingtm">车间标准产能设置</a></li>
  56. </ul>
  57. </li>
  58. <li class="dropdown">
  59. <!--月度主排程计划-->
  60. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  61. 月度主排程计划
  62. <b class="caret"></b>
  63. </a>
  64. <ul class="nav dropdown-menu">
  65. <li><a href="/depps">计划主交期</a></li>
  66. <li><a href="#">计划部门交期</a></li>
  67. </ul>
  68. </li>
  69. <li class="dropdown">
  70. <!--ie文件号管理-->
  71. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  72. IE工艺文件号管理
  73. <b class="caret"></b>
  74. </a>
  75. <ul class="nav dropdown-menu">
  76. <li><a href="/iefiletm">新增IE工艺文件号</a></li>
  77. <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
  78. <li><a href="/iefilemaintaindetail">IE效率明细表</a></li>
  79. <li><a href="#">IE效率统计表</a></li>
  80. </ul>
  81. </li>
  82. </ul>
  83. <ul class="nav navbar-nav navbar-right">
  84. <li v-if="username !=''">
  85. <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
  86. </li>
  87. <li v-else><a href="">请登录</a></li>
  88. <li><a href="/logout/" @click="logout()">退出登录</a></li>
  89. </ul>
  90. </div>
  91. </div>
  92. </div>
  93. <!--搜索-->
  94. <div class="filter">
  95. <div class="container ">
  96. <label>
  97. <div class="navbar-nav">查询日期起:</div>
  98. <div class="navbar-nav"><input type='date' class="input form-control" v-model="data_timeqi" /></div>
  99. </label>
  100. <label>
  101. <div class="navbar-nav">查询日期止:</div>
  102. <div class="navbar-nav"><input type='date' class="input form-control" v-model="data_timezhi" />
  103. </div>
  104. </label>
  105. <label>
  106. <div class="navbar-nav">部门:</div>
  107. <div class="navbar-nav">
  108. <input class="input form-control" id="testInput" type="text" autocomplete="off" />
  109. </div>
  110. </label>
  111. <label>
  112. <div class="navbar-nav">单号:</div>
  113. <div class="navbar-nav">
  114. <input class="input form-control" id="testInput2" type="text" autocomplete="off" />
  115. </div>
  116. </label>
  117. <label class="save def" id="def">
  118. <div class="btn btn-primary navbar-nav" @click="seek()">确定查询</div>
  119. </label>
  120. </div>
  121. </div>
  122. <!-- 内容 -->
  123. <!-- container这个类是设置居中对齐 -->
  124. <div class="container">
  125. <button class="btn btn-primary" data-toggle="modal" data-target="#myModal" @click="newly()">新增</button>
  126. <div class="modal fade" id="myModal">
  127. <div class="modal-dialog">
  128. <div class="modal-content" style="width: 300px;">
  129. <!-- 这里是标题 -->
  130. <div class="modal-header">
  131. <div class="modal-title">新增月度排产</div>
  132. </div>
  133. <!-- 这里是内容 -->
  134. <div class="modal-body">
  135. <table>
  136. <tr>
  137. <td>灌装生产线:
  138. <input class="input form-control" id="testInput1" type="text"
  139. autocomplete="off" />
  140. </td>
  141. </tr>
  142. <tr>
  143. <td>单据日期:
  144. <input type='date' class="input form-control" v-model="data_time_no" />
  145. </td>
  146. </tr>
  147. </table>
  148. </div>
  149. <!-- 这里是确定否 -->
  150. <div class="modal-footer">
  151. <button class="btn btn-primary" data-dismiss="modal" @click="add_dep_data()">确定</button>
  152. <button class="btn btn-primary" data-dismiss="modal">取消</button>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <button class="btn btn-primary abc" @click="add_no()" disabled="disabled">保存</button>
  158. <button class="btn btn-primary update" @click="update()" disabled="disabled">修改</button>
  159. <button class="btn btn-primary del" @click=del('','','','',data_list) disabled="disabled">删除</button>
  160. <label>
  161. <div class="input">
  162. 单号:<input type="text" v-model="monthly_odd_new" disabled="disabled">
  163. </div>
  164. </label>
  165. <label>
  166. <div class="input">
  167. 日期:<input type='date' v-model="data_time_no" disabled="disabled">
  168. </div>
  169. </label>
  170. <table class="table table-bordered table-hover table-striped">
  171. <tbody>
  172. <tr>
  173. <td class="macf_01">序号</td>
  174. <td class="macf_022">单号</td>
  175. <td class="macf_02">产线</td>
  176. <td class="macf_03">产线名称</td>
  177. <td class="macf_04">未完工数量</td>
  178. <td class="macf_05">标准/满线日产能</td>
  179. <td class="macf_07">订单可维持天数</td>
  180. <td class="macf_06">标准直接人员配置</td>
  181. <td class="macf_08">现有产能</td>
  182. <td class="macf_09">现有生产线/人员</td>
  183. <td class="macf_10">现有配置可生产天数</td>
  184. <td class="macf_11">现有辅助工人</td>
  185. <td class="macf_18">现有直接工人</td>
  186. <td class="macf_12">现有出勤人员合计</td>
  187. <td class="macf_13">直接工人274小时/25天</td>
  188. <td class="macf_14">按274小时/25天</td>
  189. <td class="macf_15">计划新增人员配置</td>
  190. <td class="macf_16">需求工时</td>
  191. <td class="macf_17">按25个工作日计算人员需求</td>
  192. <td class="macf_19">人员缺口</td>
  193. <td class="macf_20">编制</td>
  194. <td class="macf_21">备注</td>
  195. <td class="macf_22">操作</td>
  196. </tr>
  197. <tr class="save" v-for="(item,i) in data_list" :key="item.DEP_DEP"
  198. :class="i == activeIndex?'tr_active':''">
  199. <!--这里是序号-->
  200. <td class="macf_01" v-text="i+1"></td>
  201. <!-- 单号 -->
  202. <td class="macf_022" v-text="item.no"></td>
  203. <!--产线-->
  204. <td class="macf_02" v-text="item.dep"></td>
  205. <!--产线名称-->
  206. <td class="macf_03" v-text="item.dep_name"></td>
  207. <!--未完工数量-->
  208. <td class="macf_04"><input class="macf_04 macf_td" type="number" v-model="item.un_qty"
  209. disabled="disabled"></td>
  210. <!--标准/满线日产能-->
  211. <td class="macf_05"><input class="macf_05 macf_td" type="number" min="0"
  212. v-model="item.s_capacity"></td>
  213. <!--订单可维持天数-->
  214. <td class="macf_07"><input class="macf_07 macf_td" type="number" min="0"
  215. v-bind:value="Number(item.un_qty)/Number(item.s_capacity) | rounding"
  216. disabled="disabled"></td>
  217. <!--标准直接人员配置-->
  218. <td class="macf_06"><input class="macf_06 macf_td" type="number" min="0"
  219. v-model="item.s_d_staffing">
  220. </td>
  221. <!--现有产能-->
  222. <td class="macf_08"><input class="macf_08 macf_td" type="number" min="0"
  223. v-model="item.e_capacity"></td>
  224. <!--现有生产线/人员-->
  225. <td class="macf_09"><input class="macf_09 macf_td" type="number" min="0"
  226. v-model="item.epl_personnel">
  227. </td>
  228. <!--现有配置可生产天数-->
  229. <td class="macf_10"><input class="macf_10 macf_td" type="number"
  230. v-bind:value="Number(item.un_qty)/Number(item.e_capacity) | rounding"
  231. disabled="disabled"></td>
  232. <!--现有辅助工人-->
  233. <td class="macf_11"><input class="macf_11 macf_td" type="number" min="0"
  234. v-model="item.e_a_workers">
  235. </td>
  236. <!--现有直接工人-->
  237. <td class="macf_18"><input class="macf_18 macf_td" type="number" min="0"
  238. v-model="item.e_d_workers">
  239. </td>
  240. <!--现有出勤人员合计-->
  241. <td class="macf_12"><input class="macf_12 macf_td" type="number"
  242. v-bind:value="Number(item.e_a_workers)+Number(item.e_d_workers) | rounding"
  243. disabled="disabled"></td>
  244. <!--直接工人274小时/25天-->
  245. <td class="macf_13"><input class="macf_13 macf_td" type="number"
  246. v-bind:value="(Number(item.ok_qty)/(Number(item.s_capacity)+Number(item.s_d_staffing)))/25 | rounding"
  247. disabled="disabled"></td>
  248. <!--按274小时/25天-->
  249. <td class="macf_14"><input class="macf_14 macf_td" type="number"
  250. v-bind:value="(Number(item.ok_qty)/(Number(item.s_capacity)+Number(item.s_d_staffing)))/25+Number(item.e_a_workers) | rounding"
  251. disabled="disabled"></td>
  252. <!--计划新增人员配置-->
  253. <td class="macf_15"><input class="macf_15 macf_td" type="number"
  254. v-bind:value="(Number(item.ok_qty)/(Number(item.s_capacity)+Number(item.s_d_staffing)))/25-Number(item.e_d_workers) | rounding"
  255. disabled="disabled"></td>
  256. <!--需求工时-->
  257. <td class="macf_16"><input class="macf_16 macf_td" type="number"
  258. v-bind:value="Number(item.s_d_staffing)*(Number(item.un_qty)/Number(item.s_capacity))*11 | rounding"
  259. disabled="disabled"></td>
  260. <!--按25个工作日计算人员需求-->
  261. <td class="macf_17"><input class="macf_17 macf_td" type="number"
  262. v-bind:value="Number(item.s_d_staffing)*(Number(item.un_qty)/Number(item.s_capacity))*11/274*1.2 | rounding"
  263. disabled="disabled"></td>
  264. <!--人员缺口-->
  265. <td class="macf_19"><input class="macf_19 macf_td" type="number"
  266. v-bind:value="Number(item.s_d_staffing)*(Number(item.un_qty)/Number(item.s_capacity))*11/274*1.2-item.e_d_workers | rounding"
  267. disabled="disabled"></td>
  268. <!--编制-->
  269. <td class="macf_20"><input class="macf_20 macf_td" type="text" v-model="item.a_strength"></td>
  270. <!--备注-->
  271. <td class="macf_21"><textarea class="macf_21 macf_td" rows="1" cols="10"
  272. v-model="item.rem"></textarea></td>
  273. <!--操作-->
  274. <td class="macf_22"><button class="btn btn-primary row_del"
  275. @click="del(i,item.dep,item.no,item.itm,'')">删除</button></td>
  276. </tr>
  277. </tbody>
  278. </table>
  279. </div>
  280. <div class="footer">
  281. 分页
  282. </div>
  283. </div>
  284. <script>
  285. var vm = new Vue({
  286. el: '#app',
  287. data: {
  288. username: '', //用户名
  289. data_timeqi: '', //用户查询日期起
  290. data_timezhi: '', //用户查询日期止
  291. activeIndex: 0, //用于设置选择表格行变化颜色
  292. DEP_QTY: 0, //sum()函数测试计算用
  293. DEP_CN: 0, //sum()函数测试计算用
  294. qty: 0, //sum()函数测试计算用
  295. add_date: [], //用于监控测试
  296. data_list: [], //用户新增查询部门得到的数据保存
  297. monthly_odd_new: '保存显示', //用于前台单号的显示与否
  298. data_time_no: '', //单据日期
  299. activeIndex: 0, //激活选中tr的颜色变化
  300. mo_no: '', //重构开始
  301. dep: '', //车间部门
  302. dep_name: '', //车间部门名称
  303. no: '', // 单号
  304. dd: '', //单据日期
  305. un_qty: 0, //未完工数量
  306. s_capacity: 0, //标准/满线日产能
  307. s_d_staffing: 0, //标准直接人员配置
  308. tolf_days: 0, //订单可维持天数
  309. e_capacity: 0, //现有产能
  310. epl_personnel: 0, //现有生产线/人员
  311. p_d_f_e_configurations: 1, //现有配置可生产天数
  312. a_strength: '', //编制
  313. e_a_workers: 0, //现在有辅助工人
  314. work_sum: 0, //现有出勤人员合计
  315. zj_274_24: 0, //直接工人按按274小时/25天配置人员
  316. a_274_24: 0, //按274小时/25天配置人员
  317. new_personnel: 0, //计划新增人员配置
  318. rem: '', //备注
  319. need_hours: 0, //需求工时
  320. a_25: 0, //按25个工作日计算人员需求
  321. e_d_workers: 0, //现有直接工人
  322. p_gap: 0, //人员缺口
  323. },
  324. mounted() {
  325. // 获取登录名
  326. // this.username=getCookie('username');
  327. this.username = $cookies.get('username')
  328. // console.log($cookies.get('username'))
  329. },
  330. methods: {
  331. // 根据部门查询后台数据
  332. add_dep_data() {
  333. // 获取搜索框的值
  334. var serch_var = $("#testInput1").val()
  335. // alert('qq')
  336. if (serch_var == '' | typeof serch_var === 'undefined') {
  337. alert("请选择部门")
  338. return
  339. }
  340. if (serch_var == '') {
  341. alert("部门没选择上")
  342. return
  343. }
  344. axios.get('/depmacfdepdata/', {
  345. params: {
  346. dep: serch_var
  347. }
  348. })
  349. .then(res => {
  350. // alert(res.data)
  351. var itm = res.data.data
  352. for (let i in itm) {
  353. this.data_list.push(itm[i])
  354. };
  355. })
  356. .catch(err => {
  357. alert(err.response["data"] + err.response["status"])
  358. })
  359. },
  360. // 保存单据
  361. add_no() {
  362. //获取单号
  363. // 判断有没有数据
  364. if (this.data_list.length == 0) {
  365. alert('表身没有数据可保存');
  366. return
  367. }
  368. if (this.monthly_odd_new !== '') {
  369. {
  370. axios.post('/depmacf/', {
  371. data: {
  372. data_list: this.data_list,
  373. data_time_no: this.data_time_no
  374. }
  375. })
  376. .then(res => {
  377. // alert(res.data)
  378. var data1 = res.data.data
  379. this.monthly_odd_new = data1
  380. $(".abc").attr("disabled", "disabled");
  381. //移除修改按钮禁止效果disabled
  382. $('.update').removeAttr('disabled')
  383. //移除删除按钮禁止效果disabled
  384. $('.del').removeAttr('disabled')
  385. alert("保存成功")
  386. })
  387. .catch(err => {
  388. alert(err.response["data"] + err.response["status"])
  389. })
  390. }
  391. }
  392. console.log(this.add_date)
  393. //设置保存按钮为禁止
  394. this.monthly_odd_new = '保存显示'
  395. //
  396. },
  397. // 获取每一行的计算栏位qty
  398. qty_sum(i) {
  399. this.add_date[i]["qty"] = Number(this.add_date[i]["DEP_QTY"]) + Number(this.add_date[i]["DEP_CN"])
  400. console.log(this.add_date[i]["qty"])
  401. },
  402. // 修改操作
  403. update() {
  404. console.log(this.data_list)
  405. axios.put('/depmacf/', {
  406. data: {
  407. data: this.data_list
  408. }
  409. })
  410. .then(res => {
  411. // alert(res.data)
  412. console.log("修改成功")
  413. // this.data_list='';
  414. })
  415. .catch(err => {
  416. alert(err.response["data"] + err.response["status"])
  417. })
  418. },
  419. // 删除操作
  420. del(i, dep, no, itm, data) {
  421. // this.add_date.$remove(i);
  422. console.log(no)
  423. if (no == undefined) {
  424. this.data_list.splice(i, 1);
  425. return
  426. }
  427. axios.delete('/depmacf/', {
  428. data: {
  429. dep: dep,
  430. no: no,
  431. itm: itm,
  432. data: data
  433. }
  434. })
  435. .then(res => {
  436. // alert(res.data)
  437. console.log("删除成功")
  438. if (data !== '') {
  439. this.data_list = '';
  440. }
  441. else {
  442. this.data_list.splice(i, 1);
  443. }
  444. })
  445. .catch(err => {
  446. alert(err.response["data"] + err.response["status"])
  447. })
  448. },
  449. //新增
  450. newly() {
  451. // 如果是新增另外一张单的话那么清空数据
  452. if ($(".abc").prop("disabled") == true) {
  453. this.data_list = [];
  454. this.monthly_odd_new = '保存显示'
  455. }
  456. // 移除保存按钮禁止disabled效果
  457. $('.abc').removeAttr('disabled');
  458. //设置修改按钮为禁止效果
  459. $(".update").attr("disabled", "disabled");
  460. //设置删除按钮为禁止效果
  461. $(".del").attr("disabled", "disabled");
  462. },
  463. // 查询单据
  464. seek() {
  465. console.log('查询单据')
  466. // 获取搜索框的部门
  467. var serch_dep = $("#testInput").val()
  468. // 获取搜索框的单号
  469. var serch_no = $("#testInput2").val()
  470. console.log(serch_no)
  471. if (this.data_timeqi == '' & this.data_timezhi == '') {
  472. alert('请选择时间')
  473. return
  474. }
  475. axios.get('/depmacf/', {
  476. // params对象里面已键值对的形式放参数
  477. params: {
  478. "data_timeqi": this.data_timeqi,
  479. "data_timezhi": this.data_timezhi,
  480. "serch_dep": serch_dep,
  481. "serch_no": serch_no
  482. }
  483. }).then(res => {
  484. // 请求成功后的操作
  485. //设置保存按钮为禁止效果
  486. $(".abc").attr("disabled", "disabled");
  487. if (serch_no !== '') {
  488. //移除修改按钮禁止效果disabled
  489. $('.update').removeAttr('disabled')
  490. //移除删除按钮禁止效果disabled
  491. $('.del').removeAttr('disabled')
  492. }
  493. //设置删除行按钮为禁止效果
  494. // $(".row_del").attr("disabled", "disabled");
  495. this.data_list = ''
  496. var data = res.data.data
  497. this.data_list = data
  498. // console.log(this.data_list[0]["no"])
  499. // console.log(this.data_list)
  500. // console.log(res.data)
  501. }).catch(err => {
  502. //请求错误的处理
  503. alert(err.response["data"] + err.response["status"])
  504. })
  505. },
  506. //获取当前日期
  507. addDate() {
  508. var date = new Date();
  509. var seperator1 = "-";
  510. var year = date.getFullYear();
  511. var month = date.getMonth() + 1;
  512. var strDate = date.getDate();
  513. if (month >= 1 && month <= 9) {
  514. month = "0" + month;
  515. }
  516. if (strDate >= 0 && strDate <= 9) {
  517. strDate = "0" + strDate;
  518. }
  519. var currentdate = year + seperator1 + month + seperator1 + strDate;
  520. // console.log(currentdate)
  521. this.data_timezhi = this.data_timeqi = this.data_time_no = currentdate
  522. },
  523. //退出登录
  524. logout() {
  525. console.log("qweq")
  526. axios.delete('/login/', {
  527. params: {
  528. user_1: this.user_1,
  529. pswd: this.pswd,
  530. }
  531. })
  532. .then(res => {
  533. })
  534. .catch(err => {
  535. })
  536. },
  537. },
  538. filters: {
  539. rounding(value) {
  540. if (typeof value == "number") {
  541. return value.toFixed(2)
  542. }
  543. else {
  544. return "No Number!!!"
  545. }
  546. }
  547. },
  548. created() {
  549. this.addDate()
  550. },
  551. watch: {
  552. add_date(news, olds) {
  553. // console.log(news)
  554. // console.log(olds)
  555. }
  556. },
  557. });
  558. $(function () {
  559. // 开始写 jQuery 代码...
  560. var timer = null;
  561. // 定义一个公用的搜索接口
  562. function getStr(n, url, field, clickif) {
  563. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  564. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  565. var search = n
  566. // 配置路由
  567. if (typeof search === 'undefined') {
  568. search = ''
  569. };
  570. // console.log(search)
  571. axios.get(url, {
  572. params: {
  573. search_no: search
  574. }
  575. })
  576. .then(res => {
  577. // alert(res.data)
  578. var data1 = res.data.data
  579. datas = data1
  580. // console.log(datas)
  581. if (datas.length == 0) {
  582. alert("没有搜索到数据")
  583. return
  584. }
  585. $.selectSuggest(field, datas);
  586. // 是否第一次进入
  587. if (clickif !== 1) {
  588. $("#" + field).trigger("click");
  589. }
  590. })
  591. .catch(err => {
  592. console.log('error:' + err)
  593. })
  594. };
  595. //查询部门资料
  596. $("#testInput").bind("input propertychange", function (event) {
  597. var search = $("#testInput").val()
  598. // console.log($("#testInput1").val())
  599. timer && clearTimeout(timer);
  600. timer = setTimeout(function () {
  601. getStr(search, '/dept/', 'testInput');
  602. }, 1000);
  603. });
  604. getStr('', '/dept/', 'testInput', 1);
  605. // 点击新增时候灌装生产线资料获取
  606. $("#testInput1").bind("input propertychange", function (event) {
  607. var search = $("#testInput1").val()
  608. // console.log($("#testInput1").val())
  609. timer && clearTimeout(timer);
  610. timer = setTimeout(function () {
  611. getStr(search, '/dept/', 'testInput1');
  612. }, 1000);
  613. });
  614. //查询单号
  615. $("#testInput2").bind("input propertychange", function (event) {
  616. var search = $("#testInput2").val()
  617. // console.log($("#testInput1").val())
  618. timer && clearTimeout(timer);
  619. timer = setTimeout(function () {
  620. getStr(search, '/oddno/', 'testInput2');
  621. }, 1000);
  622. });
  623. getStr('', '/oddno/', 'testInput2', 1);
  624. });
  625. </script>
  626. </body>
  627. </html>