|
@@ -1,333 +1,504 @@
|
|
|
$(function () {
|
|
|
- $("#jqGrid").jqGrid({
|
|
|
- url: '../goodsproduct/list',
|
|
|
- datatype: "json",
|
|
|
- colModel: [
|
|
|
- {label: 'mallGoodsProductSn', name: 'mallGoodsProductSn', index: 'mall_goods_product_sn', key: true, hidden: true},
|
|
|
- {label: '商户编号', name: 'merchSn', index: 'merch_sn', width: 160},
|
|
|
- {label: '第三方商户编号', name: 'thirdMerchSn', index: 'third_merch_sn', width: 160},
|
|
|
- {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 140},
|
|
|
- {label: 'sku', name: 'sku', index: 'sku', width: 140},
|
|
|
- {label: '海关商品编码', name: 'cusGoodsCode', index: 'cus_goods_code', width: 140},
|
|
|
- {label: '中文名称', name: 'prodName', index: 'prod_name', width: 140},
|
|
|
- {label: '英文名称', name: 'prodEname', index: 'prod_ename', width: 140},
|
|
|
- {label: '中文备案名称', name: 'prodRecordName', index: 'prod_record_name', width: 140},
|
|
|
- {label: '英文备案名称', name: 'prodRecordEname', index: 'prod_record_ename', width: 140},
|
|
|
- {label: '国检规格型号', name: 'ciqProdModel', index: 'ciq_prod_model', width: 140},
|
|
|
- {label: '品牌', name: 'prodBrand', index: 'prod_brand', width: 140},
|
|
|
- {label: '原产国代码', name: 'oriCntCode', index: 'ori_cnt_code', width: 140},
|
|
|
- {label: '计量单位代码', name: 'unitCode', index: 'unit_code', width: 140},
|
|
|
- {label: '申报价格', name: 'declPrice', index: 'decl_price', width: 140},
|
|
|
- {label: '申报币种代码', name: 'declCurrencyCode', index: 'decl_currency_code', width: 140},
|
|
|
- {label: '供应商企业名称', name: 'supplierName', index: 'supplier_name', width: 140},
|
|
|
- {label: '供货商企业国别代码', name: 'supplierCntCode', index: 'supplier_cnt_code', width: 140},
|
|
|
- {label: '生产企业名称', name: 'prodCompName', index: 'prod_comp_name', width: 140},
|
|
|
- {label: '生产企业国别名称', name: 'prodCompCntCode', index: 'prod_comp_cnt_code', width: 140},
|
|
|
- {label: '主要成分', name: 'ciqMainEle', index: 'ciq_main_ele', width: 140},
|
|
|
- {label: '国检监管类别', name: 'ciqMonitorType', index: 'ciq_monitor_type', width: 140},
|
|
|
- {label: '是否法检', name: 'isLaw', index: 'is_law', width: 140,
|
|
|
- formatter: function (value) {
|
|
|
- if (value == '0') {
|
|
|
- return '否';
|
|
|
- } else if (value == '1') {
|
|
|
- return '是';
|
|
|
- }
|
|
|
- return '';
|
|
|
- }},
|
|
|
- {label: '是否赠品', name: 'isGift', index: 'is_gift', width: 140,
|
|
|
- formatter: function (value) {
|
|
|
- if (value == '0') {
|
|
|
- return '否';
|
|
|
- } else if (value == '1') {
|
|
|
- return '是';
|
|
|
- }
|
|
|
- return '';
|
|
|
- }},
|
|
|
- {label: '第一法定单位数量', name: 'legalUnit1Qty', index: 'legal_unit1_qty', width: 140},
|
|
|
- {label: '净重,kg', name: 'netWeight', index: 'net_weight', width: 140},
|
|
|
- {label: '第二法定单位数量', name: 'legalUnit2Qty', index: 'legal_unit2_qty', width: 140},
|
|
|
- {label: '毛重,kg', name: 'grossWeight', index: 'gross_weight', width: 140},
|
|
|
- {label: '园区账册编号', name: 'localEmsNo', index: 'local_ems_no', width: 140},
|
|
|
- {label: '园区商品序号', name: 'itemRecordNo', index: 'item_record_no', width: 140},
|
|
|
- {label: '账册分类代码', name: 'emsClassCode', index: 'ems_class_code', width: 140},
|
|
|
- {label: '是否发送', name: 'isSend', index: 'is_send', width: 140,formatter: function (value) {
|
|
|
- if (value == '0') {
|
|
|
- return '未发送';
|
|
|
- } else if (value == '1') {
|
|
|
- return '发送成功';
|
|
|
- } else if (value == '2') {
|
|
|
- return '发送失败';
|
|
|
- }
|
|
|
- return '';
|
|
|
- }},
|
|
|
- {label: '海关申报要素', name: 'cusDeclEle', index: 'cus_decl_ele', width: 140},
|
|
|
- {label: '创建人编号', name: 'createrSn', index: 'creater_sn', width: 140},
|
|
|
- {label: '创建时间', name: 'createTime', index: 'create_time', width: 140,
|
|
|
- formatter: function (value) {
|
|
|
- return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
- }},
|
|
|
- {label: '修改人编号', name: 'moderSn', index: 'moder_sn', width: 140},
|
|
|
- {label: '修改时间', name: 'modTime', index: 'mod_time', width: 140,
|
|
|
- formatter: function (value) {
|
|
|
- return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
- }},
|
|
|
+ $("#jqGrid").jqGrid({
|
|
|
+ url: '../goodsproduct/list',
|
|
|
+ datatype: "json",
|
|
|
+ colModel: [
|
|
|
+ {
|
|
|
+ label: 'mallGoodsProductSn',
|
|
|
+ name: 'mallGoodsProductSn',
|
|
|
+ index: 'mall_goods_product_sn',
|
|
|
+ key: true,
|
|
|
+ hidden: true
|
|
|
+ },
|
|
|
+ {label: '商户编号', name: 'merchSn', index: 'merch_sn', width: 160},
|
|
|
+ {label: '第三方商户编号', name: 'thirdMerchSn', index: 'third_merch_sn', width: 160},
|
|
|
+ {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 140},
|
|
|
+ {label: 'sku', name: 'sku', index: 'sku', width: 140},
|
|
|
+ {label: '批次号', name: 'batchNo', index: 'batch_no', width: 140},
|
|
|
+ {label: '海关商品编码', name: 'cusGoodsCode', index: 'cus_goods_code', width: 140},
|
|
|
+ {label: '中文名称', name: 'prodName', index: 'prod_name', width: 140},
|
|
|
+ {label: '英文名称', name: 'prodEname', index: 'prod_ename', width: 140},
|
|
|
+ {label: '中文备案名称', name: 'prodRecordName', index: 'prod_record_name', width: 140},
|
|
|
+ {label: '英文备案名称', name: 'prodRecordEname', index: 'prod_record_ename', width: 140},
|
|
|
+ {label: '国检规格型号', name: 'ciqProdModel', index: 'ciq_prod_model', width: 140},
|
|
|
+ {label: '品牌', name: 'prodBrand', index: 'prod_brand', width: 140},
|
|
|
+ {label: '原产国代码', name: 'oriCntCode', index: 'ori_cnt_code', width: 140},
|
|
|
+ {label: '计量单位代码', name: 'unitCode', index: 'unit_code', width: 140},
|
|
|
+ {label: '申报价格', name: 'declPrice', index: 'decl_price', width: 140},
|
|
|
+ {label: '申报币种代码', name: 'declCurrencyCode', index: 'decl_currency_code', width: 140},
|
|
|
+ {label: '供应商企业名称', name: 'supplierName', index: 'supplier_name', width: 140},
|
|
|
+ {label: '供货商企业国别代码', name: 'supplierCntCode', index: 'supplier_cnt_code', width: 140},
|
|
|
+ {label: '生产企业名称', name: 'prodCompName', index: 'prod_comp_name', width: 140},
|
|
|
+ {label: '生产企业国别名称', name: 'prodCompCntCode', index: 'prod_comp_cnt_code', width: 140},
|
|
|
+ {label: '主要成分', name: 'ciqMainEle', index: 'ciq_main_ele', width: 140},
|
|
|
+ {label: '国检监管类别', name: 'ciqMonitorType', index: 'ciq_monitor_type', width: 140},
|
|
|
+ {
|
|
|
+ label: '是否法检', name: 'isLaw', index: 'is_law', width: 140,
|
|
|
+ formatter: function (value) {
|
|
|
+ if (value == '0') {
|
|
|
+ return '否';
|
|
|
+ } else if (value == '1') {
|
|
|
+ return '是';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是否赠品', name: 'isGift', index: 'is_gift', width: 140,
|
|
|
+ formatter: function (value) {
|
|
|
+ if (value == '0') {
|
|
|
+ return '否';
|
|
|
+ } else if (value == '1') {
|
|
|
+ return '是';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {label: '第一法定单位数量', name: 'legalUnit1Qty', index: 'legal_unit1_qty', width: 140},
|
|
|
+ {label: '净重,kg', name: 'netWeight', index: 'net_weight', width: 140},
|
|
|
+ {label: '第二法定单位数量', name: 'legalUnit2Qty', index: 'legal_unit2_qty', width: 140},
|
|
|
+ {label: '毛重,kg', name: 'grossWeight', index: 'gross_weight', width: 140},
|
|
|
+ {label: '园区账册编号', name: 'localEmsNo', index: 'local_ems_no', width: 140},
|
|
|
+ {label: '园区商品序号', name: 'itemRecordNo', index: 'item_record_no', width: 140},
|
|
|
+ {label: '账册分类代码', name: 'emsClassCode', index: 'ems_class_code', width: 140},
|
|
|
+ {
|
|
|
+ label: '是否发送', name: 'isSend', index: 'is_send', width: 140, formatter: function (value) {
|
|
|
+ if (value == '0') {
|
|
|
+ return '未发送';
|
|
|
+ } else if (value == '1') {
|
|
|
+ return '发送成功';
|
|
|
+ } else if (value == '2') {
|
|
|
+ return '发送失败';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ label: '发送时间', name: 'sendTime', index: 'send_time', width: 140, formatter: function (value) {
|
|
|
+ return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'oms审核状态', name: 'omsAuditStatus', index: 'oms_audit_status', width: 140, formatter: function (value) {
|
|
|
+ if (value == '0') {
|
|
|
+ return '未审核';
|
|
|
+ } else if (value == '1') {
|
|
|
+ return '待审核';
|
|
|
+ } else if (value == '2') {
|
|
|
+ return '审核成功';
|
|
|
+ } else if (value == '3') {
|
|
|
+ return '审核失败';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'oms审核备注', name: 'omsAuditRemark', index: 'oms_audit_remark', width: 140 },
|
|
|
+ {
|
|
|
+ label: 'oms回调时间', name: 'omsCallbackTime', index: 'oms_callback_time', width: 140, formatter: function (value) {
|
|
|
+ return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'oms审核时间', name: 'omsAuditTime', index: 'oms_audit_time', width: 140, formatter: function (value) {
|
|
|
+ return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {label: '海关申报要素', name: 'cusDeclEle', index: 'cus_decl_ele', width: 140},
|
|
|
+ {label: '创建人编号', name: 'createrSn', index: 'creater_sn', width: 140},
|
|
|
+ {
|
|
|
+ label: '创建时间', name: 'createTime', index: 'create_time', width: 140,
|
|
|
+ formatter: function (value) {
|
|
|
+ return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {label: '修改人编号', name: 'moderSn', index: 'moder_sn', width: 140},
|
|
|
+ {
|
|
|
+ label: '修改时间', name: 'modTime', index: 'mod_time', width: 140,
|
|
|
+ formatter: function (value) {
|
|
|
+ return transDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- ],
|
|
|
- viewrecords: true,
|
|
|
- height: 550,
|
|
|
- rowNum: 10,
|
|
|
- rowList: [10, 30, 50],
|
|
|
- rownumbers: true,
|
|
|
- rownumWidth: 25,
|
|
|
- autowidth: true,
|
|
|
- shrinkToFit: false,
|
|
|
- autoScroll: true, //开启水平滚动条
|
|
|
- multiselect: true,
|
|
|
- width: 1600,
|
|
|
- pager: "#jqGridPager",
|
|
|
- jsonReader: {
|
|
|
- root: "page.list",
|
|
|
- page: "page.currPage",
|
|
|
- total: "page.totalPage",
|
|
|
- records: "page.totalCount"
|
|
|
- },
|
|
|
- prmNames: {
|
|
|
- page: "page",
|
|
|
- rows: "limit",
|
|
|
- order: "order"
|
|
|
- },
|
|
|
- gridComplete: function () {
|
|
|
- $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
|
|
|
- }
|
|
|
- });
|
|
|
+ ],
|
|
|
+ viewrecords: true,
|
|
|
+ height: 550,
|
|
|
+ rowNum: 10,
|
|
|
+ rowList: [10, 30, 50],
|
|
|
+ rownumbers: true,
|
|
|
+ rownumWidth: 25,
|
|
|
+ autowidth: true,
|
|
|
+ shrinkToFit: false,
|
|
|
+ autoScroll: true, //开启水平滚动条
|
|
|
+ multiselect: true,
|
|
|
+ width: 1600,
|
|
|
+ pager: "#jqGridPager",
|
|
|
+ jsonReader: {
|
|
|
+ root: "page.list",
|
|
|
+ page: "page.currPage",
|
|
|
+ total: "page.totalPage",
|
|
|
+ records: "page.totalCount"
|
|
|
+ },
|
|
|
+ prmNames: {
|
|
|
+ page: "page",
|
|
|
+ rows: "limit",
|
|
|
+ order: "order"
|
|
|
+ },
|
|
|
+ gridComplete: function () {
|
|
|
+ $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
var exportMsg;
|
|
|
|
|
|
let vm = new Vue({
|
|
|
- el: '#rrapp',
|
|
|
- data: {
|
|
|
- showList: true,
|
|
|
- title: null,
|
|
|
- goodsProduct: {},
|
|
|
- ruleValidate: {
|
|
|
- name: [
|
|
|
- {required: true, message: '名称不能为空', trigger: 'blur'}
|
|
|
- ]
|
|
|
- },
|
|
|
- q: {
|
|
|
- name: ''
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- query: function () {
|
|
|
- vm.reload();
|
|
|
- },
|
|
|
- add: function () {
|
|
|
- vm.showList = false;
|
|
|
- vm.title = "新增";
|
|
|
- vm.goodsProduct = {};
|
|
|
- },
|
|
|
- update: function (event) {
|
|
|
- let mallGoodsProductSn = getSelectedRow();
|
|
|
- if (mallGoodsProductSn == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- vm.showList = false;
|
|
|
- vm.title = "修改";
|
|
|
+ el: '#rrapp',
|
|
|
+ data: {
|
|
|
+ showList: true,
|
|
|
+ title: null,
|
|
|
+ goodsProduct: {},
|
|
|
+ ruleValidate: {
|
|
|
+ name: [
|
|
|
+ {required: true, message: '名称不能为空', trigger: 'blur'}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ q: {
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ query: function () {
|
|
|
+ vm.reload();
|
|
|
+ },
|
|
|
+ add: function () {
|
|
|
+ vm.showList = false;
|
|
|
+ vm.title = "新增";
|
|
|
+ vm.goodsProduct = {};
|
|
|
+ },
|
|
|
+ update: function (event) {
|
|
|
+ let mallGoodsProductSn = getSelectedRow();
|
|
|
+ if (mallGoodsProductSn == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ vm.showList = false;
|
|
|
+ vm.title = "修改";
|
|
|
|
|
|
- vm.getInfo(mallGoodsProductSn)
|
|
|
- },
|
|
|
- saveOrUpdate: function (event) {
|
|
|
- let url = vm.goodsProduct.mallGoodsProductSn == null ? "../goodsproduct/save" : "../goodsproduct/update";
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: url,
|
|
|
- contentType: "application/json",
|
|
|
- data: JSON.stringify(vm.goodsProduct),
|
|
|
- success: function (r) {
|
|
|
- if (r.code === 0) {
|
|
|
- alert('操作成功', function (index) {
|
|
|
- vm.reload();
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert(r.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- del: function (event) {
|
|
|
- let mallGoodsProductSns = getSelectedRows();
|
|
|
- if (mallGoodsProductSns == null){
|
|
|
- return;
|
|
|
- }
|
|
|
+ vm.getInfo(mallGoodsProductSn)
|
|
|
+ },
|
|
|
+ saveOrUpdate: function (event) {
|
|
|
+ let url = vm.goodsProduct.mallGoodsProductSn == null ? "../goodsproduct/save" : "../goodsproduct/update";
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: url,
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(vm.goodsProduct),
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code === 0) {
|
|
|
+ alert('操作成功', function (index) {
|
|
|
+ vm.reload();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ del: function (event) {
|
|
|
+ let mallGoodsProductSns = getSelectedRows();
|
|
|
+ if (mallGoodsProductSns == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- confirm('确定要删除选中的记录?', function () {
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "../goodsproduct/delete",
|
|
|
- contentType: "application/json",
|
|
|
- data: JSON.stringify(mallGoodsProductSns),
|
|
|
- success: function (r) {
|
|
|
- if (r.code == 0) {
|
|
|
- alert('操作成功', function (index) {
|
|
|
- $("#jqGrid").trigger("reloadGrid");
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert(r.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- getInfo: function(mallGoodsProductSn){
|
|
|
- $.get("../goodsproduct/info/"+mallGoodsProductSn, function (r) {
|
|
|
- vm.goodsProduct = r.goodsProduct;
|
|
|
- });
|
|
|
- },
|
|
|
- reloadSearch: function() {
|
|
|
- vm.q = {
|
|
|
- name: ''
|
|
|
- }
|
|
|
- vm.reload();
|
|
|
- },
|
|
|
- reload: function (event) {
|
|
|
- vm.showList = true;
|
|
|
- let page = $("#jqGrid").jqGrid('getGridParam', 'page');
|
|
|
- $("#jqGrid").jqGrid('setGridParam', {
|
|
|
- postData: {'name': vm.q.name},
|
|
|
- page: page
|
|
|
- }).trigger("reloadGrid");
|
|
|
- vm.handleReset('formValidate');
|
|
|
- },
|
|
|
- handleSubmit: function (name) {
|
|
|
- handleSubmitValidate(this, name, function () {
|
|
|
- vm.saveOrUpdate()
|
|
|
- });
|
|
|
- },
|
|
|
- handleReset: function (name) {
|
|
|
- handleResetForm(this, name);
|
|
|
- },
|
|
|
- uploadExcelSuccess: function (data) {
|
|
|
- // console.log(data);
|
|
|
- if(data.code==0){
|
|
|
- alert('导入成功', function (index) {
|
|
|
- $("#jqGrid").trigger("reloadGrid");
|
|
|
- });
|
|
|
- }else{
|
|
|
- alert(data.msg);
|
|
|
- }
|
|
|
- setTimeout(exportMsg, 100);
|
|
|
- },
|
|
|
- uploadExcelError: function () {
|
|
|
- alert('上传出现异常,请重试!');
|
|
|
- setTimeout(exportMsg, 100);
|
|
|
- },
|
|
|
- uploadExcelProgress:function(event, file, fileList){
|
|
|
- console.log("上传中")
|
|
|
- console.log(event)
|
|
|
- console.log(file)
|
|
|
- console.log(fileList)
|
|
|
- console.log("上传中")
|
|
|
- exportMsg = this.$Message.loading({
|
|
|
- content: 'Loading...',
|
|
|
- duration: 0
|
|
|
- });
|
|
|
- // setTimeout(msg, 3000);
|
|
|
- },
|
|
|
- uploadExcelFormatError: function (file) {
|
|
|
- this.$Notice.warning({
|
|
|
- title: '文件格式不正确',
|
|
|
- desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
|
|
|
- });
|
|
|
- setTimeout(exportMsg, 100);
|
|
|
- },
|
|
|
- sendSelectProductByAdd: function (event) {
|
|
|
- let mallGoodsProductSns = getSelectedRows();
|
|
|
- if (mallGoodsProductSns == null){
|
|
|
- return;
|
|
|
- }
|
|
|
+ confirm('确定要删除选中的记录?', function () {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "../goodsproduct/delete",
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(mallGoodsProductSns),
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ alert('操作成功', function (index) {
|
|
|
+ $("#jqGrid").trigger("reloadGrid");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getInfo: function (mallGoodsProductSn) {
|
|
|
+ $.get("../goodsproduct/info/" + mallGoodsProductSn, function (r) {
|
|
|
+ vm.goodsProduct = r.goodsProduct;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ reloadSearch: function () {
|
|
|
+ vm.q = {
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
+ vm.reload();
|
|
|
+ },
|
|
|
+ reload: function (event) {
|
|
|
+ vm.showList = true;
|
|
|
+ let page = $("#jqGrid").jqGrid('getGridParam', 'page');
|
|
|
+ $("#jqGrid").jqGrid('setGridParam', {
|
|
|
+ postData: {'name': vm.q.name},
|
|
|
+ page: page
|
|
|
+ }).trigger("reloadGrid");
|
|
|
+ vm.handleReset('formValidate');
|
|
|
+ },
|
|
|
+ handleSubmit: function (name) {
|
|
|
+ handleSubmitValidate(this, name, function () {
|
|
|
+ vm.saveOrUpdate()
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleReset: function (name) {
|
|
|
+ handleResetForm(this, name);
|
|
|
+ },
|
|
|
+ uploadExcelSuccess: function (data) {
|
|
|
+ // console.log(data);
|
|
|
+ if (data.code == 0) {
|
|
|
+ alert('导入成功', function (index) {
|
|
|
+ $("#jqGrid").trigger("reloadGrid");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(data.msg);
|
|
|
+ }
|
|
|
+ setTimeout(exportMsg, 100);
|
|
|
+ },
|
|
|
+ uploadExcelError: function () {
|
|
|
+ alert('上传出现异常,请重试!');
|
|
|
+ setTimeout(exportMsg, 100);
|
|
|
+ },
|
|
|
+ uploadExcelProgress: function (event, file, fileList) {
|
|
|
+ console.log("上传中")
|
|
|
+ console.log(event)
|
|
|
+ console.log(file)
|
|
|
+ console.log(fileList)
|
|
|
+ console.log("上传中")
|
|
|
+ exportMsg = this.$Message.loading({
|
|
|
+ content: 'Loading...',
|
|
|
+ duration: 0
|
|
|
+ });
|
|
|
+ // setTimeout(msg, 3000);
|
|
|
+ },
|
|
|
+ handleFormatError: function (file) {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: '文件格式不正确',
|
|
|
+ desc: '文件 ' + file.name + ' 格式不正确,请上传 jpg 或 png 格式的图片。'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleMaxSize: function (file) {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: '超出文件大小限制',
|
|
|
+ desc: '文件 ' + file.name + ' 太大,不能超过 100k。'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleMaxSizeByInfo: function (file) {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: '超出文件大小限制',
|
|
|
+ desc: '文件 ' + file.name + ' 太大,不能超过 300k。'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ uploadExcelFormatError: function (file) {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: '文件格式不正确',
|
|
|
+ desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
|
|
|
+ });
|
|
|
+ setTimeout(exportMsg, 100);
|
|
|
+ },
|
|
|
+ handleSuccessUpImg: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goodsProduct.upImg = file.response.url;
|
|
|
+ },
|
|
|
+ handleSuccessDownImg: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goodsProduct.downImg = file.response.url;
|
|
|
+ },
|
|
|
+ handleSuccessLeftImg: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goodsProduct.leftImg = file.response.url;
|
|
|
+ },
|
|
|
+ handleSuccessRightImg: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goodsProduct.rightImg = file.response.url;
|
|
|
+ },
|
|
|
+ handleSuccessBeforeImg: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goodsProduct.beforeImg = file.response.url;
|
|
|
+ },
|
|
|
+ handleSuccessAfterImg: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goodsProduct.afterImg = file.response.url;
|
|
|
+ },
|
|
|
+ eyeImageUpImg: function () {
|
|
|
+ var url = vm.goodsProduct.upImg
|
|
|
+ eyeImage(url);
|
|
|
+ },
|
|
|
+ eyeImageDownImg: function () {
|
|
|
+ var url = vm.goodsProduct.downImg
|
|
|
+ eyeImage(url);
|
|
|
+ },
|
|
|
+ eyeImageLeftImg: function () {
|
|
|
+ var url = vm.goodsProduct.leftImg
|
|
|
+ eyeImage(url);
|
|
|
+ },
|
|
|
+ eyeImageRightImg: function () {
|
|
|
+ var url = vm.goodsProduct.rightImg
|
|
|
+ eyeImage(url);
|
|
|
+ },
|
|
|
+ eyeImageBeforeImg: function () {
|
|
|
+ var url = vm.goodsProduct.beforeImg
|
|
|
+ eyeImage(url);
|
|
|
+ },
|
|
|
+ eyeImageAfterImg: function () {
|
|
|
+ var url = vm.goodsProduct.AfterImg
|
|
|
+ eyeImage(url);
|
|
|
+ },
|
|
|
+ eyeImage: function (e) {
|
|
|
+ eyeImage($(e.target).attr('src'));
|
|
|
+ },
|
|
|
+ eyeImageListVideoUrl: function (e) {
|
|
|
+ var url = vm.goods.videoUrl;
|
|
|
+ eyeVideo(url);
|
|
|
+ },
|
|
|
+ handleVideoFormatError: function (file) {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: '文件格式不正确',
|
|
|
+ desc: '文件 ' + file.name + ' 格式不正确,请上传 mp4 格式的图片。'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleVideoMaxSize: function (file) {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: '超出文件大小限制',
|
|
|
+ desc: '文件 ' + file.name + ' 太大,不能超过 1M。'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSuccessListVideoUrl: function (res, file) {
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
|
+ this.$Notice.warning({
|
|
|
+ title: res.msg,
|
|
|
+ desc: "无上传文件的权限,请联系管理员授权"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ vm.goods.videoUrl = file.response.url;
|
|
|
+ },
|
|
|
+ sendSelectProductByAdd: function (event) {
|
|
|
+ let mallGoodsProductSns = getSelectedRows();
|
|
|
+ if (mallGoodsProductSns == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- confirm('确定要发送选中的产品备案信息?', function () {
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "../goodsproduct/sendSelectProductByAdd",
|
|
|
- contentType: "application/json",
|
|
|
- data: JSON.stringify(mallGoodsProductSns),
|
|
|
- success: function (r) {
|
|
|
- if (r.code == 0) {
|
|
|
- alert(r.msg, function (index) {
|
|
|
- $("#jqGrid").trigger("reloadGrid");
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert(r.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- sendAllProductByAdd: function (event) {
|
|
|
+ confirm('确定要发送选中的产品备案信息?', function () {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "../goodsproduct/sendSelectProductByAdd",
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(mallGoodsProductSns),
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ alert(r.msg, function (index) {
|
|
|
+ $("#jqGrid").trigger("reloadGrid");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sendAllProductByAdd: function (event) {
|
|
|
|
|
|
- confirm('确定要发送所有的产品备案信息?', function () {
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "../goodsproduct/sendAllProductByAdd",
|
|
|
- contentType: "application/json",
|
|
|
- success: function (r) {
|
|
|
- if (r.code == 0) {
|
|
|
- alert(r.msg, function (index) {
|
|
|
- $("#jqGrid").trigger("reloadGrid");
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert(r.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
+ confirm('确定要发送所有的产品备案信息?', function () {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "../goodsproduct/sendAllProductByAdd",
|
|
|
+ contentType: "application/json",
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ alert(r.msg, function (index) {
|
|
|
+ $("#jqGrid").trigger("reloadGrid");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- sendSelectProductByUpdate: function (event) {
|
|
|
- let mallGoodsProductSns = getSelectedRows();
|
|
|
- if (mallGoodsProductSns == null){
|
|
|
- return;
|
|
|
- }
|
|
|
+ sendSelectProductByUpdate: function (event) {
|
|
|
+ let mallGoodsProductSns = getSelectedRows();
|
|
|
+ if (mallGoodsProductSns == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- confirm('确定要发送选中的产品备案信息?', function () {
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "../goodsproduct/sendSelectProductByUpdate",
|
|
|
- contentType: "application/json",
|
|
|
- data: JSON.stringify(mallGoodsProductSns),
|
|
|
- success: function (r) {
|
|
|
- if (r.code == 0) {
|
|
|
- alert(r.msg, function (index) {
|
|
|
- $("#jqGrid").trigger("reloadGrid");
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert(r.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- sendAllProductByUpdate: function (event) {
|
|
|
+ confirm('确定要发送选中的产品备案信息?', function () {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "../goodsproduct/sendSelectProductByUpdate",
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(mallGoodsProductSns),
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ alert(r.msg, function (index) {
|
|
|
+ $("#jqGrid").trigger("reloadGrid");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sendAllProductByUpdate: function (event) {
|
|
|
|
|
|
- confirm('确定要发送所有的产品备案信息?', function () {
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "../goodsproduct/sendAllProductByUpdate",
|
|
|
- contentType: "application/json",
|
|
|
- success: function (r) {
|
|
|
- if (r.code == 0) {
|
|
|
- alert(r.msg, function (index) {
|
|
|
- $("#jqGrid").trigger("reloadGrid");
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert(r.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ confirm('确定要发送所有的产品备案信息?', function () {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "../goodsproduct/sendAllProductByUpdate",
|
|
|
+ contentType: "application/json",
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ alert(r.msg, function (index) {
|
|
|
+ $("#jqGrid").trigger("reloadGrid");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|