Просмотр исходного кода

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

lilei 4 лет назад
Родитель
Сommit
368a49677d

+ 6 - 6
src/config/router.config.js

@@ -586,8 +586,8 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '采购管理',
-          icon: 'gold',
-          permission: 'M_bulkWarehousing'
+          icon: 'gold'
+          // permission: 'M_bulkWarehousing'
         },
         children: [
           {
@@ -597,8 +597,8 @@ export const asyncRouterMap = [
             component: RouteView,
             meta: {
               title: '散件入库',
-              icon: 'gold',
-              permission: 'M_bulkWarehousingOrder_list'
+              icon: 'gold'
+              // permission: 'M_bulkWarehousingOrder_list'
             },
             hideChildrenInMenu: true,
             children: [
@@ -609,8 +609,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '散件入库单列表',
                   icon: 'gold',
-                  hidden: true,
-                  permission: 'M_bulkWarehousingOrder_list'
+                  hidden: true
+                  // permission: 'M_bulkWarehousingOrder_list'
                 }
               },
               {

+ 1 - 1
src/views/dealerManagement/userManagement/list.vue

@@ -52,7 +52,7 @@
       </template>
     </s-table>
     <!-- 分区设置 -->
-    <user-management-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
+    <user-management-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
   </a-card>
 </template>
 

+ 136 - 0
src/views/setting/announcementManagement/detailModal.vue

@@ -0,0 +1,136 @@
+<template>
+  <a-modal
+    centered
+    class="announcementDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="公告详情"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <!-- 表单 -->
+    <div>
+      <a-descriptions bordered size="small" :column="2">
+        <a-descriptions-item label="类型">UserName</a-descriptions-item>
+        <a-descriptions-item label="可见性">UserName</a-descriptions-item>
+        <a-descriptions-item label="公告标题">UserName</a-descriptions-item>
+        <a-descriptions-item label="发布时间">UserName</a-descriptions-item>
+        <a-descriptions-item label="公告内容" :span="2">
+          <!-- <div v-html=""></div> -->
+        </a-descriptions-item>
+        <a-descriptions-item label="图片" :span="2">
+          <img
+            v-for="(item,index) in fileList"
+            :key="index"
+            :src="item.url"
+            title="点击查看大图"
+            class="productPic"
+            @click="getPreview(item.url)" />
+        </a-descriptions-item>
+        <a-descriptions-item label="附件" :span="2">UserName</a-descriptions-item>
+      </a-descriptions>
+      <div class="btn-cont">
+        <a-button id="announcementDetail-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+      </div>
+    </div>
+    <a-modal :visible="previewVisible" :footer="null" @cancel="previewVisible=false">
+      <img alt="example" style="width: 100%" :src="previewImage" />
+    </a-modal>
+  </a-modal>
+</template>
+
+<script>
+// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+export default {
+  name: 'AnnouncementDetailModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      detailsData: null, //  详情数据
+      previewVisible: false,
+      previewImage: '',
+      fileList: [
+        {
+          uid: '-1',
+          name: 'image.png',
+          status: 'done',
+          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
+        },
+        {
+          uid: '-2',
+          name: 'image.png',
+          status: 'done',
+          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
+        },
+        {
+          uid: '-3',
+          name: 'image.png',
+          status: 'done',
+          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
+        }
+      ]
+    }
+  },
+  methods: {
+    //  获取详情
+    getDetail () {
+      // productSnDetail({ sn: this.itemSn }).then(res => {
+      //   if (res.status == 200) {
+      //     this.detailsData = res.data
+      //   } else {
+      //     this.detailsData = null
+      //   }
+      // })
+    },
+    // 查看大图
+    getPreview (url) {
+      this.previewImage = url
+      this.previewVisible = true
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .announcementDetail-modal{
+    .ant-modal-body {
+    	padding: 40px 40px 24px;
+    }
+    .productPic{
+      cursor: pointer;
+      width: 100px;
+      margin-right: 10px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 203 - 0
src/views/setting/announcementManagement/editModal.vue

@@ -0,0 +1,203 @@
+<template>
+  <a-modal
+    centered
+    class="announcementEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <!-- 表单 -->
+    <div>
+      <a-form-model
+        id="announcementEdit-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="类型" prop="productBrandName">
+          <a-select placeholder="请选择类型" id="announcementEdit-level" allowClear v-model="form.level">
+            <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="可见性" prop="productBrandName">
+          <a-select placeholder="请选择可见性" id="announcementEdit-level" allowClear v-model="form.level">
+            <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="公告标题" prop="productBrandName">
+          <a-input
+            id="announcementEdit-productBrandName"
+            :maxLength="30"
+            v-model="form.productBrandName"
+            placeholder="请输入公告标题(最多30个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="发布时间" prop="productBrandName">
+          <a-date-picker
+            :show-time="{ format: 'HH:mm' }"
+            id="announcementEdit-productBrandName"
+            format="YYYY-MM-DD HH:mm"
+            placeholder="年/月/日 时/分"
+            :disabled-date="disabledDate" />
+        </a-form-model-item>
+        <a-form-model-item label="图片上传" prop="productBrandName">
+          <Upload
+            class="upload"
+            id="announcementEdit-image"
+            v-model="form.image"
+            ref="image"
+            :fileSize="10"
+            :maxNums="5"
+            @change="changeHomeImage"
+            listType="picture-card" ></Upload>
+          <span class="upload-desc">说明:单张大小小于10Mb,最多5张。</span>
+        </a-form-model-item>
+        <a-form-model-item label="附件上传" prop="productBrandName">
+          <Upload
+            id="announcementEdit-image"
+            v-model="form.image"
+            ref="enclosure"
+            :fileSize="10"
+            :maxNums="3"
+            fileType="*"
+            @change="changeHomeImage" ></Upload>
+          <span class="upload-desc">说明:单个文件小于10Mb,最多3个附件。</span>
+        </a-form-model-item>
+        <a-form-model-item label="公告内容" prop="desc">
+          <editor id="announcementEdit-editor" ref="editor" class="announcementEdit-editor" @on-change="editorChange" :cache="false"></editor>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, Upload } from '@/components'
+import Editor from '@/components/WEeditor'
+// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+export default {
+  name: 'ProductBrandEditModal',
+  components: { STable, Upload, Editor },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  computed: {
+    modalTit () {
+      return (this.itemId ? '编辑' : '新增') + '公告'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 20 }
+      },
+      form: {
+        productBrandName: '', // 产品品牌名称
+        image: '',
+        desc: ''
+      },
+      rules: {
+        productBrandName: [
+          { required: true, message: '请输入产品品牌名称', trigger: 'blur' }
+        ]
+      },
+      productBrandList: []
+    }
+  },
+  methods: {
+    disabledDate (current) {
+      // Can not select days before today and today
+      return current && current < moment().subtract(1, 'days')
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          formData.id = _this.itemId ? _this.itemId : undefined
+          dealerProductBrandSave(formData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    //  图片上传
+    changeHomeImage (file) {
+      this.form.image = file
+    },
+    //  文本编辑器
+    editorChange (html, text) {
+      this.form.desc = html
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.form.productBrandName = this.nowData && this.nowData.productBrandName ? this.nowData.productBrandName : ''
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .announcementEdit-modal{
+    .ant-modal-body {
+    	padding: 40px 40px 24px;
+    }
+    .upload{
+      width: 100%!important;
+    }
+    //  商品图片描述
+    .upload-desc{
+      font-size: 12px;
+      color: #808695;
+    }
+    //  文本编辑器  工具栏样式换行
+    .announcementEdit-editor{
+      .w-e-toolbar{
+        flex-wrap: wrap;
+      }
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 189 - 3
src/views/setting/announcementManagement/list.vue

@@ -1,8 +1,194 @@
 <template>
+  <a-card size="small" :bordered="false" class="announcementList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="标题">
+              <a-input id="announcementList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入标题"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="类别">
+              <a-select
+                placeholder="请选择类别"
+                id="announcementList-productBrandSn"
+                allowClear
+                v-model="queryParam.productBrandSn">
+                <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="发布状态">
+              <v-select code="ENABLED_FLAG" id="announcementList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择发布状态"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="announcementList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="announcementList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 总计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">合计:<strong>300</strong>条</div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1230, y: tableHeight }"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="announcementList-edit-btn">编辑</a-button>
+        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="announcementList-detail-btn">详情</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+          id="announcementList-del-btn">删除</a-button>
+      </template>
+    </s-table>
+    <!-- 编辑 -->
+    <announcement-edit-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <!-- 详情 -->
+    <announcement-detail-modal :openModal="openDetailModal" :itemId="itemId" @close="closeDetailModal" />
+  </a-card>
 </template>
 
 <script>
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeQuery } from '@/api/dealerProductType'
+import { STable, VSelect } from '@/components'
+import AnnouncementEditModal from './editModal.vue'
+import AnnouncementDetailModal from './detailModal.vue'
+export default {
+  components: { STable, VSelect, AnnouncementEditModal, AnnouncementDetailModal },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        productName: '', //  产品名称
+        productCode: '', //  产品编码/原厂编码
+        productBrandSn: undefined, //  品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        enabledFlag: undefined //  定价状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '类别', dataIndex: 'productCode', width: 200, align: 'center' },
+        { title: '标题', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '可见性', dataIndex: 'origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发布时间', dataIndex: 'productBrandName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发布状态', dataIndex: 'sterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        // return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
+        //   const data = res.data
+        //   const no = (data.pageNo - 1) * data.pageSize
+        //   for (var i = 0; i < data.list.length; i++) {
+        //     data.list[i].no = no + i + 1
+        //     const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
+        //     const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
+        //     const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
+        //     data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
+        //   }
+        //   this.disabled = false
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+            ]
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          _this.disabled = false
+          resolve(data)
+        })
+      },
+      openModal: false, //  编辑  弹框
+      openDetailModal: false, //  详情  弹框
+      itemId: '', //  当前产品id
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [] //  分类下拉数据
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.enabledFlag = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 详情
+    handleDetail (row) {
+      this.itemId = row.id
+      this.openDetailModal = true
+    },
+    //  编辑
+    handleEdit (row) {
+      this.itemId = row.id
+      this.openModal = true
+    },
+    //  关闭弹框
+    closeModal () {
+      this.itemId = ''
+      this.openModal = false
+    },
+    //  关闭详情弹框
+    closeDetailModal () {
+      this.itemId = ''
+      this.openDetailModal = false
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        onOk () {
+          // productDel({ sn: row.productSn }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$refs.table.refresh()
+          //   }
+          // })
+        }
+      })
+    }
+  }
+}
 </script>
-
-<style>
-</style>