瀏覽代碼

Merge branch 'develop_yh26' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh26

chenrui 1 年之前
父節點
當前提交
7e4a02bef9

+ 2 - 2
src/components/Table/index.js

@@ -168,9 +168,9 @@ export default {
      */
     loadData (pagination, filters, sorter) {
       this.localLoading = true
-      console.log(sorter)
+      console.log(pagination,this.localPagination)
       const parameter = Object.assign({
-        pageNo: (pagination && pagination.current) ||
+        pageNo: this.showPagination && pagination && pagination.pageSize != this.localPagination.pageSize ? 1 : (pagination && pagination.current) ||
           this.showPagination && this.localPagination.current || this.pageNum,
         pageSize: (pagination && pagination.pageSize) ||
           this.showPagination && this.localPagination.pageSize || this.pageSize,

+ 14 - 12
src/components/UploadFile/index.vue

@@ -108,18 +108,20 @@ export default {
     const _this = this
     this.$nextTick(() => {
       const el = document.querySelector('.ant-upload-list-picture-card')
-      const sortable = Sortable.create(el, {
-        onEnd: function (evt) {
-          console.log(evt.oldIndex, evt.newIndex)
-          const a = _this.formatFile()
-          console.log(a.split(','))
-          const ret = moveElement(a.split(','), evt.oldIndex, evt.newIndex)
-          console.log(ret)
-
-          _this.$emit('change', ret.join(','))
-          _this.$emit('input', ret.join(','))
-        }
-      })
+      if(el){
+        const sortable = Sortable.create(el, {
+          onEnd: function (evt) {
+            console.log(evt.oldIndex, evt.newIndex)
+            const a = _this.formatFile()
+            console.log(a.split(','))
+            const ret = moveElement(a.split(','), evt.oldIndex, evt.newIndex)
+            console.log(ret)
+        
+            _this.$emit('change', ret.join(','))
+            _this.$emit('input', ret.join(','))
+          }
+        })
+      }
     })
   },
   methods: {

+ 9 - 0
src/libs/tools.js

@@ -511,4 +511,13 @@ export const moveElement = function (arr, fromIndex, toIndex) {
   const element = arr.splice(fromIndex, 1)[0];
   arr.splice(toIndex, 0, element);
   return arr;
+}
+// 校验特殊字符
+export const validateSpecialCharacter = function(rule, value, callback){
+  var regex = /[!@#$%^&*(),.?":{}|<>]/;
+  if(regex.test(value)){
+    return callback(new Error('不能输入特殊字符'));
+  }else{
+    callback()
+  }
 }

+ 14 - 8
src/views/productManagement/productInfo/edit.vue

@@ -223,6 +223,7 @@ import Editor from '@/components/WEeditor'
 import { productSave, productSnDetail } from '@/api/product'
 import { productTypeQueryAll } from '@/api/productType'
 import { productBrandQuery } from '@/api/productBrand'
+import { validateSpecialCharacter } from '@/libs/tools'
 export default {
   name: 'ProductInfoEdit',
   mixins: [commonMixin],
@@ -259,10 +260,15 @@ export default {
       },
       rules: {
         name: [
-          { required: true, message: '请输入产品名称', trigger: 'blur' }
+          { required: true, message: '请输入产品名称', trigger: 'change' },
+          { validator: validateSpecialCharacter, trigger: 'change' }
         ],
         code: [
-          { required: true, message: '请输入产品编码', trigger: 'blur' }
+          { required: true, message: '请输入产品编码', trigger: 'change' },
+          { validator: validateSpecialCharacter, trigger: 'change' }
+        ],
+        origCode: [
+          { validator: validateSpecialCharacter, trigger: 'change' }
         ],
         productBrandSn: [
           { required: true, message: '请选择产品品牌', trigger: 'change' }
@@ -274,13 +280,13 @@ export default {
           { required: true, message: '请选择单位', trigger: 'change' }
         ],
         packQty: [
-          { required: true, message: '请输入包装数', trigger: 'blur' }
+          { required: true, message: '请输入包装数', trigger: 'change' }
         ],
         arrowFalg: [
           { required: true, message: '请选择是否为箭冠产品', trigger: 'change' }
         ],
         qrCode: [
-          { required: false, message: '请输入条形码', trigger: 'blur' },
+          { required: false, message: '请输入条形码', trigger: 'change' },
           { validator: this.validateQrCode }
         ]
       },
@@ -321,13 +327,13 @@ export default {
     handleSubmit (e) {
       e.preventDefault()
       const _this = this
-      if (!this.form.productTypeSn3) {
-        this.$message.warning('产品分类未选到第三级,请修改后再提交!')
-        return
-      }
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          if (!form.productTypeSn3) {
+            this.$message.warning('产品分类未选到第三级,请修改后再提交!')
+            return false
+          }
           form.id = _this.$route.params.id ? _this.$route.params.id : undefined
           form.productPicList = []
           if (form.productMsg) {

+ 1 - 1
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -184,7 +184,7 @@ export default {
     },
     //  附件上传
     changeAttach (file) {
-      this.attachList = JSON.parse(file)
+      this.attachList = file ? JSON.parse(file) : []
       this.attachList.map(item => {
         item.fileType = item.extName
       })

+ 2 - 2
src/views/promotionRulesManagement/dealerPromotions/chooseProductsModal.vue

@@ -41,7 +41,7 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
+                <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetData" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
               </a-col>
             </a-row>
@@ -185,7 +185,7 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productType = []
       this.$nextTick(() => {
-        this.$refs.table.refresh()
+        this.$refs.table.refresh(true)
       })
     },
     //  清空选项

+ 9 - 10
src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue

@@ -150,15 +150,16 @@ export default {
     },
     handlePage (pagination, filters, sorter) {
       const pager = { ...this.pagination }
-      pager.current = pagination.current
+      pager.pageNo = pagination.pageSize != pager.pageSize ? 1 : pagination.current
       pager.pageSize = pagination.pageSize
+      pager.current = pager.pageNo
       this.pagination = pager
-
-      this.loadData({ pageNo: pagination.current, pageSize: pagination.pageSize })
+      this.loadData()
     },
-    loadData (pager) {
+    loadData () {
       this.spinning = true
-      const params = { pageSize: 20, pageNo: 1, ...pager }
+      console.log(this.pagination)
+      const params = { pageSize: 20, pageNo: 1, ...this.pagination }
       dealerQueryList(Object.assign(params, this.queryParam)).then(res => {
         let data
         if (res.status == 200) {
@@ -219,11 +220,9 @@ export default {
       } else {
         this.$refs.areaList.clearData()
       }
-      this.pagination = {
-        pageSize: 20,
-        showSizeChanger: true,
-        current: 1
-      }
+      
+      this.pagination.pageNo = 1
+      this.pagination.current = 1
       this.loadData()
       this.pageFlag = false
     },

+ 2 - 2
src/views/salesReturnManagement/custConfirm/list.vue

@@ -41,8 +41,8 @@
           size="small"
           :rowKey="(record) => record.id"
           :row-selection="{ columnWidth: 40 }"
-          :pagination="{pageSizeOptions: ['10','20','30','40']}"
-          :pageSize="20"
+          :pagination="{pageSizeOptions: ['50','100','200','300','400']}"
+          :pageSize="50"
           @rowSelection="rowSelectionFun"
           :columns="columns"
           :data="loadData"