ympxqjhtm.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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. <link rel="stylesheet" type="text/css" href="/static/css/iefilemaintaindetail.css">
  9. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
  10. <!-- 加载动画 -->
  11. <link rel="stylesheet" type="text/css" href="/static/css/loader.css">
  12. <script src="/static/js/jquery.min.js"></script>
  13. <script src="/static/js/bootstrap.min.js"></script>
  14. <script src="/static/js/vue-2.4.0.js"></script>
  15. <script src="/static/js/axios.min.js"></script>
  16. <script src="/static/js/vue-Cookies.js"></script>
  17. <script type="text/javascript" src="/static/js/jquery.select.js"></script>
  18. <script src="/static/js/bootstrap-select_new.js"></script>
  19. <!-- 图标js -->
  20. <!-- <script src="/static/js/ionicons.js"></script> -->
  21. <title>Document</title>
  22. </head>
  23. <body>
  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">
  36. <li class="dropdown">
  37. <!--订单一览表-->
  38. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  39. 1111111111111订单一览表
  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='data_timeqi' /></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='data_timezhi' />
  104. </div>
  105. </label>
  106. <label>
  107. <div class="navbar-nav">计划或受订单号:</div>
  108. <div class="navbar-nav">
  109. <input class="input form-control" id="so_no" type="text" autocomplete="off" />
  110. </div>
  111. </label>
  112. <label>
  113. <div class="navbar-nav">客户:</div>
  114. <div class="navbar-nav">
  115. <input class="input form-control" id="cus_no" type="text" autocomplete="off" />
  116. </div>
  117. </label>
  118. <label>
  119. <div class="navbar-nav">成品名称:</div>
  120. <div class="navbar-nav">
  121. <input class="input form-control" id="mrp_no" type="text" autocomplete="off" />
  122. </div>
  123. </label>
  124. <label class="save def" @click="seek('ok')">
  125. <div class="btn btn-primary navbar-nav">查询</div>
  126. </label>
  127. <label class="save def">
  128. <div class="btn btn-primary navbar-nav" @click="exportaa()">导出数据</div>
  129. </label>
  130. </div>
  131. </div>
  132. <div class="container">
  133. <table class="table table-hover">
  134. <tbody>
  135. <tr v-for="(item,i) in seek_data" :key="item.id">
  136. <td v-text="item.mo_dd"></td>
  137. <td v-text="item.cus_no"></td>
  138. <td v-text="item.so_no"></td>
  139. <td v-text="item.dl"></td>
  140. <td v-text="item.gzwwgs"></td>
  141. <td v-text="item.gzdep"></td>
  142. <td v-text="item.pmc_dd"></td>
  143. <td v-text="item.ggsxrq"></td>
  144. <td v-text="item.mrp_no"></td>
  145. <td v-text="item.qty"></td>
  146. <td v-text="item.os_wfl"></td>
  147. <td v-text="item.jcq"></td>
  148. <td v-text="item.jkwshl"></td>
  149. <td v-text="item.llwsl"></td>
  150. <td v-text="item.mrp_name"></td>
  151. <td v-text="item.dep"></td>
  152. <td v-text="item.wfl"></td>
  153. <td v-text="item.zzl"></td>
  154. <td v-text="item.mo_no1"></td>
  155. <td v-text="item.qty1"></td>
  156. <td v-text="item.mo_no2"></td>
  157. <td v-text="item.qty2"></td>
  158. <td v-text="item.mo_no3"></td>
  159. <td v-text="item.qty3"></td>
  160. <td v-text="item.mo_no4"></td>
  161. <td v-text="item.qty4"></td>
  162. <td v-text="item.mo_no5"></td>
  163. <td v-text="item.qty5"></td>
  164. <td v-text="item.mo_no6"></td>
  165. <td v-text="item.qty6"></td>
  166. <td v-text="item.mo_no7"></td>
  167. <td v-text="item.qty7"></td>
  168. </tr>
  169. </tbody>
  170. </table>
  171. </div>
  172. <div class="page footer" style="display: none;">
  173. <ul class="pagination">
  174. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  175. {{ '第'+Number(page)+'页' }} {% endverbatim %}</button></li>
  176. <li><button type="button" class="btn btn-default previouspage" disabled="disabled"
  177. @click="click_page('up')" :disabled="page == 1 ? true : false">上一页</button></li>
  178. <li><button type="button" class="btn btn-default nextpage" @click="click_page('next')" :disabled="page == count_page ? true : false">下一页</button></li>
  179. <li><button type="button" class="btn btn-default" :disabled="true">{% verbatim %}
  180. {{ '共'+count_page+'页' }} {% endverbatim %}</button></li>
  181. <li><button type="button" class="btn btn-default" :disabled="true">{% verbatim %}
  182. {{ '共'+total_count+'笔' }} {% endverbatim %}</button></li>
  183. </ul>
  184. </div>
  185. <div class="load" style="display: none;">
  186. <span></span>
  187. <span></span>
  188. <span></span>
  189. <span></span>
  190. <span></span>
  191. <span></span>
  192. <span></span>
  193. <span></span>
  194. </div>
  195. </div>
  196. <!-- 这里是导出数据 -->
  197. <script type="text/javascript" src="/static/js/export/exports.js"></script>
  198. <script>
  199. var vm = new Vue({
  200. el: '#app',
  201. data: {
  202. data_timeqi: '', //查询时间起
  203. data_timezhi: '', //查询时间止
  204. username: '', //登录用户名
  205. seek_data: [], //查询到的数据
  206. cls_id:'1' , //结案否
  207. count_page:0, //总页数
  208. page:1,//第几页
  209. total_count:0,//总记录数
  210. },
  211. mounted() {
  212. // 获取登录名
  213. // this.username=getCookie('username');
  214. this.username = $cookies.get('username')
  215. console.log($cookies.get('username'))
  216. },
  217. methods: {
  218. // 查询
  219. seek(n) {
  220. $(".footer").hide();
  221. $(".load").show();
  222. // 如果是点击查询清空分页数据
  223. if(n=='ok'){
  224. this.count_page = this.total_count = 0
  225. this.page = 1
  226. }
  227. // 初始化数据
  228. this.seek_data = []
  229. var titled = {
  230. "id": "id",
  231. "so_no": "订单号",
  232. "pmc_dd": "pmc回复交期",
  233. "bom_no": "bom_no",
  234. "est_itm": "项次",
  235. "mo_dd": "评审交期",
  236. "dl": "成品大类",
  237. "gzwwgs": "灌装未完工数量",
  238. "gzdep": "灌装生产线",
  239. "qty": "制令数量",
  240. "gzwggs": "灌装未完工数量",
  241. "ggsxrq": "灌装上线日",
  242. "qty": "现存量",
  243. "os_wfl": "订单需求量(未领量)",
  244. "jcq": "净需求",
  245. "jkwshl": "缴库未审量",
  246. "llwsl": "领料未审量",
  247. "mrp_name": "研磨品名称",
  248. "dep": "研磨品生产车间",
  249. "wfl": "未发量",
  250. "zzl": "在制量",
  251. "mrp_no": "研磨品代号",
  252. "mo_no1": "单号1",
  253. "mo_no2": "单号2",
  254. "mo_no3": "单号3",
  255. "mo_no4": "单号4",
  256. "mo_no5": "单号5",
  257. "mo_no6": "单号6",
  258. "mo_no7": "单号7",
  259. "qty1": "数量1",
  260. "qty2": "数量2",
  261. "qty3": "数量3",
  262. "qty4": "数量4",
  263. "qty5": "数量5",
  264. "qty6": "数量6",
  265. "qty7": "qty7"
  266. }
  267. url = '/ympxqjh/?'+'min_pmc_dd='+this.data_timeqi+'&'+'max_pmc_dd='+this.data_timezhi+'&'+'page='+this.page
  268. var cus_no = $("#cus_no").val().split('->')[0]
  269. if (cus_no){
  270. url = url + '&' + 'cus_no='+cus_no
  271. }
  272. var mrp_no = $("#mrp_no").val().split('->')[0]
  273. if (mrp_no){
  274. url = url + '&' + 'mrp_no='+ mrp_no
  275. }
  276. var so_no =$("#so_no").val().split('->')[0]
  277. if (so_no){
  278. url = url + '&' + 'so_no='+ so_no
  279. }
  280. console.log(url)
  281. axios.get(url, {
  282. // params: {
  283. // data_timeqi: this.data_timeqi,
  284. // data_timezhi: this.data_timezhi,
  285. // cls_id:this.cls_id
  286. // }
  287. }).then(res => {
  288. var data = res.data
  289. this.seek_data = data.results
  290. if (this.seek_data.length==0){
  291. alert("没有查询到数据")
  292. return
  293. }
  294. this.count_page = data.count_page
  295. this.total_count = data.count
  296. this.seek_data.splice(0,0,titled)
  297. $(".load").hide();
  298. $(".footer").show();
  299. }).catch(err => {
  300. alert(err.response["data"] + err.response["status"])
  301. })
  302. },
  303. // 点击分页
  304. click_page(n){
  305. if(n == 'up'){
  306. this.page = this.page -1
  307. }
  308. if(n == 'next'){
  309. this.page = this.page +1
  310. }
  311. this.seek('no')
  312. // if(this.page==1){
  313. // $(".previouspage").attr("disabled", "disabled");
  314. // }
  315. // else{
  316. // $('.previouspage').removeAttr('disabled')
  317. // }
  318. // if(this.page==this.count_page){
  319. // $(".nextpage").attr("disabled", "disabled");
  320. // }
  321. // else{
  322. // $('.nextpage').removeAttr('disabled')
  323. // }
  324. console.log(this.page)
  325. console.log(this.count_page)
  326. },
  327. // 导出数据
  328. exportaa() {
  329. // console.log(this.list)
  330. var filter = [];
  331. var title = [];
  332. exportExcel(this.seek_data, '月度主排产计划', title, filter);
  333. },
  334. //获取当前日期
  335. addDate() {
  336. var date = new Date();
  337. var seperator1 = "-";
  338. var year = date.getFullYear();
  339. var month = date.getMonth() + 1;
  340. var strDate = date.getDate();
  341. if (month >= 1 && month <= 9) {
  342. month = "0" + month;
  343. }
  344. if (strDate >= 0 && strDate <= 9) {
  345. strDate = "0" + strDate;
  346. }
  347. var currentdate = year + seperator1 + month + seperator1 + strDate;
  348. // console.log(currentdate)
  349. this.data_timeqi = this.data_timezhi = currentdate
  350. },
  351. //退出登录
  352. logout() {
  353. console.log("qweq")
  354. axios.delete('/login/', {
  355. params: {
  356. user_1: this.user_1,
  357. pswd: this.pswd,
  358. }
  359. })
  360. .then(res => {
  361. })
  362. .catch(err => {
  363. })
  364. },
  365. },
  366. created() {
  367. this.addDate()
  368. }
  369. });
  370. $(function () {
  371. // 开始写 jQuery 代码...
  372. var timer = null;
  373. // 定义一个公用的搜索接口
  374. // console.log(vm.$data.list)
  375. function getStr(n, url, field, clickif) {
  376. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  377. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  378. var search = n
  379. // 配置路由
  380. if (typeof search === 'undefined') {
  381. search = ''
  382. };
  383. // console.log(search)
  384. axios.get(url, {
  385. params: {
  386. search_no: search
  387. }
  388. })
  389. .then(res => {
  390. // alert(res.data)
  391. var data1 = res.data.data
  392. datas = data1
  393. // console.log(datas)
  394. if (datas.length == 0) {
  395. alert("没有搜索到数据")
  396. return
  397. }
  398. $.selectSuggest(field, datas);
  399. // 是否第一次进入
  400. if (clickif !== 1) {
  401. $("#" + field).trigger("click");
  402. }
  403. })
  404. .catch(err => {
  405. Console.log(err.response)
  406. alert(err.response["data"] + err.response["status"])
  407. })
  408. };
  409. //查询客户资料调用
  410. $("#cus_no").bind("input propertychange", function (event) {
  411. var search = $("#cus_no").val()
  412. // console.log($("#testInput").val())
  413. timer && clearTimeout(timer);
  414. timer = setTimeout(function () {
  415. getStr(search, '/cust/', 'cus_no');
  416. }, 1000);
  417. });
  418. getStr('', '/cust/', 'cus_no', 1);
  419. // 查询成品编码
  420. $("#mrp_no").bind("input propertychange", function (event) {
  421. var search = $("#mrp_no").val()
  422. // console.log($("#testInput").val())
  423. timer && clearTimeout(timer);
  424. timer = setTimeout(function () {
  425. getStr(search, '/prdt/', 'mrp_no');
  426. }, 1000);
  427. });
  428. getStr('', '/prdt/', 'mrp_no', 1);
  429. // 查询成品编码
  430. $("#so_no").bind("input propertychange", function (event) {
  431. var search = $("#so_no").val()
  432. // console.log($("#testInput").val())
  433. timer && clearTimeout(timer);
  434. timer = setTimeout(function () {
  435. getStr(search, '/jhsd/', 'so_no');
  436. }, 1000);
  437. });
  438. getStr('', '/jhsd/', 'so_no', 1);
  439. });
  440. </script>
  441. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  442. </body>
  443. </html>