123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
- <title>询价物料</title>
- <link rel="stylesheet" href="../../css/api.css"/>
- <link rel="stylesheet" href="../../css/aui.css"/>
- <link rel="stylesheet" href="../../css/weui.min.css"/>
- <link rel="stylesheet" href="../../css/html.css"/>
- <link rel="stylesheet" href="../../css/xunjia_wuliao.css"/>
- <!--<script type="text/javascript" src="../../script/rem.js"></script>-->
- <style>
- #app {
- padding-bottom: 3rem;
- }
- .weui_cell:before {
- border-top: 0px !important;
- }
- .weui_btn {
- border-radius: 0px !important;
- }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <zmqalert v-bind:info = "alertInfo" v-on:donechoose="alertBtn"></zmqalert>
- <article style="bottom: 0;">
- <div class="weui_cells weui_cells_access zmq-width-90 zmq-bg-transparent" v-if="frameType == 0">
- <a class="weui_cell zmq-margin-top-10 zmq-bg-white zmq-radius-10" href="javascript:;" v-for="(store,index) in list">
- <div class="weui_cell_bd weui_cell_primary">
- <div class="wuliao-title zmq-border-bottom-1">
- <label class="zmq-text-msg">商品编码:{{store.bizGoodsDto.serialNumber}}</label>
- <!--<span class="zmq-text-msg" >-{{store.statusName}}</span>-->
- <span class="require zmq-line-1 zmq-float-right zmq-position-absolute">总库存:<label class="zmq-text-msg">{{store.tatalStock}}</label></span>
- </div>
- <div class="wuliao-title">
- <label class="zmq-text-font-06 zmq-margin-vertical-5">{{store.bizGoodsDto.comName}}</label>
- </div>
- <div class="detail clearfix">
- <span class="date zmq-text-explain">上架时间:{{store.createTime}}</span>
- <div class="org">
- <label v-if="store.isok == true" class="zmq-btn-border zmq-btn-border-done zmq-btn-img" v-on:click="controlThis(store,index)">已添加</label>
- <label v-else class="zmq-btn-border zmq-text-msg" v-on:click="controlThis(store,index)">入库</label>
- </div>
- </div>
- </div> </a>
- </div>
- <div class="weui_cells weui_cells_access zmq-width-90 zmq-bg-transparent" v-else-if="frameType == 1">
- <a class="weui_cell zmq-margin-top-10 zmq-bg-white zmq-radius-10" href="javascript:;" v-for="(store,index) in list">
- <div class="weui_cell_bd weui_cell_primary">
- <div class="wuliao-title zmq-border-bottom-1">
- <label class="zmq-text-msg">商品编码:{{store.bizGoodsDto.serialNumber}}</label>
- <!--<span class="zmq-text-msg" >-{{store.goodsType}}</span>-->
- <span class="require zmq-line-1 zmq-float-right zmq-position-absolute">总库存:<label class="zmq-text-msg">{{store.tatalStock}}</label></span>
- </div>
- <div class="wuliao-title">
- <label class="zmq-text-font-06 zmq-margin-vertical-5">{{store.bizGoodsDto.comName}}</label>
- </div>
- <div class="detail clearfix">
- <span class="date zmq-text-explain">上架时间:{{store.createTime}}</span>
- <div class="org">
- <label v-if="store.isok == true" class="zmq-btn-border-done zmq-btn-img zmq-btn-border" v-on:click="controlThis(store,index)">已添加</label>
- <label v-else class="zmq-btn-border zmq-text-msg" v-on:click="controlThis(store,index)">出库</label>
- </div>
- </div>
- </div> </a>
- </div>
- <div class="weui_cells weui_cells_access zmq-width-90 zmq-bg-transparent" v-else-if="frameType == 2">
- <a class="weui_cell zmq-margin-top-10 zmq-bg-white zmq-radius-10" href="javascript:;" v-for="(storeType,index) in list">
- <div class="weui_cell_bd weui_cell_primary">
- <div class="wuliao-title">
- <label class="zmq-text-msg zmq-text-font-07">{{storeType.typeName}}</label>
- </div>
- <div class="detail clearfix">
- <span class="date zmq-text-font-06">创建时间:{{storeType.createTime}}</span>
- </div>
- </div> </a>
- </div>
- <div class="weui_cells weui_cells_access zmq-width-90 zmq-bg-transparent" v-else-if ="frameType == 5">
- <a class="weui_cell zmq-margin-top-10 zmq-bg-white zmq-radius-10" href="javascript:;" v-for="(supplier,index) in list">
- <div class="weui_cell_bd weui_cell_primary">
- <div class="wuliao-title">
- <label class="zmq-text-msg zmq-text-font-07 zmq-padding-vertical-5">{{supplier.supplierName}}</label>
- </div>
- <div class="wuliao-title zmq-border-top-1">
- <label class="zmq-text-black zmq-text-font-06 zmq-margin-vertical-5">{{supplier.contacts}}-{{supplier.phone}}</label>
- </div>
- <div class="detail clearfix">
- <span class="date zmq-text-explain zmq-text-font-06">{{supplier.site}}</span>
- </div>
- </div> </a>
- </div>
- </article>
- <img class="zmq-img-nodata" v-show="hasData == false" src="../../image/nodata.png" />
- <div v-show="upLock == false" class="zmq-text-explain zmq-margin-top-10 zmq-textAlign-center zmq-margin-bottom-10 zmq-block-text">
- 已无更多数据
- </div>
- <footer v-show="frameType < 2">
- <div class="button zmq-bg-white zmq-padding-vertical-5">
- <div class="bd">
- <a href="javascript:void(0);" class="zmq-textAlign-center zmq-text-white zmq-width-90 zmq-btn-img zmq-padding-btn" v-on:click="sumbilt">提交{{frameTitle[frameType]}}({{hasChooseThisArr.length}})</a>
- </div>
- </div>
- </footer>
- </div>
- </body>
- <script type="text/javascript" src="../../script/api.js"></script>
- <script type="text/javascript" src="../../script/aui-scroll.js"></script>
- <script type="text/javascript" src="../../script/vue.js"></script>
- <script type="text/javascript" src="../../script/httpRequest.js"></script>
- <script type="text/javascript" src="../../script/vue_plugins.js"></script>
- <script type="text/javascript">
- var vm = '', type = '';
- apiready = function() {
- type = api.pageParam.type;
- vm = new Vue({
- el : '#app',
- data : {
- // 页面类别
- frameTitle : ["入库", "出库"],
- frameType : '',
- retariler_id : '',
- // 获取商品类别
- getStoreTypeUrl : 'getStoreTypeUrl',
- addTypeUrl : 'addStoreTypeUrl',
- // 获取供应商列表
- getSupplierUrl : 'getSupplierUrl',
- // 获取的列表信息
- list : [],
- // 获取库存url
- getStockUrl : 'getKucunInfoUrl',
- type : '',
- hasChooseThisArr : [], // 已经选择商品
- // 弹出框信息
- alertInfo : {
- show : false,
- title : '请输入类别名称',
- showMsg : true,
- msg : '',
- content : '',
- },
- // 是否有数据
- hasData : false,
- // 分页查询
- upLock : true,
- current : 1,
- total : 1,
- },
- methods : {
- init : function() {
- var _this = this;
- this.retariler_id = $api.getStorage("retailerid");
- this.frameType = type;
- this.addEvent("refushView", function() {
- _this.funcByType();
- _this.hasChooseThisArr = [];
- });
- this.configHeaderRefush(function() {
- _this.upLock = true;
- _this.current = 1;
- _this.downData = 'down';
- _this.funcByType();
- })
- // 根据frameType获取页面信息
- _this.funcByType();
- this.configBottomRefush(function(status) {
- if (_this.hasData == true) {
- // 开启上拉加载
- if (_this.total > _this.current) {
- _this.downData = 'up';
- _this.current = _this.current + 1;
- _this.funcByType();
- } else {
- // 上啦没有数据了
- _this.upLock = false;
- }
- }
- })
- },
- // 根据页面type调用方法
- funcByType : function() {
- switch (this.frameType) {
- case 0 :
- this.getStoreList();
- break;
- case 1 :
- this.getStoreList();
- break;
- case 2 :
- this.getStore();
- break;
- case 3 :
- this.getStore();
- break;
- case 4 :
- this.getStore();
- break;
- case 5 :
- this.getSupplier();
- break;
- default :
- break;
- }
- },
- // 获取商品列表
- getStoreList : function() {
- var data = {
- retailerId : this.retariler_id,
- current : this.current,
- }, _this = this;
- this.$post(this.getStockUrl, data, function(ret) {
- if (ret.code == 0) {
- _this.total = ret.page.pages;
- if (_this.downData == 'up') {
- _this.list = _this.list.concat(ret.page.records);
- } else {
- _this.list = ret.page.records;
- if (_this.list.length > 0) {
- _this.hasData = true;
- }
- }
- }
- })
- },
- // 获取商品类别列表
- getStore : function() {
- var data = {
- retailer_id : this.retariler_id,
- url : 'json',
- type : 'body'
- }, url = this.getStoreTypeUrl, _this = this;
- this.requestAjax(data, url, function(ret) {
- _this.list = ret.list;
- if (ret.list.length > 0) {
- _this.hasData = true;
- }
- })
- },
- // 获取供应商列表
- getSupplier : function() {
- var data = {
- retailer_id : this.retariler_id,
- url : 'json',
- type : 'body'
- }, url = this.getSupplierUrl, _this = this;
- this.requestAjax(data, url, function(ret) {
- _this.list = ret.list;
- if (ret.list.length > 0) {
- _this.hasData = true;
- }
- })
- },
- // 添加一个商品类别
- chooseThis : function(name) {
- var data = {
- retailerId : this.retariler_id,
- typeName : name,
- url : 'json',
- type : 'body'
- }, url = this.addTypeUrl, _this = this;
- // this.showModal("添加提示", "是否添加该类别?", ["确认", "取消"], function(index) {
- // if (index == 1) {
- _this.requestAjax(data, url, function(ret) {
- api.toast({
- msg : '添加类别成功'
- });
- setTimeout(function() {
- _this.getStore();
- // 告诉添加商品页面已完善类别
- _this.sendEvent("refushModel");
- }, 200);
- })
- // };
- // })
- },
- // 添加商品类别
- add : function() {
- var _this = this;
- // this.showPromt("添加类别", "请输入库存名称", ["确认", "取消"], function(ret) {
- // if (ret.buttonIndex == 1) {
- //
- // }
- // })
- this.alertInfo.show = true;
- },
- // 点击了弹出层的按钮
- alertBtn : function(type) {
- this.chooseThis(this.alertInfo.content);
- },
- // 点击进货出货
- controlThis : function(good, index) {
- var _this = this;
- var title = this.frameTitle[this.frameType];
- //this.showPromt(title + "提示", "请输入" + title + '数量,单价默认为1元', ["确认", "取消"], function(ret) {
- //if (ret.buttonIndex == 1) {
- if (_this.list[index].isok == false || typeof _this.list[index].isok == 'undefined') {
- _this.$set(_this.list[index], "isok", true);
- _this.hasChooseThisArr.push(good);
- } else {
- var gi = _this.hasChooseThisArr.indexOf(good);
- _this.$set(_this.list[index], "isok", false);
- _this.hasChooseThisArr.splice(gi, 1);
- }
- //}
- //})
- },
- // 提交 -- 跳转扫码之后的页面
- sumbilt : function() {
- // 将this.hasChooseThisArr为null的剔除掉
- if(this.hasChooseThisArr.length == 0){
- api.toast({
- msg:'请先选择商品'
- });
- return;
- }
- var page = {
- content : JSON.stringify(this.hasChooseThisArr),
- type : this.frameType,
- page : 'nnn', // 页面进销存进入的
- }
- this.goWin("orderPlace_win", "orderPlace_win.html", page)
- },
- // 请求链接
- requestAjax : function(data, url, callback) {
- var _this = this;
- this.$post(url, data, function(ret) {
- if (ret.code == 0) {
- callback(ret);
- }
- })
- }
- },
- mounted : function() {
- this.init();
- }
- })
- }
- function goWin(winName) {
- api.openWin({
- name : winName,
- url : './' + winName + '.html'
- });
- }
- function add() {
- // 添加了
- if (type == 2) {
- vm.add();
- } else if (type == 5) {
- goWin("addSupplier_win");
- }
- }
- </script>
- </html>
|