order.html 28 KB

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