order.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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/bootstrap-select.min.css">
  9. <script src="/static/js/jquery.min.js"></script>
  10. <script src="/static/js/bootstrap.min.js"></script>
  11. <script src="/static/js/vue-2.4.0.js"></script>
  12. <script src="/static/js/axios.min.js"></script>
  13. <script src="/static/js/bootstrap-select.min.js"></script>
  14. <title>Document</title>
  15. </head>
  16. <body>
  17. <div id="app">
  18. <!-- navbar-default这个类是设置导航栏 -->
  19. <div class="navbar navbar-default">
  20. <div class="container">
  21. <!-- navbar-header用于设置内容横向显示 -->
  22. <div class="navbar-header">
  23. <a href="/index" class="navbar-brand"></a>
  24. </div>
  25. <!-- navbar-nav用来设置横向显示 -->
  26. <!-- navbar-right用来设置右浮动 -->
  27. <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
  28. <div class="hidden-xs">
  29. <ul class="nav navbar-nav">
  30. <li class="dropdown">
  31. <!--订单一览表-->
  32. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  33. 订单一览表
  34. <b class="caret"></b>
  35. </a>
  36. <ul class="nav dropdown-menu">
  37. <li><a href="/index">订单一览表</a></li>
  38. <li><a href="#">已结案订单</a></li>
  39. </ul>
  40. </li>
  41. <li class="dropdown">
  42. <!--月度产能评估表-->
  43. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  44. 月度产能评估表
  45. <b class="caret"></b>
  46. </a>
  47. <ul class="nav dropdown-menu">
  48. <li><a href="#">汇总分析</a></li>
  49. <li><a href="#">订单完成情况</a></li>
  50. </ul>
  51. </li>
  52. <li class="dropdown">
  53. <!--月度主排程计划-->
  54. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  55. 月度主排程计划
  56. <b class="caret"></b>
  57. </a>
  58. <ul class="nav dropdown-menu">
  59. <li><a href="/depps">计划主交期</a></li>
  60. <li><a href="#">计划部门交期</a></li>
  61. </ul>
  62. </li>
  63. </ul>
  64. </div>
  65. </div>
  66. </div>
  67. <!--搜索-->
  68. <div class="filter">
  69. <div class="container ">
  70. <label>
  71. <div class="navbar-nav">开始时间:</div>
  72. <div class="navbar-nav"><input type='date' class="input form-control" v-model="st_time" /></div>
  73. </label>
  74. <label>
  75. <div class="navbar-nav">结束时间:</div>
  76. <div class="navbar-nav"><input type='date' class="input form-control" v-model="sh_time" /></div>
  77. </label>
  78. <label>
  79. <div class="navbar-nav">客户:</div>
  80. <div class="navbar-nav"><select class="selectpicker form-control" data-live-search="true"
  81. v-model="DEP_DEP" id="field"></select></div>
  82. </label>
  83. <label>
  84. <div class="navbar-nav">结案否:</div>
  85. <div class="navbar-nav">
  86. <select class="input form-control" v-model="cls_id">
  87. <option value="1" selected="selected">全部</option>
  88. <option value="2">结案</option>
  89. <option value="3">未结案</option>
  90. </select>
  91. </div>
  92. </label>
  93. <label>
  94. <div class="navbar-nav">是否回复:</div>
  95. <div class="navbar-nav">
  96. <select class="input form-control" v-model="pmc_ok">
  97. <option value="1">全部</option>
  98. <option value="2">已回复</option>
  99. <option value="3">未回复</option>
  100. </select>
  101. </div>
  102. </label>
  103. <label>
  104. <div class="navbar-nav">排序:</div>
  105. <div class="navbar-nav">
  106. <select class="input form-control" v-model="sort">
  107. <option value="1">类别</option>
  108. <option value="2">客户</option>
  109. <option value="3">回复交期</option>
  110. </select>
  111. </div>
  112. </label>
  113. <!-- <label class="save" @click="seek()">确定查询</label> -->
  114. <label class="save def" id="def" @click="seek()">
  115. <div class="btn btn-primary navbar-nav">确定查询</div>
  116. </label>
  117. </div>
  118. </div>
  119. <!-- 内容 -->
  120. <!-- container这个类是设置居中对齐 -->
  121. <div class="container">
  122. <!-- row这个类是用于设置取消内边距 -->
  123. <table class="table table-bordered table-hover table-striped">
  124. <tbody>
  125. <!-- <tr v-for="(item,i) in list" :key="item.OS_NO" style="background-color: yellowgreen;"> -->
  126. <tr v-for="(item,i) in list" :key="item.OS_NO" :class="i === activeIndex?'tr_active':''">
  127. <td v-if="i >0" width="50px" v-text="i"></td>
  128. <td v-else width="50px" v-text="'行号'"></td>
  129. <td v-if="i >0" width="50px" ><input type='text' class="input itm" v-model="item.ITM" disabled="disabled"/></td>
  130. <td v-else width="50px" v-text="item.ITM" ></td>
  131. <td width="50px" v-text="item.ORDER0"></td>
  132. <td width="100px" v-text="item.OS_DD"></td>
  133. <td width="100px" v-text="item.CUS_SNM"></td>
  134. <td width="120px" v-text="item.OS_NO"></td>
  135. <td width="120px" v-text="item.PRD_NO"></td>
  136. <td width="100px" v-text="item.DZRL"></td>
  137. <td width="80px" v-text="item.QY"></td>
  138. <td width="90px" v-text="item.YSSL"></td>
  139. <td width="90px" v-text="item.YMXH"></td>
  140. <td width="90px" v-text="item.QTY"></td>
  141. <td width="90px" v-text="item.GZSL"></td>
  142. <td width="90px" v-text="item.EST_DD"></td>
  143. <td width="90px" v-text="item.PD_DEP"></td>
  144. <td width="90px" v-text="item.REM"></td>
  145. <td v-if="i >0" width="120px"><input type='date' class="input" v-model="item.PMC_DD" /></td>
  146. <td v-else width="120px" v-text="item.PMC_DD"></td>
  147. <td v-if="i >0" width="110px"><input type='text' class="input" style="width: 100px !important;" v-model="item.WH_REM" /></td>
  148. <td v-else width="110px" v-text="item.WH_REM"></td>
  149. <td v-if="i >0" width="50px"><input type='submit' class="save"
  150. @click="ok_save(item.OS_NO,item.PMC_DD,item.WH_REM,item.ITM,i)" value="保存" /></td>
  151. <td v-else width="50px" v-text="item.operation"></td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </div>
  156. <div class="footer">
  157. 分页
  158. </div>
  159. </div>
  160. <script>
  161. var vm = new Vue({
  162. el: '#app',
  163. data: {
  164. st_time: '',
  165. sh_time: '',
  166. cus_no: '',
  167. cls_id: '1',
  168. pmc_ok: '1',
  169. activeIndex: 0,
  170. list: [],
  171. DEP_DEP: '',
  172. list_cust:[],
  173. cust_cus_no:'',
  174. sort:'1'
  175. },
  176. methods: {
  177. seek() { // 添加的方法
  178. console.log('ok')
  179. // 添加一个对象用于增加数据
  180. this.cust_cus_no = $("#field").selectpicker('val')
  181. 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 }
  182. console.log(seek)
  183. axios.get('/listtb', {
  184. params: {
  185. st_time: this.st_time,
  186. sh_time: this.sh_time,
  187. cus_no: this.cust_cus_no,
  188. cls_id: this.cls_id,
  189. pmc_ok: this.pmc_ok,
  190. sort:this.sort
  191. }
  192. })
  193. .then(res => {
  194. // alert(res.data)
  195. var data1 = res.data.data
  196. })
  197. .catch(err => {
  198. console.log('error:' + err)
  199. })
  200. },
  201. ok_save(OS_NO, PMC_DD, WH_REM, ITM,i) {
  202. console.log('ok1')
  203. console.log(OS_NO, PMC_DD, WH_REM,ITM)
  204. this.activeIndex = i
  205. var OS_NO = OS_NO
  206. var PMC_DD = PMC_DD
  207. var WH_REM = WH_REM
  208. var ITM = ITM
  209. axios.put('/listtb/', {
  210. params: {
  211. OS_NO: OS_NO,
  212. PMC_DD: PMC_DD,
  213. WH_REM: WH_REM,
  214. ITM:ITM
  215. }
  216. })
  217. .then(res => {
  218. // alert(res.data)
  219. var data1 = res.data.data
  220. })
  221. .catch(err => {
  222. console.log('error:' + err)
  223. })
  224. },
  225. // 修改list数据
  226. uplist() {
  227. // console.log('ok2')
  228. axios.get('/listtb', {
  229. params: {
  230. st_time: '',
  231. sh_time: '',
  232. cus_no: '',
  233. cls_id: '',
  234. pmc_ok: '',
  235. }
  236. })
  237. .then(res => {
  238. // alert(res.data)
  239. var data1 = res.data.data
  240. // console.log(typeof(data1))
  241. // console.log(typeof(list))
  242. this.list = data1
  243. console.log(this.list)
  244. })
  245. .catch(err => {
  246. console.log('error:' + err)
  247. })
  248. },
  249. //获取当前日期
  250. addDate() {
  251. var date = new Date();
  252. var seperator1 = "-";
  253. var year = date.getFullYear();
  254. var month = date.getMonth() + 1;
  255. var strDate = date.getDate();
  256. if (month >= 1 && month <= 9) {
  257. month = "0" + month;
  258. }
  259. if (strDate >= 0 && strDate <= 9) {
  260. strDate = "0" + strDate;
  261. }
  262. var currentdate = year + seperator1 + month + seperator1 + strDate;
  263. console.log(currentdate)
  264. this.st_time = this.sh_time = currentdate
  265. },
  266. //获取客户资料
  267. select_cust() {
  268. axios.get('/cust/', {
  269. // params: {
  270. // st_time: '',
  271. // sh_time: '',
  272. // cus_no: '',
  273. // cls_id: '',
  274. // pmc_ok: '',
  275. // }
  276. })
  277. .then(res => {
  278. // alert(res.data)
  279. var data1 = res.data.data
  280. this.list_cust = data1
  281. // console.log(this.list_cust)
  282. // 设置下拉搜索
  283. var tempIdStr = '<option value="">选择客户</option>';
  284. // var tempIdStr = '<option value="' + this.list[0]['DEP'] + '" v-bind:value="DEP_DEP">' + this.list[0]['DEP'] + '---' + this.list[0]['DEP'] + '</option>';
  285. $("#field").append(tempIdStr);
  286. $.each(this.list_cust, function (i, item) {
  287. var tempId = '<option value="' + item.CUS_NO + '" v-bind:value="cust_cus_no">' + item.CUS_NO + '---' + item.NAME + '</option>';
  288. $("#field").append(tempId);
  289. // alert(tempId)
  290. });
  291. // 更新 。 这一步很重要
  292. $('#field').selectpicker('refresh');
  293. })
  294. .catch(err => {
  295. console.log('error:' + err)
  296. })
  297. }
  298. },
  299. created() {
  300. this.uplist()
  301. this.addDate()
  302. this.select_cust()
  303. }
  304. });
  305. </script>
  306. </body>
  307. </html>