123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>AUI快速完成布局</title>
- <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
- <link rel="stylesheet" type="text/css" href="../../css/html.css" />
- <style>
- @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
- .aui-list .aui-list-item {
- background-image: none;
- }
- }
- @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
- .aui-list {
- background-image: none;
- }
- }
- .aui-list .aui-list-header {
- padding: 0.5rem;
- }
- body {
- padding-bottom: 3rem;
- }
- </style>
- </head>
- <body>
- <div id="app">
- <zmqalert v-bind:info = "alertInfo" v-on:donechoose="alertBtn"></zmqalert>
- <div class="aui-content aui-margin-b-15 zmq-width-90 zmq-margin-top-10 zmq-radius-5">
- <ul class="aui-list aui-form-list zmq-border-none">
- <li class="aui-list-header zmq-bg-white zmq-flex zmq-flex-start zmq-text-msg zmq-text-font-08">
- <img src="../../image/drawable-xhdpi/sp.png" class="zmq-icon-inline-middle" />配料信息
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item zmq-border-none">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料编号
- </div>
- <div class="aui-list-item-input">
- <img class="zmq-btnIcon-right" src="../../image/drawable-xhdpi/scanbtn.png" v-on:click="scanCode"/>
- <input type="number" placeholder="请输入配料编号" v-model="storeInfo.serialNumber" readonly="readonly" v-on:click= "alertInfo.show = true" class="zmq-text-font-07" />
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item zmq-border-none">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料名称
- </div>
- <div class="aui-list-item-input">
- <input type="text" placeholder="请输入配料名称" v-model = "storeInfo.comName" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料类别
- </div>
- <div class="aui-list-item-input" v-on:click="chooseType">
- <div class="zmq-text-done zmq-text-font-07" v-cloak>
- {{typeItem.name}}
- </div>
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料品牌
- </div>
- <div class="aui-list-item-input">
- <input type="text" placeholder="请输入品牌" v-model = "storeInfo.brand" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料规格
- </div>
- <div class="aui-list-item-input">
- <input type="text" placeholder="请输入配料规格" v-model = "storeInfo.spec" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料型号
- </div>
- <div class="aui-list-item-input">
- <input type="text" placeholder="请输入配料型号" v-model = "storeInfo.model" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 配料单位
- </div>
- <div class="aui-list-item-input">
- <input type="text" placeholder="请输入配料单位" v-model = "storeInfo.unti" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- </ul>
- </div>
- <div class="aui-content aui-margin-b-15 zmq-width-90 zmq-margin-top-10 zmq-radius-5">
- <ul class="aui-list aui-form-list zmq-border-none">
- <li class="aui-list-header zmq-bg-white zmq-flex zmq-flex-start zmq-text-msg zmq-text-font-08">
- <img src="../../image/drawable-xhdpi/orderCode.png" class="zmq-icon-inline-middle" />配料价格
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item zmq-border-none">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 进价
- </div>
- <div class="aui-list-item-input">
- <input type="number" placeholder="请输入配料进价" v-model = "storeInfo.bid" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item zmq-border-none">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 批发价
- </div>
- <div class="aui-list-item-input">
- <input type="number" placeholder="请输入配料批发价" v-model = "storeInfo.wholesale" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- <div class="zmq-line-level zmq-width-90 zmq-bg-shallow"></div>
- <li class="aui-list-item zmq-border-none">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-label zmq-text-font-07">
- 销售价
- </div>
- <div class="aui-list-item-input">
- <input type="number" placeholder="请输入配料销售价" v-model = "storeInfo.marketing" class="zmq-text-font-07">
- </div>
- </div>
- </li>
- </ul>
- </div>
- <div class="zmq-footer-fixed zmq-padding-vertical-5">
- <div class="zmq-width-90 zmq-btn-img zmq-padding-vertical-10 zmq-textAlign-center zmq-text-white" v-on:click="addStore">
- 提交信息
- </div>
- </div>
- </div>
- </body>
- <script src="../../script/api.js" type="text/javascript"></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/elememt-ui.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">
- apiready = function() {
- var id = api.pageParam.id;
- var page = api.pageParam.page;
- //var id = 0,page = 0;
- new Vue({
- el : '#app',
- data : {
- page : page,
- // 添加配料
- addStoreUrl : 'addStoreUrl',
- imageType : ['album', 'camera'], // 选择图片路径
- imgs : '', // 选择的图片
- // 配料类别
- getStoreTypeUrl : 'getStoreTypeUrl',
- typeList : [], // 配料类别数据
- // 配料详情
- storeInfo : {
- wlbm : '', // 物料编码
- comName : '', // 配料名称 ;
- serialNumber : '', //条形码 ;
- brand : '', // 品牌
- spec : '', // 规格 ;
- model : '', // 型号;
- goodstypeId : '', // 分类主键
- goodsType : '', //分类名称 ;
- unti : '', //单位 ;
- marketing : '', // 销售价 ;
- bid : '', //进价 ;
- wholesale : '', // 批发价
- remark : '', //备注 ;
- retailerId : '', //门店主键 ;
- spcx : '', // 适配车型
- },
- // 选择器
- UIActionSelector : '',
- FNScanner : '', // 扫码
- xwScanner : '',
- // 选择的分类
- typeItem : {
- name : '点击选择分类',
- id : ''
- },
- // 根据扫出来的轮胎码获取配料
- getStoreUrl : 'jinstoreByScanUrl',
- // 根据扫出来的码获取配料 0705
- getStoreUrl0705 : 'addStoreByScanUrl',
- // 弹出框信息
- alertInfo : {
- show : false,
- title : '请输入条码号',
- showMsg : true,
- msg : '请输入配料号',
- content : '',
- },
- },
- methods : {
- init : function() {
- // 获取配料类别
- var _this = this;
- this.storeInfo.retailerId = $api.getStorage("retailerid");
- if (page == 'get') {
- this.getStoreInfo();
- } else {
- this.getStore();
- }
- this.FNScanner = api.require('FNScanner');
- this.xwScanner = api.require('xwScanner');
- this.UIActionSelector = api.require('UIActionSelector');
- this.addEvent("refushModel", function() {
- _this.getStore();
- })
- // this.imageBrowser = api.require('imageBrowser');
- },
- // 获取配料详情
- getStoreInfo : function() {
- var data = {
- retailer_id : this.storeInfo.retailerId
- }, url = this.getStoreInfoUrl, _this = this;
- _this.$post(url, data, function(ret) {
- if (ret.code == 0) {
- var storeInfo = ret.bizGoodsDto;
- _this.storeInfo = {
- wlbm : this.wlbm,
- comName : storeInfo.comName, // 配料名称 ;
- serialNumber : storeInfo.serialNumber, //条形码 ;
- goodsNum : storeInfo.goodsNum, //配料编号;
- spec : storeInfo.spec, //规格 ;
- brand : storeInfo.brand, // 品牌
- model : storeInfo.model, // 配料型号
- goodsNum : storeInfo.goodsNum, // 配料库存数量
- goodstypeId : storeInfo.goodstypeId, // 分类主键
- goodsType : storeInfo.goodsType, //分类名称 ;
- unti : storeInfo.unti, //单位 ;
- marketing : storeInfo.marketing, // 销售价 ;
- wholesale : storeInfo.wholesale, // 批发价
- bid : storeInfo.bid, //进价 ;
- remark : storeInfo.remark, //备注 ;
- }
- }
- }, id);
- },
- // 点击了弹出层的按钮
- alertBtn : function(type) {
- this.storeInfo.serialNumber = this.alertInfo.content;
- this.getStoreInfoScan();
- },
- // 点击扫码获取条形码
- scanCode : function() {
- var _this = this;
- this.scant(this.xwScanner, function(content) {
- _this.storeInfo.serialNumber = content;
- _this.alertInfo.content = content;
- _this.getStoreInfoScan0705();
- })
- },
- getStoreInfoScan0705 : function() {
- var _this = this;
- var url = this.getStoreUrl0705;
- var data = {
- serialNumber : _this.storeInfo.serialNumber,
- retailerId : this.storeInfo.retailerId,
- url : 'json',
- type : 'body'
- }
- _this.$post(url, data, function(ret) {
- if (ret.code == 0) {
- var storeInfo = ret.data;
- if (storeInfo == null) {
- _this.storeInfo = {
- wlbm : '',
- serialNumber : _this.storeInfo.serialNumber,
- comName : '', // 配料名称 ;
- brand : '', // 品牌
- spec : '', // 规格 ;
- model : '', // 型号;
- goodstypeId : '', // 分类主键
- goodsType : '', //分类名称 ;
- unti : '', //单位 ;
- marketing : '', // 销售价 ;
- bid : '', //进价 ;
- wholesale : '', // 批发价
- remark : '', //备注 ;
- retailerId : _this.storeInfo.retailerId, //门店主键 ;
- spcx : '', // 适配车型
- }
- return;
- } else {
- _this.storeInfo = {
- serialNumber : _this.storeInfo.serialNumber,
- comName : storeInfo.materialName, // 配料名称 ;
- spec : storeInfo.specs, //规格 ;
- brand : storeInfo.brand, // 品牌
- model : storeInfo.model, // 配料型号
- goodsType : '轮胎', // 配料分类
- goodstypeId : '', // 分类主键
- wlbm : storeInfo.materialCode, // 物料编码
- unti : '', //单位 ;
- marketing : '', // 销售价 ;
- bid : '', //进价 ;
- wholesale : '', // 批发价
- remark : '', //备注 ;
- retailerId : _this.storeInfo.retailerId, //门店主键 ;
- spcx : '', // 适配车型
- }
- }
- }
- });
- },
- // 根据扫出来的码获取配料
- getStoreInfoScan : function() {
- var _this = this;
- var url = this.getStoreUrl;
- _this.$post(url, "", function(ret) {
- if (ret.code == 0) {
- var storeInfo = ret.materialDto;
- if (storeInfo == null) {
- api.toast({
- msg : '暂无该条码对应配料信息,请自行完善'
- });
- _this.storeInfo = {
- serialNumber : _this.storeInfo.serialNumber,
- comName : '', // 配料名称 ;
- brand : '', // 品牌
- spec : '', // 规格 ;
- model : '', // 型号;
- goodstypeId : '', // 分类主键
- goodsType : '', //分类名称 ;
- unti : '', //单位 ;
- marketing : '', // 销售价 ;
- bid : '', //进价 ;
- wholesale : '', // 批发价
- remark : '', //备注 ;
- retailerId : $api.getStorage("retailerid"), //门店主键 ;
- spcx : '', // 适配车型
- }
- return;
- } else {
- _this.storeInfo = {
- comName : storeInfo.materialName, // 配料名称 ;
- spec : storeInfo.specs, //规格 ;
- brand : storeInfo.brand, // 品牌
- model : storeInfo.model, // 配料型号
- goodsType : '轮胎', // 配料分类
- goodstypeId : '', // 分类主键
- }
- }
- }
- }, _this.storeInfo.serialNumber);
- },
- // 点击选择分类
- chooseType : function() {
- var _this = this;
- if (this.typeList == null || this.typeList.length == 0) {
- // 还没有维护分类信息
- this.showModal("温馨提示", "检测到您还未完善配料类别信息,请先完善配料类别", ["立即完善", "稍后完善"], function(index) {
- if (index == 1) {
- var page = {
- type : 2
- }
- _this.goWin("addModel_win", "./addModel_win.html", page);
- }
- return;
- })
- } else {
- this.chooseRegion(this.UIActionSelector, 1, this.typeList, function(ret) {
- if (ret.eventType == 'ok') {
- _this.typeItem = ret.selectedInfo[0];
- }
- });
- }
- },
- // 获取配料分类
- getStore : function() {
- var data = {
- retailer_id : this.storeInfo.retailerId,
- url : 'json',
- type : 'body'
- }, url = this.getStoreTypeUrl, _this = this;
- _this.$post(url, data, function(ret) {
- if (ret.code == 0) {
- _this.typeList = _this.actionSelectorData(ret.list, {
- name : "typeName",
- id : "id"
- });
- }
- })
- },
- // 提交添加配料
- addStore : function() {
- if (this.typeItem.id == '') {
- api.toast({
- msg : '请选择配料分类'
- });
- return;
- }
- // 判断信息 -- 价格必须填写
- // marketing : '', // 销售价 ;
- // bid : '', //进价 ;
- // wholesale : '', // 批发价
- if(this.storeInfo.bid == ''){
- api.toast({
- msg:'请填写配料进价'
- });
- return;
- }
- if(this.storeInfo.wholesale == ''){
- api.toast({
- msg:'请填写配料批发价'
- });
- return;
- }
- if(this.storeInfo.marketing == ''){
- api.toast({
- msg:'请填写配料销售价'
- });
- return;
- }
- this.storeInfo.goodsType = this.typeItem.name;
- this.storeInfo.goodstypeId = this.typeItem.id;
- // , {image : this.imgs}
- var data = this.storeInfo, url = this.addStoreUrl, _this = this;
- _this.$post(url, data, function(ret) {
- if (ret.code == 0) {
- api.toast({
- msg : '添加配料信息成功'
- });
- // 需要刷新外面列表
- _this.sendEvent("refushView");
- _this.sendEvent("refushStock");
- setTimeout(function() {
- api.closeWin({
- });
- }, 500);
- }
- })
- },
- // 选择图品
- ci : function() {
- var _this = this;
- this.chooseImage(function(path) {
- _this.imgs = path;
- })
- },
- },
- mounted : function() {
- this.init();
- }
- })
- }
- </script>
- </html>
|