123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="widtd=device-widtd, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="/static/css/css.css">
- <!-- <link rel="stylesheet" type="text/css" href="/static/css/iefilemaintaindetail.css"> -->
- <link rel="stylesheet" type="text/css" href="/static/css/pcydscjhtm.css">
- <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
- <!-- 加载动画 -->
- <link rel="stylesheet" type="text/css" href="/static/css/loader.css">
- <script src="/static/js/jquery.min.js"></script>
- <script src="/static/js/bootstrap.min.js"></script>
- <script src="/static/js/vue-2.4.0.js"></script>
- <script src="/static/js/axios.min.js"></script>
- <script src="/static/js/vue-Cookies.js"></script>
- <script type="text/javascript" src="/static/js/jquery.select.js"></script>
- <script src="/static/js/bootstrap-select_new.js"></script>
- <!-- 图标js -->
- <!-- <script src="/static/js/ionicons.js"></script> -->
- <title>Document</title>
- </head>
- <body>
- <div id="app">
- <div class="navbar navbar-default">
- <div class="container">
- <!-- navbar-header用于设置内容横向显示 -->
- <div class="navbar-header">
- <a href="/index" class="navbar-brand"></a>
- </div>
- <!-- navbar-nav用来设置横向显示 -->
- <!-- navbar-right用来设置右浮动 -->
- <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
- <div class="hidden-xs">
- <ul class="nav navbar-nav">
- <li class="dropdown">
- <!--订单一览表-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- 订单一览表
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/index">订单一览表</a></li>
- </ul>
- </li>
- <li class="dropdown">
- <!--月度产能评估表-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- 月度产能评估表
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/depps">月度产能评估表</a></li>
- <li><a href="/dessettingtm">车间标准产能设置</a></li>
- </ul>
- </li>
- <li class="dropdown">
- <!--月度主排程计划-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- 月度主排程计划
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/pcydscjhtm">PC月度生产计划(N+7)</a></li>
- <li><a href="/ydzpcjhtm">月度主排程计划</a></li>
- <li><a href="/ympxqjhtm">研磨品需求计划</a></li>
- <li><a href="/btmbxqtm">表头模板需求</a></li>
- </ul>
- </li>
- <li class="dropdown">
- <!--ie文件号管理-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- IE工艺文件号管理
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/iefiletm">新增IE工艺文件号</a></li>
- <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
- <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
- <li><a href="/iefilemaintaininfotm">IE效率统计表</a></li>
- </ul>
- </li>
- </ul>
- <ul class="nav navbar-nav navbar-right">
- <li v-if="username !=''">
- <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
- </li>
- <li v-else><a href="">请登录</a></li>
- <li><a href="/login/" @click="logout()">退出登录</a></li>
- </ul>
- </div>
- </div>
- </div>
- <!--表头-->
- <div class="filter">
- <div class="container ">
- <label>
- <div class="navbar-nav">计划上线生产日期</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timeqi' /></div>
- </label>
- <label>
- <div class="navbar-nav">至:</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timezhi' />
- </div>
- </label>
- <label>
- <div class="navbar-nav">计划或受订单号:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="so_no" type="text" autocomplete="off" />
- </div>
- </label>
- <label>
- <div class="navbar-nav">客户:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="cus_no" type="text" autocomplete="off" />
- </div>
- </label>
- <label>
- <div class="navbar-nav">成品名称:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="mrp_no" type="text" autocomplete="off" />
- </div>
- </label>
- <label class="save def" @click="seek('ok')">
- <div class="btn btn-primary navbar-nav">查询</div>
- </label>
- <label class="save def">
- <div class="btn btn-primary navbar-nav" @click="exportaa()">导出数据</div>
- </label>
- </div>
- </div>
- <div class="container">
- <table class="table table-hover">
- <tbody>
- <tr v-for="(item,i) in seek_data" :key="item.id"
- v-bind:class="{ 'tr_red': item.ddjd =='已下达' ? true:false, 'tr_orange': item.ddjd =='已完成' ? true:false, 'tr_green': item.ddjd == '生产中' ? true:false }">
- <td v-text="item.cus_snm"></td>
- <td v-text="item.need_dd"></td>
- <td v-text="item.so_no"></td>
- <td v-text="item.mrp_no"></td>
- <td v-text="item.mrp_name"></td>
- <td v-text="item.mo_no"></td>
- <td v-text="item.pmc_dd"></td>
- <td v-text="item.mo_dep_name"></td>
- <td v-text="item.zx"></td>
- <td v-text="item.mo_no_no"></td>
- <td v-text="item.mo_no_name"></td>
- <td v-if="i>0" v-text="Number(item.qty)"></td>
- <td v-else v-text="item.qty"></td>
- <td v-if="i>0" v-text="Number(item.qty_fin)"></td>
- <td v-else v-text="item.qty_fin"></td>
- <td v-if="i>0" v-text="Number(item.w_qty)"></td>
- <td v-else v-text="item.w_qty"></td>
- <td v-if="i>0" v-text="Number(item.dcl)"></td>
- <td v-else v-text="item.dcl"></td>
- <td v-text="item.jhwcrq"></td>
- <td v-if="i>0" v-text="Number(item.cn)"></td>
- <td v-else v-text="item.cn"></td>
- <td v-text="item.ddjd"></td>
- <td v-text="item.ymp"></td>
- <td v-text="item.rq"></td>
- <td v-text="item.bq"></td>
- <td v-text="item.bc"></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="page footer" style="display: none;">
- <ul class="pagination">
- <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
- {{ '第'+Number(page)+'页' }} {% endverbatim %}</button></li>
- <li><button type="button" class="btn btn-default previouspage" disabled="disabled"
- @click="click_page('up')" :disabled="page == 1 ? true : false">上一页</button></li>
- <li><button type="button" class="btn btn-default nextpage" @click="click_page('next')" :disabled="page == count_page ? true : false">下一页</button></li>
- <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
- {{ '共'+count_page+'页' }} {% endverbatim %}</button></li>
- <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
- {{ '共'+total_count+'笔' }} {% endverbatim %}</button></li>
- </ul>
- </div>
- <div class="load" style="display: none;">
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- </div>
- </div>
- <!-- 这里是导出数据 -->
- <script type="text/javascript" src="/static/js/export/exports.js"></script>
- <script>
- var vm = new Vue({
- el: '#app',
- data: {
- data_timeqi: '', //查询时间起
- data_timezhi: '', //查询时间止
- username: '', //登录用户名
- seek_data: [], //查询到的数据
- cls_id:'1' , //结案否
- count_page:0, //总页数
- page:1,//第几页
- total_count:0,//总记录数
- },
- mounted() {
- // 获取登录名
- // this.username=getCookie('username');
- this.username = $cookies.get('username')
- console.log($cookies.get('username'))
- },
- methods: {
- // 查询
- seek(n) {
- $(".footer").hide();
- $(".load").show();
- // 如果是点击查询清空分页数据
- if(n=='ok'){
- this.count_page = this.total_count = 0
- this.page = 1
- }
- // 初始化数据
- this.seek_data = []
- var titled = {
- "id": "id",
- "cus_snm": "客户名称",
- "need_dd": "订单交货期",
- "so_no": "计划受订",
- "mrp_no": "成品代号",
- "mrp_name": "成品名称",
- "mo_no": "制令单号",
- "pmc_dd": "计划排产日期",
- "mo_dep_name": "工作中心",
- "zx": "线组",
- "mo_no_no": "制令单代号",
- "mo_no_name": "制令单名称",
- "qty": "订单数量",
- "qty_fin": "已缴库量",
- "w_qty": "未完工量",
- "dcl": "达成率",
- "jhwcrq": "计划完成日期",
- "cn": "产能",
- "ddjd": "订单完成进度",
- "ymp": "研磨品",
- "rq": "容器",
- "bq": "标签",
- "bc": "包材"
- }
- url = '/pcydscjh/?'+'min_pmc_dd='+this.data_timeqi+'&'+'max_pmc_dd='+this.data_timezhi+'&'+'page='+this.page
- var cus_no = $("#cus_no").val().split('->')[0]
- if (cus_no){
- url = url + '&' + 'cus_no='+cus_no
- }
- var mrp_no = $("#mrp_no").val().split('->')[0]
- if (mrp_no){
- url = url + '&' + 'mrp_no='+ mrp_no
- }
- var so_no =$("#so_no").val().split('->')[0]
- if (so_no){
- url = url + '&' + 'so_no='+ so_no
- }
- console.log(url)
- axios.get(url, {
- // params: {
- // data_timeqi: this.data_timeqi,
- // data_timezhi: this.data_timezhi,
- // cls_id:this.cls_id
- // }
- }).then(res => {
- var data = res.data
- this.seek_data = data.results
- if (this.seek_data.length==0){
- alert("没有查询到数据")
- return
- }
- this.count_page = data.count_page
- this.total_count = data.count
- this.seek_data.splice(0,0,titled)
- // console.log(this.seek_data)
- $(".load").hide();
- $(".footer").show();
- }).catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- // 点击分页
- click_page(n){
- if(n == 'up'){
- this.page = this.page -1
- }
- if(n == 'next'){
- this.page = this.page +1
- }
- this.seek('no')
- // if(this.page==1){
- // $(".previouspage").attr("disabled", "disabled");
- // }
- // else{
- // $('.previouspage').removeAttr('disabled')
- // }
- // if(this.page==this.count_page){
- // $(".nextpage").attr("disabled", "disabled");
- // }
- // else{
- // $('.nextpage').removeAttr('disabled')
- // }
- console.log(this.page)
- console.log(this.count_page)
- },
- // 导出数据
- exportaa() {
- // console.log(this.list)
- var filter = [];
- var title = [];
- exportExcel(this.seek_data, 'PC月度生产计划', title, filter);
- },
- //获取当前日期
- addDate() {
- var date = new Date();
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate;
- // console.log(currentdate)
- this.data_timeqi = this.data_timezhi = currentdate
- },
- //退出登录
- logout() {
- console.log("qweq")
- axios.delete('/login/', {
- params: {
- user_1: this.user_1,
- pswd: this.pswd,
- }
- })
- .then(res => {
- })
- .catch(err => {
- })
- },
- },
- created() {
- this.addDate()
- }
- });
- $(function () {
- // 开始写 jQuery 代码...
- var timer = null;
- // 定义一个公用的搜索接口
- // console.log(vm.$data.list)
- function getStr(n, url, field, clickif) {
- //n为搜索的参数 url为请求的路由,filed是定位表单的id,
- //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
- var search = n
- // 配置路由
- if (typeof search === 'undefined') {
- search = ''
- };
- // console.log(search)
- axios.get(url, {
- params: {
- search_no: search
- }
- })
- .then(res => {
- // alert(res.data)
- var data1 = res.data.data
- datas = data1
- // console.log(datas)
- if (datas.length == 0) {
- alert("没有搜索到数据")
- return
- }
- $.selectSuggest(field, datas);
- // 是否第一次进入
- if (clickif !== 1) {
- $("#" + field).trigger("click");
- }
- })
- .catch(err => {
- Console.log(err.response)
- alert(err.response["data"] + err.response["status"])
- })
- };
- //查询客户资料调用
- $("#cus_no").bind("input propertychange", function (event) {
- var search = $("#cus_no").val()
-
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/cust/', 'cus_no');
- }, 1000);
- });
- getStr('', '/cust/', 'cus_no', 1);
- // 查询成品编码
- $("#mrp_no").bind("input propertychange", function (event) {
- var search = $("#mrp_no").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/prdt/', 'mrp_no');
- }, 1000);
- });
- getStr('', '/prdt/', 'mrp_no', 1);
- // 查询成品编码
- $("#so_no").bind("input propertychange", function (event) {
- var search = $("#so_no").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/jhsd/', 'so_no');
- }, 1000);
- });
- getStr('', '/jhsd/', 'so_no', 1);
- });
- </script>
- <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
- </body>
- </html>
|