order.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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/css.css">
  8. <!-- 加载动画 -->
  9. <link rel="stylesheet" type="text/css" href="/static/css/loader.css">
  10. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.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. <title>Document</title>
  21. </head>
  22. <body>
  23. <div id="demo"></div>
  24. <div id="app">
  25. <div class="navbar navbar-default">
  26. <div class="container">
  27. <!-- navbar-header用于设置内容横向显示 -->
  28. <div class="navbar-header">
  29. <a href="/index" class="navbar-brand"></a>
  30. </div>
  31. <!-- navbar-nav用来设置横向显示 -->
  32. <!-- navbar-right用来设置右浮动 -->
  33. <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
  34. <div class="hidden-xs">
  35. <ul class="nav navbar-nav" id="navbar-nav-left">
  36. <li class="dropdown">
  37. <!--订单一览表-->
  38. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  39. 订单一览表
  40. <b class="caret"></b>
  41. </a>
  42. <ul class="nav dropdown-menu">
  43. <li><a href="/index">订单一览表</a></li>
  44. </ul>
  45. </li>
  46. <li class="dropdown">
  47. <!--月度产能评估表-->
  48. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  49. 月度产能评估表
  50. <b class="caret"></b>
  51. </a>
  52. <ul class="nav dropdown-menu">
  53. <li><a href="/depps">月度产能评估表</a></li>
  54. <li><a href="/dessettingtm">车间标准产能设置</a></li>
  55. </ul>
  56. </li>
  57. <li class="dropdown">
  58. <!--月度主排程计划-->
  59. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  60. 月度主排程计划
  61. <b class="caret"></b>
  62. </a>
  63. <ul class="nav dropdown-menu">
  64. <li><a href="/pcydscjhtm">PC月度生产计划(N+7)</a></li>
  65. <li><a href="/ydzpcjhtm">月度主排程计划</a></li>
  66. <li><a href="/ympxqjhtm">研磨品需求计划</a></li>
  67. <li><a href="/btmbxqtm">表头模板需求</a></li>
  68. </ul>
  69. </li>
  70. <li class="dropdown">
  71. <!--ie文件号管理-->
  72. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  73. IE工艺文件号管理
  74. <b class="caret"></b>
  75. </a>
  76. <ul class="nav dropdown-menu">
  77. <li><a href="/iefiletm">新增IE工艺文件号</a></li>
  78. <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
  79. <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
  80. <li><a href="/iefilemaintaininfotm">IE效率统计表</a></li>
  81. </ul>
  82. </li>
  83. </ul>
  84. <ul class="nav navbar-nav navbar-right">
  85. <li v-if="username !=''">
  86. <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
  87. </li>
  88. <li v-else><a href="">请登录</a></li>
  89. <li><a href="/login/" @click="logout()">退出登录</a></li>
  90. </ul>
  91. </div>
  92. </div>
  93. </div>
  94. <!--搜索-->
  95. <div class="filter">
  96. <div class="container ">
  97. <label>
  98. <div class="navbar-nav">开始时间:</div>
  99. <div class="navbar-nav"><input type='date' class="input form-control" v-model="st_time" /></div>
  100. </label>
  101. <label>
  102. <div class="navbar-nav">结束时间:</div>
  103. <div class="navbar-nav"><input type='date' class="input form-control" v-model="sh_time" /></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="testInput1" type="text" autocomplete="off" />
  115. </div>
  116. </label>
  117. <label>
  118. <div class="navbar-nav">结案否:</div>
  119. <div class="navbar-nav">
  120. <select class="input form-control" v-model="cls_id">
  121. <option value="1" selected="selected">全部</option>
  122. <option value="2">结案</option>
  123. <option value="3">未结案</option>
  124. </select>
  125. </div>
  126. </label>
  127. <label>
  128. <div class="navbar-nav">是否回复:</div>
  129. <div class="navbar-nav">
  130. <select class="input form-control" v-model="pmc_ok">
  131. <option value="1">全部</option>
  132. <option value="2">已回复</option>
  133. <option value="3">未回复</option>
  134. </select>
  135. </div>
  136. </label>
  137. <label>
  138. <div class="navbar-nav">排序:</div>
  139. <div class="navbar-nav">
  140. <select class="input form-control" v-model="sort">
  141. <option value="1">单号</option>
  142. <option value="2">类别</option>
  143. <option value="3">客户</option>
  144. <option value="4">回复交期</option>
  145. </select>
  146. </div>
  147. </label>
  148. <label class="navbar-nav">
  149. <button class="btn btn-primary" data-toggle="modal" data-target="#myModal">更多</button>
  150. <div class="modal fade" id="myModal">
  151. <div class="modal-dialog">
  152. <div class="modal-content" style="width: 550px;">
  153. <div class="modal-header">
  154. <div class="modal-title">选择条件</div>
  155. </div>
  156. <div class="modal-body">
  157. <table>
  158. <tr>
  159. <td><span class="navbar-nav filtrate_w">业务交期:</span>
  160. <input type="date" class="navbar-nav filtrate" v-model="business_time">
  161. </td>
  162. <td><span class="navbar-nav filtrate_w">合并否:</span>
  163. <select class="input form-control filtrate" v-model="ifmerge">
  164. <option value="1">否</option>
  165. <option value="2">是</option>
  166. </select></td>
  167. </tr>
  168. <tr>
  169. <td><span class="navbar-nav filtrate_w">订单类别:</span>
  170. <select class="input form-control filtrate" v-model="os_type">
  171. <option value="1">全部</option>
  172. <option value="2">订单</option>
  173. <option value="3">返工单</option>
  174. </select>
  175. </td>
  176. <td><span class="navbar-nav filtrate_w">生产部门:</span>
  177. <input class="input form-control filtrate" id="testInput2" type="text"
  178. autocomplete="off" />
  179. </td>
  180. </tr>
  181. <tr>
  182. <td><span class="navbar-nav filtrate_w">容器:</span>
  183. <input type="text" class="input form-control filtrate" v-model="vessel">
  184. </td>
  185. <td><span class="navbar-nav filtrate_w">容量:</span>
  186. <input type="text" class="input form-control filtrate"
  187. v-model="capacity"></td>
  188. </tr>
  189. </table>
  190. </div>
  191. <div class="modal-footer">
  192. <button class="btn btn-primary" data-dismiss="modal">确定</button>
  193. <button class="btn btn-primary" data-dismiss="modal">取消</button>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </label>
  199. <!-- <label class="save" @click="seek()">确定查询</label> -->
  200. <label class="save def" id="def" @click="emptypage();seek(1)">
  201. <div class="btn btn-primary navbar-nav">确定查询</div>
  202. </label>
  203. <label class="save def">
  204. <div class="btn btn-primary navbar-nav" @click="exportaa()">导出数据</div>
  205. </label>
  206. </div>
  207. </div>
  208. <!-- 内容 -->
  209. <!-- container这个类是设置居中对齐 -->
  210. <div class="container">
  211. <!-- row这个类是用于设置取消内边距 -->
  212. <table class="table table-bordered table-hover table-striped">
  213. <tbody>
  214. <!-- <tr v-for="(item,i) in list" :key="item.OS_NO" style="background-color: yellowgreen;"> -->
  215. <tr class="save" v-for="(item,i) in list" :key="item.OS_NO"
  216. :class="i == activeIndex?'tr_active':''">
  217. <td v-if="i >0" width="50px" v-text="i"></td>
  218. <td v-else width="50px" v-text="'行号'"></td>
  219. <td v-if="i >0" width="50px"><input type='text' class="input itm" v-model="item.ITM"
  220. disabled="disabled" /></td>
  221. <td v-else width="50px" v-text="item.ITM"></td>
  222. <td width="50px" v-text="item.ORDER0"></td>
  223. <td width="100px" v-text="item.OS_DD"></td>
  224. <td width="100px" v-text="item.CUS_SNM"></td>
  225. <td width="120px" v-text="item.OS_NO"></td>
  226. <td width="120px" v-text="item.PRD_NO"></td>
  227. <td width="100px" v-text="item.DZRL"></td>
  228. <td width="80px" v-text="item.QY"></td>
  229. <td width="90px" v-text="item.YSSL"></td>
  230. <td width="90px" v-text="item.YMXH"></td>
  231. <td width="90px" v-text="item.QTY"></td>
  232. <td width="90px" v-text="item.BAT_QTY"></td>
  233. <td width="90px" v-text="item.QTY_FIN"></td>
  234. <td width="90px" v-text="item.W_QTY_FIN"></td>
  235. <td width="90px" v-text="item.GZSL"></td>
  236. <td width="90px" v-text="item.EST_DD"></td>
  237. <td width="90px" v-text="item.WH"></td>
  238. <td width="90px" v-text="item.PD_DEP"></td>
  239. <td width="90px" v-text="item.REM"></td>
  240. <td v-if="i >0" width="120px"><input type='date' class="input" v-model="item.PMC_DD" /></td>
  241. <td v-else width="120px" v-text="item.PMC_DD"></td>
  242. <td v-if="i >0" width="110px">
  243. <!-- <input type='text' class="input" style="width: 100px !important;"v-model="item.WH_REM" /> -->
  244. <textarea rows="1" cols="10" v-model="item.WH_REM"></textarea>
  245. </td>
  246. <td v-else width="110px" v-text="item.WH_REM"></td>
  247. <td v-if="i >0" width="50px"><button class="btn btn-primary"
  248. @click="ok_save(item.OS_NO,item.PMC_DD,item.WH_REM,item.ITM,i)" value="保存">保存</button>
  249. </td>
  250. <td v-else width="50px" v-text="item.operation"></td>
  251. </tr>
  252. </tbody>
  253. </table>
  254. </div>
  255. <div class="page footer">
  256. <ul class="pagination">
  257. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  258. {{ '第'+Number(page)+'页' }} {% endverbatim %}</button></li>
  259. <li><button type="button" class="btn btn-default previouspage"
  260. @click="previouspage();seek(1)">上一页</button></li>
  261. <li><button type="button" class="btn btn-default nextpage" @click="nextpage();seek(1)">下一页</button></li>
  262. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  263. {{ '共'+total_page+'页' }} {% endverbatim %}</button></li>
  264. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  265. {{ '共'+total_count+'笔' }} {% endverbatim %}</button></li>
  266. </ul>
  267. </div>
  268. <div class="footer refresh">
  269. <div class="load">
  270. <span></span>
  271. <span></span>
  272. <span></span>
  273. <span></span>
  274. <span></span>
  275. <span></span>
  276. <span></span>
  277. <span></span>
  278. </div>
  279. </div>
  280. </div>
  281. <!-- 这里是导出数据 -->
  282. <script type="text/javascript" src="/static/js/export/exports.js"></script>
  283. <script>
  284. var vm = new Vue({
  285. el: '#app',
  286. data: {
  287. st_time: '',
  288. sh_time: '',
  289. cus_no: '',
  290. cls_id: '1',
  291. pmc_ok: '1',
  292. activeIndex: 0,
  293. list: [],
  294. list_cust: [],
  295. list_dep: [],
  296. cust_cus_no: '',
  297. sort: '1',
  298. cust_cus_no_aa: '',
  299. page: 0,
  300. business_time: '',
  301. prd_no: '',
  302. sc_dep: '',
  303. sc_dep_aa: '',
  304. ym_type: '',
  305. os_type: '1',
  306. capacity: '',
  307. vessel: '',
  308. ifmerge: '1',
  309. page: 1,
  310. total_page: 1,
  311. total_count: 0,
  312. username: ''
  313. },
  314. mounted() {
  315. // 获取登录名
  316. // this.username=getCookie('username');
  317. this.username = $cookies.get('username')
  318. // console.log($cookies.get('username'))
  319. },
  320. methods: {
  321. // 上一页
  322. previouspage() {
  323. this.page -= 1
  324. // console.log(this.page)
  325. },
  326. // 下一页
  327. nextpage() {
  328. this.page += 1
  329. // console.log(this.page)
  330. },
  331. // 每次清空查询清空页码
  332. emptypage() {
  333. this.page = 1
  334. },
  335. // 查询数据
  336. seek(i) { // 添加的方法
  337. // console.log('ok')
  338. // 添加一个对象用于增加数据
  339. // 获取货品
  340. this.prd_no = $("#testInput").val()
  341. // console.log(this.prd_no)
  342. // 获取客户
  343. this.cust_cus_no = $("#testInput1").val()
  344. // console.log(this.cust_cus_no)
  345. //处理部门
  346. // console.log($("#testInput2").val())
  347. this.sc_dep = $("#testInput2").val()
  348. // 清空数据
  349. this.list = ''
  350. $(".page").hide();
  351. $(".refresh").show();
  352. // console.log($("#field").selectpicker('val'))
  353. var seek = { st_time: this.st_time, sh_time: this.sh_time, cus_no: this.cust_cus_no, cls_id: this.cls_id, pmc_ok: this.pmc_ok, sort: this.sort }
  354. //当第一次进入时设置部门编码值为空
  355. if (this.sc_dep == null) {
  356. this.sc_dep = ''
  357. }
  358. // console.log(this.prd_no)
  359. axios.get('/listtb', {
  360. params: {
  361. st_time: this.st_time, //订单开始时间
  362. sh_time: this.sh_time, //订单结束日期
  363. cus_no: this.cust_cus_no,//客户编码
  364. cls_id: this.cls_id, //结案否
  365. pmc_ok: this.pmc_ok, //回复否
  366. sort: this.sort, //排序
  367. business_time: this.business_time,//业务交期
  368. prd_no: this.prd_no, //产品编码
  369. sc_dep: this.sc_dep, //生产部门
  370. ym_type: this.ym_type, //研磨类型
  371. os_type: this.os_type, //订单类型
  372. capacity: this.capacity, //容量
  373. vessel: this.vessel, //容器
  374. select: i,
  375. ifmerge: this.ifmerge, //查询或者第一次进入状态标识
  376. page: this.page
  377. },
  378. })
  379. .then(res => {
  380. // alert(res.data)
  381. if (res.data.code == "510") {
  382. // console.log(res.data.code)
  383. alert("没有查询到数据");
  384. $(".page").hide();
  385. $(".refresh").hide();
  386. return
  387. }
  388. var data1 = res.data.data
  389. this.list = data1
  390. // 设置总页数
  391. this.total_page = res.data.total_page
  392. this.total_count = res.data.total_count
  393. // console.log(res.data.total_page)
  394. // 设置上一下下一页禁止
  395. if (this.page == 1) {
  396. $(".previouspage").attr("disabled", "disabled");
  397. }
  398. else {
  399. $('.previouspage').removeAttr('disabled')
  400. }
  401. if (this.page == this.total_page) {
  402. $(".nextpage").attr("disabled", "disabled");
  403. }
  404. else {
  405. $('.nextpage').removeAttr('disabled')
  406. }
  407. $(".refresh").hide();
  408. $(".page").show();
  409. console.log(data1)
  410. })
  411. .catch(err => {
  412. alert(err.response["data"] + err.response["status"])
  413. })
  414. },
  415. // 保存数据
  416. ok_save(OS_NO, PMC_DD, WH_REM, ITM, i) {
  417. // console.log('ok1')
  418. // console.log(OS_NO, PMC_DD, WH_REM, ITM)
  419. // this.activeIndex = i
  420. var OS_NO = OS_NO
  421. var PMC_DD = PMC_DD
  422. var WH_REM = WH_REM
  423. var ITM = ITM
  424. axios.put('/listtb/', {
  425. data: {
  426. OS_NO: OS_NO,
  427. PMC_DD: PMC_DD,
  428. WH_REM: WH_REM,
  429. ITM: ITM
  430. }
  431. })
  432. .then(res => {
  433. // alert(res.data)
  434. var data1 = res.data.data
  435. alert("保存成功")
  436. })
  437. .catch(err => {
  438. alert(err.response["data"] + err.response["status"])
  439. })
  440. },
  441. // 修改list数据
  442. uplist() {
  443. // console.log('ok2')
  444. axios.get('/listtb', {
  445. params: {
  446. st_time: '',
  447. sh_time: '',
  448. cus_no: '',
  449. cls_id: '',
  450. pmc_ok: '',
  451. sort: ''
  452. }
  453. })
  454. .then(res => {
  455. // alert(res.data)
  456. var data1 = res.data.data
  457. // console.log(typeof(data1))
  458. // console.log(typeof(list))
  459. this.list = data1
  460. $(".footer").hide();
  461. // console.log(this.list)
  462. })
  463. .catch(err => {
  464. alert(err.response["data"] + err.response["status"])
  465. })
  466. },
  467. //获取当前日期
  468. addDate() {
  469. var date = new Date();
  470. var seperator1 = "-";
  471. var year = date.getFullYear();
  472. var month = date.getMonth() + 1;
  473. var strDate = date.getDate();
  474. if (month >= 1 && month <= 9) {
  475. month = "0" + month;
  476. }
  477. if (strDate >= 0 && strDate <= 9) {
  478. strDate = "0" + strDate;
  479. }
  480. var currentdate = year + seperator1 + month + seperator1 + strDate;
  481. // console.log(currentdate)
  482. this.st_time = this.sh_time = currentdate
  483. },
  484. //退出登录
  485. logout() {
  486. // console.log("qweq")
  487. axios.delete('/login/', {
  488. params: {
  489. user_1: this.user_1,
  490. pswd: this.pswd,
  491. }
  492. })
  493. .then(res => {
  494. })
  495. .catch(err => {
  496. })
  497. },
  498. // 导出数据
  499. exportaa() {
  500. // console.log(this.list)
  501. var filter = [];
  502. var title = [];
  503. exportExcel(this.list, '订单一览表数据', title, filter);
  504. }
  505. },
  506. created() {
  507. setTimeout(() => {
  508. this.seek(2)
  509. }, 0)
  510. // this.select_dep()
  511. this.addDate()
  512. }
  513. });
  514. $(function () {
  515. // 开始写 jQuery 代码...
  516. var timer = null;
  517. // 定义一个公用的搜索接口
  518. // console.log(vm.$data.list)
  519. function getStr(n, url, field, clickif) {
  520. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  521. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  522. var search = n
  523. // 配置路由
  524. if (typeof search === 'undefined') {
  525. search = ''
  526. };
  527. // console.log(search)
  528. axios.get(url, {
  529. params: {
  530. search_no: search
  531. }
  532. })
  533. .then(res => {
  534. // alert(res.data)
  535. var data1 = res.data.data
  536. datas = data1
  537. // console.log(datas)
  538. if (datas.length == 0) {
  539. alert("没有搜索到数据")
  540. return
  541. }
  542. $.selectSuggest(field, datas);
  543. // 是否第一次进入
  544. if (clickif !== 1) {
  545. $("#" + field).trigger("click");
  546. }
  547. })
  548. .catch(err => {
  549. alert(err.response["data"] + err.response["status"])
  550. })
  551. };
  552. //查询货品资料调用
  553. $("#testInput").bind("input propertychange", function (event) {
  554. var search = $("#testInput").val()
  555. // console.log($("#testInput").val())
  556. timer && clearTimeout(timer);
  557. timer = setTimeout(function () {
  558. getStr(search, '/prdt/', 'testInput');
  559. }, 2000);
  560. });
  561. getStr('', '/prdt/', 'testInput', 1);
  562. //查询客户资料
  563. $("#testInput1").bind("input propertychange", function (event) {
  564. var search = $("#testInput1").val()
  565. // console.log($("#testInput1").val())
  566. timer && clearTimeout(timer);
  567. timer = setTimeout(function () {
  568. getStr(search, '/cust/', 'testInput1');
  569. }, 2000);
  570. });
  571. getStr('', '/cust/', 'testInput1', 1);
  572. //查询部门资料
  573. $("#testInput2").bind("input propertychange", function (event) {
  574. var search = $("#testInput2").val()
  575. // console.log($("#testInput1").val())
  576. timer && clearTimeout(timer);
  577. timer = setTimeout(function () {
  578. getStr(search, '/dept/', 'testInput2');
  579. }, 600);
  580. });
  581. // getStr('', '/dept/', 'testInput2', 1);
  582. });
  583. </script>
  584. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  585. </body>
  586. </html>