فهرست منبع

'提交下单制'

魏志佳 4 سال پیش
والد
کامیت
6ca10aa721

+ 199 - 292
src/views/modules/earlyWarningRules/historyWarning.vue

@@ -1,27 +1,34 @@
 <template>
-  <a-card :bordered="false">
+  <a-card :bordered="false" title="预警管理">
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
           <a-col :md="6" :sm="8">
-            <a-form-item label="产品名称">
-              <a-input placeholder="请输入产品名称" v-model="productName"></a-input>
+            <a-form-item label="媒体">
+              <a-radio-group v-model="mediaType">
+                <a-radio-button value=""> 全部 </a-radio-button>
+                <a-radio-button value="快手"> 快手 </a-radio-button>
+                <a-radio-button value="头条"> 头条 </a-radio-button>
+              </a-radio-group>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8">
-            <a-form-item label="广告主名称">
-              <a-input placeholder="请输入广告主名称" v-model="advertiserName"></a-input>
+            <a-form-item label="运营名称">
+              <a-input placeholder="请输入运营名称" v-model="userId"></a-input>
             </a-form-item>
           </a-col>
+          <template>
+            <a-col :md="6" :sm="8">
+              <a-form-item label="账户ID">
+                <Treeselect :appId.sync="accountId" :multiple="false" ref="treeSelect" style="width: 100%" />
+              </a-form-item>
+            </a-col>
+          </template>
           <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a> -->
             </span>
           </a-col>
         </a-row>
@@ -29,315 +36,215 @@
     </div>
 
     <!-- 操作按钮区域 -->
-    <div class="table-operator">
+    <!-- <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-    </div>
+    </div>-->
 
     <!-- table区域-begin -->
     <!-- 供应商 -->
     <div>
-
-      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
-        :pagination="ipagination" :loading="loading" @change="handleTableChange"
-        style="word-break: break-all;font-size:16px;font-weight:600">
-        <span slot="mediaId"
-          slot-scope="mediaId">{{ mediaId == 1 ? '头条' :mediaId == 2? '快手':mediaId == 3?'头条内广':'快手内广' }}</span>
-        <span slot="projectList" slot-scope="text">
-          <span v-for="(item,index) in text"
-            :key="index">{{index+1}}.{{item.projectName}}{{index==(text.length-1)?'':';'}}</span>
-        </span>
-        <span slot="yunyingList" slot-scope="text">
-          <span v-for="(item,index) in text" :key="index">{{item.realname}}{{index==(text.length-1)?'':','}}</span>
-        </span>
-        <span slot="saleList" slot-scope="text">
-          <span v-for="(item,index) in text" :key="index">{{item.saleName}}{{index==(text.length-1)?'':','}}</span>
-        </span>
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleAddList(record)">绑定项目</a>
-
-          <a-divider type="vertical" />
-
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical" />
-
-          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-            <a>删除</a>
-          </a-popconfirm>
-        </span>
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        style="word-break: break-all"
+      >
+        <span slot="userId" slot-scope="text">{{ text.split('_')[0] }}</span>
+        <span slot="createTime" slot-scope="text">{{ text.split(' ')[0] }}</span>
+        <div slot="alarmDetail" slot-scope="text" style="text-align: left; width: 100%; padding: 0 10px">
+          {{ text }}
+        </div>
       </a-table>
     </div>
-    <a-modal title="项目展示" :width="800" :visible="visible" :footer="null" @cancel="handleCancel" destroyOnClose
-      cancelText="关闭">
-      <a-button @click="handleProjectAdd" type="primary" icon="plus" style="margin:20px 0">新增</a-button>
-      <a-list bordered :data-source="dataList">
-        <a-list-item slot="renderItem" slot-scope="item, index">
-          {{ item.projectName }}
-          <div slot="actions">
-            <a @click="removeTitleCun(item,index)">删除</a>
-          </div>
-        </a-list-item>
-
-        <!-- <div slot="header">
-          Header
-        </div>
-        <div slot="footer">
-          Footer
-        </div> -->
-      </a-list>
-    </a-modal>
-    <a-modal title="新增项目" :width="800" :visible="visibleAdd" :confirmLoading="confirmLoading" @ok="handleOk"
-      destroyOnClose cancelText="关闭" @cancel="handleCancelAdd">
-      <a-select optionFilterProp="children" showSearch :filterOption="filterOption" mode="multiple" v-model="projectIds"
-        style="width:100%">
-        <a-select-option :value="item.id" v-for="(item, index) of supplierList" :key="index">{{
-              item.projectName
-            }}</a-select-option>
-      </a-select>
-    </a-modal>
   </a-card>
 </template>
 
 <script>
