123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 |
- <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/loader.css">
- <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.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>
- <!-- 用户操作cookie -->
- <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>
- <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="/depps">计划主交期</a></li>
- <li><a href="#">计划部门交期</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="#">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="/logout/" @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="st_time" /></div>
- </label>
- <label>
- <div class="navbar-nav">结束时间:</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model="sh_time" /></div>
- </label>
- <label>
- <div class="navbar-nav">品名:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="testInput" type="text" autocomplete="off" />
- </div>
- </label>
- <label>
- <div class="navbar-nav">客户:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="testInput1" type="text" autocomplete="off" />
- </div>
- </label>
- <label>
- <div class="navbar-nav">结案否:</div>
- <div class="navbar-nav">
- <select class="input form-control" v-model="cls_id">
- <option value="1" selected="selected">全部</option>
- <option value="2">结案</option>
- <option value="3">未结案</option>
- </select>
- </div>
- </label>
- <label>
- <div class="navbar-nav">是否回复:</div>
- <div class="navbar-nav">
- <select class="input form-control" v-model="pmc_ok">
- <option value="1">全部</option>
- <option value="2">已回复</option>
- <option value="3">未回复</option>
- </select>
- </div>
- </label>
- <label>
- <div class="navbar-nav">排序:</div>
- <div class="navbar-nav">
- <select class="input form-control" v-model="sort">
- <option value="1">单号</option>
- <option value="2">类别</option>
- <option value="3">客户</option>
- <option value="4">回复交期</option>
- </select>
- </div>
- </label>
- <label class="navbar-nav">
- <button class="btn btn-primary" data-toggle="modal" data-target="#myModal">更多</button>
- <div class="modal fade" id="myModal">
- <div class="modal-dialog">
- <div class="modal-content" style="width: 550px;">
- <div class="modal-header">
- <div class="modal-title">选择条件</div>
- </div>
- <div class="modal-body">
- <table>
- <tr>
- <td><span class="navbar-nav filtrate_w">业务交期:</span>
- <input type="date" class="navbar-nav filtrate" v-model="business_time">
- </td>
- <td><span class="navbar-nav filtrate_w">合并否:</span>
- <select class="input form-control filtrate" v-model="ifmerge">
- <option value="1">否</option>
- <option value="2">是</option>
- </select></td>
- </tr>
- <tr>
- <td><span class="navbar-nav filtrate_w">订单类别:</span>
- <select class="input form-control filtrate" v-model="os_type">
- <option value="1">全部</option>
- <option value="2">订单</option>
- <option value="3">返工单</option>
- </select>
- </td>
- <td><span class="navbar-nav filtrate_w">生产部门:</span>
- <input class="input form-control filtrate" id="testInput2" type="text"
- autocomplete="off" />
- </td>
- </tr>
- <tr>
- <td><span class="navbar-nav filtrate_w">容器:</span>
- <input type="text" class="input form-control filtrate" v-model="vessel">
- </td>
- <td><span class="navbar-nav filtrate_w">容量:</span>
- <input type="text" class="input form-control filtrate"
- v-model="capacity"></td>
- </tr>
- </table>
- </div>
- <div class="modal-footer">
- <button class="btn btn-primary" data-dismiss="modal">确定</button>
- <button class="btn btn-primary" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- </label>
- <!-- <label class="save" @click="seek()">确定查询</label> -->
- <label class="save def" id="def" @click="emptypage();seek(1)">
- <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>
- <!-- 内容 -->
- <!-- container这个类是设置居中对齐 -->
- <div class="container">
- <!-- row这个类是用于设置取消内边距 -->
- <table class="table table-bordered table-hover table-striped">
- <tbody>
- <!-- <tr v-for="(item,i) in list" :key="item.OS_NO" style="background-color: yellowgreen;"> -->
- <tr class="save" v-for="(item,i) in list" :key="item.OS_NO"
- :class="i == activeIndex?'tr_active':''">
- <td v-if="i >0" width="50px" v-text="i"></td>
- <td v-else width="50px" v-text="'行号'"></td>
- <td v-if="i >0" width="50px"><input type='text' class="input itm" v-model="item.ITM"
- disabled="disabled" /></td>
- <td v-else width="50px" v-text="item.ITM"></td>
- <td width="50px" v-text="item.ORDER0"></td>
- <td width="100px" v-text="item.OS_DD"></td>
- <td width="100px" v-text="item.CUS_SNM"></td>
- <td width="120px" v-text="item.OS_NO"></td>
- <td width="120px" v-text="item.PRD_NO"></td>
- <td width="100px" v-text="item.DZRL"></td>
- <td width="80px" v-text="item.QY"></td>
- <td width="90px" v-text="item.YSSL"></td>
- <td width="90px" v-text="item.YMXH"></td>
- <td width="90px" v-text="item.QTY"></td>
- <td width="90px" v-text="item.BAT_QTY"></td>
- <td width="90px" v-text="item.QTY_FIN"></td>
- <td width="90px" v-text="item.W_QTY_FIN"></td>
- <td width="90px" v-text="item.GZSL"></td>
- <td width="90px" v-text="item.EST_DD"></td>
- <td width="90px" v-text="item.WH"></td>
- <td width="90px" v-text="item.PD_DEP"></td>
- <td width="90px" v-text="item.REM"></td>
- <td v-if="i >0" width="120px"><input type='date' class="input" v-model="item.PMC_DD" /></td>
- <td v-else width="120px" v-text="item.PMC_DD"></td>
- <td v-if="i >0" width="110px">
- <!-- <input type='text' class="input" style="width: 100px !important;"v-model="item.WH_REM" /> -->
- <textarea rows="1" cols="10" v-model="item.WH_REM"></textarea>
- </td>
- <td v-else width="110px" v-text="item.WH_REM"></td>
- <td v-if="i >0" width="50px"><button class="btn btn-primary"
- @click="ok_save(item.OS_NO,item.PMC_DD,item.WH_REM,item.ITM,i)" value="保存">保存</button>
- </td>
- <td v-else width="50px" v-text="item.operation"></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="page footer">
- <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"
- @click="previouspage();seek(1)">上一页</button></li>
- <li><button type="button" class="btn btn-default nextpage" @click="nextpage();seek(1)">下一页</button></li>
- <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
- {{ '共'+total_page+'页' }} {% endverbatim %}</button></li>
- <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
- {{ '共'+total_count+'笔' }} {% endverbatim %}</button></li>
- </ul>
- </div>
- <div class="footer refresh">
- <div class="load">
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- </div>
- </div>
- </div>
- <!-- 这里是导出数据 -->
- <script type="text/javascript" src="/static/js/export/exports.js"></script>
- <script>
- var vm = new Vue({
- el: '#app',
- data: {
- st_time: '',
- sh_time: '',
- cus_no: '',
- cls_id: '1',
- pmc_ok: '1',
- activeIndex: 0,
- list: [],
- list_cust: [],
- list_dep: [],
- cust_cus_no: '',
- sort: '1',
- cust_cus_no_aa: '',
- page: 0,
- business_time: '',
- prd_no: '',
- sc_dep: '',
- sc_dep_aa: '',
- ym_type: '',
- os_type: '1',
- capacity: '',
- vessel: '',
- ifmerge: '1',
- page: 1,
- total_page: 1,
- total_count: 0,
- username: ''
- },
- mounted() {
- // 获取登录名
- // this.username=getCookie('username');
- this.username = $cookies.get('username')
- // console.log($cookies.get('username'))
- },
- methods: {
- // 上一页
- previouspage() {
- this.page -= 1
- // console.log(this.page)
- },
- // 下一页
- nextpage() {
- this.page += 1
- // console.log(this.page)
- },
- // 每次清空查询清空页码
- emptypage() {
- this.page = 1
- },
- // 查询数据
- seek(i) { // 添加的方法
- // console.log('ok')
- // 添加一个对象用于增加数据
- // 获取货品
- this.prd_no = $("#testInput").val()
- // console.log(this.prd_no)
- // 获取客户
- this.cust_cus_no = $("#testInput1").val()
- // console.log(this.cust_cus_no)
- //处理部门
- // console.log($("#testInput2").val())
- this.sc_dep = $("#testInput2").val()
- // 清空数据
- this.list = ''
- $(".page").hide();
- $(".refresh").show();
- // console.log($("#field").selectpicker('val'))
- 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 }
- //当第一次进入时设置部门编码值为空
- if (this.sc_dep == null) {
- this.sc_dep = ''
- }
- // console.log(this.prd_no)
- axios.get('/listtb', {
- params: {
- 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, //排序
- business_time: this.business_time,//业务交期
- prd_no: this.prd_no, //产品编码
- sc_dep: this.sc_dep, //生产部门
- ym_type: this.ym_type, //研磨类型
- os_type: this.os_type, //订单类型
- capacity: this.capacity, //容量
- vessel: this.vessel, //容器
- select: i,
- ifmerge: this.ifmerge, //查询或者第一次进入状态标识
- page: this.page
- },
- })
- .then(res => {
- // alert(res.data)
- if (res.data.code == "510") {
- // console.log(res.data.code)
- alert("没有查询到数据");
- $(".page").hide();
- $(".refresh").hide();
- return
- }
- var data1 = res.data.data
- this.list = data1
- // 设置总页数
- this.total_page = res.data.total_page
- this.total_count = res.data.total_count
- // console.log(res.data.total_page)
- // 设置上一下下一页禁止
- if (this.page == 1) {
- $(".previouspage").attr("disabled", "disabled");
- }
- else {
- $('.previouspage').removeAttr('disabled')
- }
- if (this.page == this.total_page) {
- $(".nextpage").attr("disabled", "disabled");
- }
- else {
- $('.nextpage').removeAttr('disabled')
- }
- $(".refresh").hide();
- $(".page").show();
- })
- .catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- // 保存数据
- ok_save(OS_NO, PMC_DD, WH_REM, ITM, i) {
- // console.log('ok1')
- // console.log(OS_NO, PMC_DD, WH_REM, ITM)
- // this.activeIndex = i
- var OS_NO = OS_NO
- var PMC_DD = PMC_DD
- var WH_REM = WH_REM
- var ITM = ITM
- axios.put('/listtb/', {
- data: {
- OS_NO: OS_NO,
- PMC_DD: PMC_DD,
- WH_REM: WH_REM,
- ITM: ITM
- }
- })
- .then(res => {
- // alert(res.data)
- var data1 = res.data.data
- alert("保存成功")
- })
- .catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- // 修改list数据
- uplist() {
- // console.log('ok2')
- axios.get('/listtb', {
- params: {
- st_time: '',
- sh_time: '',
- cus_no: '',
- cls_id: '',
- pmc_ok: '',
- sort: ''
- }
- })
- .then(res => {
- // alert(res.data)
- var data1 = res.data.data
- // console.log(typeof(data1))
- // console.log(typeof(list))
- this.list = data1
- $(".footer").hide();
- // console.log(this.list)
- })
- .catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- //获取当前日期
- 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.st_time = this.sh_time = currentdate
- },
- //退出登录
- logout() {
- // console.log("qweq")
- axios.delete('/login/', {
- params: {
- user_1: this.user_1,
- pswd: this.pswd,
- }
- })
- .then(res => {
- })
- .catch(err => {
- })
- },
- // 导出数据
- exportaa() {
- // console.log(this.list)
- var filter = [];
- var title = [];
- exportExcel(this.list, '订单一览表数据', title, filter);
- }
- },
- created() {
- setTimeout(() => {
- this.seek(2)
- }, 0)
- // this.select_dep()
- 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 => {
- alert(err.response["data"] + err.response["status"])
- })
- };
- //查询货品资料调用
- $("#testInput").bind("input propertychange", function (event) {
- var search = $("#testInput").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/prdt/', 'testInput');
- }, 2000);
- });
- getStr('', '/prdt/', 'testInput', 1);
- //查询客户资料
- $("#testInput1").bind("input propertychange", function (event) {
- var search = $("#testInput1").val()
- // console.log($("#testInput1").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/cust/', 'testInput1');
- }, 2000);
- });
- getStr('', '/cust/', 'testInput1', 1);
- //查询部门资料
- $("#testInput2").bind("input propertychange", function (event) {
- var search = $("#testInput2").val()
- // console.log($("#testInput1").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/dept/', 'testInput2');
- }, 600);
- });
- // getStr('', '/dept/', 'testInput2', 1);
- });
- </script>
- <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
- </body>
- </html>
|