123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- $(function () {
- });
- let vm = new Vue({
- el: '#rrapp',
- data: {
- selectButtonDisabled:true,
- q: {
- storeId: '',
- barCode: '',
- sku: '',
- isHead: '0',
- pdfType: '36',
- headUrl: '',
- isPrintRate:'1'
- },
- stores: [],
- labels:[],
- isHeads: [{
- id: '0',
- name: '无标签头'
- }, {
- id: '1',
- name: '有标签头'
- }],
- isPrintRates: [{
- id: '0',
- name: '不打印税率'
- }, {
- id: '1',
- name: '打印税率'
- }],
- pdfTypes: [ {id: '36',
- name: '36规格'}
- ]
- },
- methods: {
- changeHead:function(){
- // console.log(vm.q)
- // console.log(vm.selectButtonDisabled)
- if (vm.q.isHead=='0'){
- vm.pdfTypes=[ {id: '36',
- name: '36规格'}
- ];
- vm.q.pdfType='36';
- vm.selectButtonDisabled=!vm.selectButtonDisabled;
- }else {
- vm.pdfTypes=[{
- id: '1',
- name: '1规格'
- }, {
- id: '2',
- name: '2规格'
- }, {
- id: '4',
- name: '4规格'
- }, {
- id: '9',
- name: '9规格'
- }, {
- id: '12',
- name: '12规格'
- }, {
- id: '18',
- name: '18规格'
- }, {id: '36',
- name: '36规格'}
- ]
- vm.selectButtonDisabled=!vm.selectButtonDisabled;
- }
- },
- // selectLabelHead: function () {
- //
- //
- //
- //
- // alert("selectLabelHead")
- // },
- exportPdf: function () {
- if (vm.q.storeId==''){
- alert("请先选择门店")
- return;
- }
- if (vm.q.sku=='' && vm.q.barCode==''){
- alert("请先输入sku或者条形码")
- return;
- }
- if (vm.q.isHead=='1' && vm.q.headUrl==''){
- alert("请先标签头")
- return;
- }
- window.open("../pdf/printPdf?type="+vm.q.pdfType+"&sku="+vm.q.sku+"&prodBarcode="
- +vm.q.barCode+"&head="+vm.q.isHead+"&headUrl="+vm.q.headUrl+"&storeId="+vm.q.storeId+"&isPrintRate="+vm.q.isPrintRate);
- $.get("../pdf/printPdf?type="+vm.q.pdfType+"&sku="+vm.q.sku+"&prodBarcode="
- +vm.q.barCode+"&head="+vm.q.isHead+"&headUrl="+vm.q.headUrl+"&storeId="+vm.q.storeId+"&isPrintRate="+vm.q.isPrintRate, function (r) {
- console.log(r)
- alert(r)
- });
- },
- barCodeEnter:function () {
- this.exportPdf();
- },
- uploadExcelSuccess: function (data) {
- if(data.code==0){
- console.log(data)
- var PDFGoodsDtoList = data.PDFGoodsDtoList;
- for(var i=0;i<PDFGoodsDtoList.length;i++){
- var pdfGoodsDto = PDFGoodsDtoList[i];
- window.open("../pdf/printPdf?type="+pdfGoodsDto.type+"&sku="+pdfGoodsDto.sku+"&prodBarcode="
- +pdfGoodsDto.prodBarcode+"&head="+pdfGoodsDto.head+"&headUrl="+pdfGoodsDto.headUrl+"&storeId="+pdfGoodsDto.storeId+"&isPrintRate="+pdfGoodsDto.isPrintRate);
- }
- }else{
- console.log(data)
- }
- },
- uploadExcelError: function (data) {
- console.log(data);
- alert('上传出现异常,请重试!');
- },
- uploadExcelFormatError: function (file) {
- this.$Notice.warning({
- title: '文件格式不正确',
- desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
- });
- }
- },
- mounted() {
- $.get("../store/queryAll", function (r) {
- vm.stores = r.list;
- });
- $.ajax({
- type: "POST",
- url: "../goodslabelhead/list",
- contentType: "application/json",
- success: function (r) {
- if (r.code === 0) {
- console.log(r);
- vm.labels = r.page.list
- } else {
- alert(r.msg);
- }
- }
- });
- }
- });
|