-  import JTreeSelect from '@/components/jeecg/JTreeSelect'
-  import {
-    httpAction,
-    getAction,
-    postAction,
-    deleteAction
-  } from '@/api/manage'
-  import {
-    JeecgListMixin
-  } from '@/mixins/ipagination'
-
-  export default {
-    name: 'ProjectList',
-    mixins: [JeecgListMixin],
-    components: {
-      JTreeSelect
-    },
-    data() {
-      return {
-        description: '产品管理页面',
-        loading: false,
-        visible: false,
-        visibleAdd: false,
-        dataList: [],
-        productIdDelete: null,
-        confirmLoading: false,
-        projectIds: [],
-        supplierList: [],
-        advertiserId: null,
-        // 表头
-        columns: [
-
-          {
-            title: '媒体',
-            align: 'center',
-            dataIndex: 'mediaId',
-            scopedSlots: {
-              customRender: 'mediaId'
-            },
-            width: 100
-          }, {
-            title: '产品名称',
-            align: 'center',
-            dataIndex: 'productName',
-            width: 200
-          },
-          {
-            title: '广告主名称',
-            align: 'center',
-            dataIndex: 'advertiserName',
-            width: 200
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import { httpAction, getAction } from '@/api/manage'
+import Treeselect from './pushTreeSelect.vue'
+export default {
+  name: 'ProjectList',
+  components: {
+    JTreeSelect,
+    Treeselect,
+  },
+  data() {
+    return {
+      dataSource: [],
+      mediaType: '',
+      userId: '',
+      accountId: '',
+      description: '项目管理页面',
+      // 表头
+      columns: [
+        {
+          title: '媒体',
+          align: 'center',
+          dataIndex: 'mediaType',
+          width: 100,
+        },
+        {
+          title: '账户ID',
+          align: 'center',
+          dataIndex: 'accountId',
+          width: 200,
+        },
+        {
+          title: '运营',
+          align: 'center',
+          dataIndex: 'userId',
+          scopedSlots: {
+            customRender: 'userId',
           },
-          {
-            title: '项目名称',
-            align: 'center',
-            dataIndex: 'projectList',
-            scopedSlots: {
-              customRender: 'projectList'
-            },
+          width: 100,
+        },
+        {
+          title: '预警字段',
+          align: 'center',
+          dataIndex: 'groupName',
+          scopedSlots: {
+            customRender: 'groupName',
           },
-          {
-            title: '运营',
-            align: 'center',
-            dataIndex: 'yunyingList',
-            scopedSlots: {
-              customRender: 'yunyingList'
-            },
-            width: 120,
-
+          width: 100,
+        },
+        {
+          title: '预警时间',
+          align: 'center',
+          dataIndex: 'createTime',
+          scopedSlots: {
+            customRender: 'createTime',
           },
-          {
-            title: '销售',
-            align: 'center',
-            dataIndex: 'saleList',
-            scopedSlots: {
-              customRender: 'saleList'
-            },
-            width: 120
+          width: 200,
+        },
+        {
+          title: '预警信息',
+          align: 'center',
+          dataIndex: 'alarmDetail',
+          scopedSlots: {
+            customRender: 'alarmDetail',
           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align: 'center',
-            scopedSlots: {
-              customRender: 'action'
-            },
-            width: 300
-          }
-        ],
-        dataSource: [],
-        url: {
-          list: '/ctop/product/getProductList',
-          delete: '/ctop/product/deleteProduct',
-          deleteBatch: '/ctop/project/deleteBatch',
-          exportXlsUrl: 'ctop/project/exportXls',
-          importExcelUrl: 'ctop/project/importExcel'
         },
-        options: [],
-        advertiserName: null,
-        productName: null,
-      }
+      ],
+      list: [],
+      options: [],
+      loading: false,
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        //   pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        //   showSizeChanger: true,
+        total: 0,
+        onChange: (current) => {
+          // 切换分页时的回调,
+          // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
+          this.ipagination.current = current
+        },
+      },
+    }
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     },
-    computed: {},
-    watch: {
-      'ipagination.current': function (n, o) {
-        console.log(n, o)
-        if (n != o) {
-          this.tableHttp()
-        }
-
+  },
+  watch: {
+    'ipagination.current': function (n, o) {
+      if (n != o) {
+        this.getHistoryList()
       }
     },
-    methods: {
-      searchQuery() {
-        this.tableHttp()
-      },
-      searchReset() {
-        this.advertiserName = null
-        this.productName = null
-        this.tableHttp()
-      },
-      handleTableChange() {
+  },
+  methods: {
+    searchQuery() {
+      this.ipagination.current = 1
+      this.getHistoryList()
+    },
+    searchReset() {
+      this.mediaType = ''
+      this.userId = ''
+      this.accountId = ''
+      this.ipagination.current = 1
+      this.getHistoryList()
+    },
+    getHistoryList() {
+      this.loading = true
+      var params = {}
+      params.mediaType = this.mediaType
+      params.userId = this.userId
+      params.accountId = this.accountId
+      params.pageNo = this.ipagination.current
+      params.pageSize = this.ipagination.pageSize
 
-      },
-      handleDelete: function (id) {
-        if (!this.url.delete) {
-          this.$message.error("请设置url.delete属性!")
-          return
+      getAction('/alarm/alarmEventSend/pageList', params).then((res) => {
+        this.loading = false
+        if (res.success) {
+          this.dataSource = res.result.list.map((item, index) => {
+            return { ...item, key: index }
+          })
+          this.ipagination.total = res.result.total
+        } else {
+          this.$message.error(res.message)
         }
-        var that = this;
-        postAction(that.url.delete, {
-          productId: id
-        }).then((res) => {
-          if (res.success) {
-            that.$message.success(res.message);
-            this.ipagination.current = 1
-            this.tableHttp()
-          } else {
-            that.$message.warning(res.message);
-          }
-        });
-      },
-      handleProjectAdd() {
-        this.visibleAdd = true
-        // this.supplierList = 
-        postAction('/ctop/product/getProjectListByAdvertiserId', {
-          "advertiserId": this.advertiserId
-        }).then(res => {
-          if (res.success) {
-            this.supplierList = res.result
-            this.projectIds = this.dataList.map(item => {
-              return item.projectId
-            })
-          }
-        })
-      },
-      handleCancelAdd() {
-        this.visibleAdd = false
-      },
-      handleOk() {
-        this.confirmLoading = true
-        postAction('/ctop/product/insertProductProjectMap', {
-          "productId": this.productIdDelete,
-          "projectIds": this.projectIds
-        }).then(res => {
+      })
+    },
+    getList() {
+      var params = {}
+      // params.userId = this.userInfo().id
+      params.pageSize = 1000
+      params.pageNo = 1
+      getAction('/ctop/advertiser/list', params)
+        .then((res) => {
           if (res.success) {
-            this.confirmLoading = false
-            this.visibleAdd = false
-            this.handleCancel()
+            this.list = res.result.records
           } else {
-            this.confirmLoading = false
-            this.$message.error(res.message)
-          }
-        })
-      },
-      removeTitleCun(item, index) {
-        postAction('/ctop/product/deleteByProjectIdAndProductId', {
-          "projectId": item.projectId,
-          "productId": this.productIdDelete
-        }).then(res => {
-          if (res.success) {
-            this.dataList.splice(index, 1)
-            this.tableHttp()
-          }
-        })
-      },
-      handleCancel() {
-        this.visible = false
-        this.tableHttp()
-      },
-
-      handleAddList(record) {
-        this.visible = true
-        this.dataList = record.projectList
-        this.productIdDelete = record.id
-        this.advertiserId = record.advertiserId
-      },
-      handleEdit: function (record) {
-        console.log(record)
-        this.$refs.modalForm.edit(record);
-        this.$refs.modalForm.title = "编辑";
-        this.$refs.modalForm.disableSubmit = false;
-      },
-      handleAdd: function () {
-        this.$refs.modalForm.add();
-        this.$refs.modalForm.title = "新增";
-        this.$refs.modalForm.disableSubmit = false;
-      },
-      modalFormOk() {
-        this.ipagination.current = 1
-        this.tableHttp()
-      },
-      filterOption(input, option) {
-        return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      },
-      tableHttp() {
-        this.loading = true;
-        this.dataSource = []
-        var params = {}
-        params.pageNum = this.ipagination.current
-        params.pageSize = this.ipagination.pageSize
-        params.advertiserName = this.advertiserName
-        params.productName = this.productName
-        // {"pageNum":1,"pageSize":10,"advertiserName":"","productName":""}
-        postAction('/ctop/product/getProductList', params).then(res => {
-          if (res.success) {
-            // console.log(res)
-            this.loading = false;
-            this.ipagination.total = res.result.total
-            this.dataSource = res.result.list
+            this.$message.warning(res.message)
           }
         })
-      },
+        .finally(() => {})
+    },
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
-    mounted() {
-      this.tableHttp()
+    getAllUserList(value) {
+      this.options = []
+      getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: value }).then((res) => {
+        if (res.success) {
+          this.options = res.result.list
+        }
+      })
+    },
+    search(value) {
+      this.options = []
+      if (value != '') {
+        // this.options = this.list.filter(item => {
+        //   var data = item.realName + ' ' + item.roleName
+        //   return data.toLowerCase().indexOf(value.toLowerCase()) > -1
+        // })
+        // this.options = [...this.options]
+        this.getAllUserList(value)
+      } else {
+        this.getAllUserList()
+      }
     },
-  }
+  },
+  created() {},
+  mounted() {
+    this.getHistoryList()
+    // this.getAllUserList()
+    // this.getList()
+  },
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>

+ 5 - 1
src/views/modules/earlyWarningRules/useRuleList.vue

@@ -9,7 +9,7 @@
       <a-tabs v-model="tabKey" @change="tabChange">
         <a-tab-pane key="1" tab="模板列表"></a-tab-pane>
         <a-tab-pane key="2" tab="我的模板"> </a-tab-pane>
-        <a-button slot="tabBarExtraContent" type="link"> 预警历史 </a-button>
+        <a-button slot="tabBarExtraContent" type="link" @click="toHistory"> 预警历史 </a-button>
       </a-tabs>
     </div>
     <div class="tableBody">
@@ -283,6 +283,10 @@ export default {
     Treeselect,
   },
   methods: {
+    toHistory() {
+      this.$router.replace({ path: '/earlyWarningRules/historyWarning' })
+    },
+
     searchQuery() {
       this.ipagination.current = 1
       let url = ''

+ 1 - 1
src/views/modules/workBench/materialList.vue

@@ -756,7 +756,7 @@
                                 <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">{{item.userName}}</a-select-option>
                                 </a-select>
                             </a-form-model-item>
-                            <a-form-model-item  label="拍摄"  ref="shot"  prop="shot">
+                            <a-form-model-item  label="拍摄"  ref="shot"  prop="shot" :rules='[{ required: currentMaterial.materialType==1, message: "拍摄人员必须指派" ,trigger: "change" }]'>
                                 <a-select
                                     
                                     v-model="formPerson.shot"

+ 2 - 2
vue.config.js

@@ -73,7 +73,7 @@ module.exports = {
         // target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.43:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8087', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
@@ -84,7 +84,7 @@ module.exports = {
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
         // target:'http://118.24.244.213:8804',
-        // target:'http://139.186.151.174:8804', //测试
+        target:'http://139.186.151.174:8804', //测试
 
 
         ws: false,