瀏覽代碼

7.26下午的代码

Tartarus 2 年之前
父節點
當前提交
d3ec10f587

+ 1 - 1
src/permission.js

xqd
@@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title'
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/login'] // no redirect whitelist
+const whiteList = ['/login','/register'] // no redirect whitelist
 
 router.beforeEach(async(to, from, next) => {
   // start progress bar

+ 33 - 33
src/router/index.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -43,7 +43,7 @@ export const asyncRouterMap = [
     path: '/contracts',
     component: Layout,
     name: 'Example',
-    meta: { title: '合同列表', icon: 'el-icon-s-order', roles: ['admin'] },
+    meta: { title: '合同列表', icon: 'el-icon-s-order', roles: ['admin','salesman'] },
     redirect: {
       name: 'contracts'
     },
@@ -52,48 +52,48 @@ export const asyncRouterMap = [
         path: 'list',
         name: 'contracts-list',
         component: () => import('@/views/contracts/list'),
-        meta: { title: '合同列表', icon: 'el-icon-s-order', roles: ['admin'] },
+        meta: { title: '合同列表', icon: 'el-icon-s-order', roles: ['admin','salesman'] },
         hidden: true
       },
       {
         path: 'contracts',
         name: 'contracts',
         component: () => import('@/views/contracts/index'),
-        meta: { title: '合同列表', icon: 'el-icon-s-order', roles: ['admin'] }
+        meta: { title: '合同列表', icon: 'el-icon-s-order', roles: ['admin','salesman'] }
       },
       {
         path: '/detail',
         name: 'detail',
         component: () => import('@/views/contracts/detail'),
-        meta: { title: '合同详情', roles: ['admin'] },
-        hidden: true
-      },
-      {
-        path: 'contracts/addcontract',
-        name: 'addcontract',
-        component: () => import('@/views/contracts/addcontract'),
-        meta: { title: '上传合同', roles: ['admin'] },
+        meta: { title: '合同详情', roles: ['admin','salesman'] },
         hidden: true
       },
+      // {
+      //   path: 'contracts/addcontract',
+      //   name: 'addcontract',
+      //   component: () => import('@/views/contracts/addcontract'),
+      //   meta: { title: '上传合同', roles: ['admin'] },
+      //   hidden: true
+      // },
       {
         path: 'contracts/addnewbill',
         name: 'addnewbill',
         component: () => import('@/views/contracts/addnewbill'),
-        meta: { title: '新增汇票', roles: ['admin'] },
+        meta: { title: '新增汇票', roles: ['admin','salesman'] },
         hidden: true
       },
       {
         path: 'contracts/billDetail',
         name: 'billDetail',
         component: () => import('@/views/contracts/billDetail'),
-        meta: { title: '汇票详情', roles: ['admin'] },
+        meta: { title: '汇票详情', roles: ['admin','salesman'] },
         hidden: true
       },
       {
         path: 'contracts/addcontract',
         name: 'addcontract',
         component: () => import('@/views/contracts/new_file'),
-        meta: { title: '新增合同' },
+        meta: { title: '新增合同',roles: ['admin','salesman'] },
         hidden: true
       }
     ]
@@ -104,26 +104,26 @@ export const asyncRouterMap = [
     component: Layout,
     redirect: '/table',
     name: 'Example',
-    meta: { title: '承兑人列表', icon: 'el-icon-s-help', roles: ['salesman'] },
+    meta: { title: '承兑人列表', icon: 'el-icon-s-help', roles: ['admin'] },
     children: [
       {
         path: 'table',
         name: 'Table',
         component: () => import('@/views/table/index'),
-        meta: { title: '承兑人列表', icon: 'el-icon-s-help', roles: ['salesman'] }
+        meta: { title: '承兑人列表', icon: 'el-icon-s-help', roles: ['admin'] }
       },
       {
         path: '/table/addAcceptor',
         name: 'Table',
         component: () => import('@/views/table/addAcceptor'),
-        meta: { title: '新增承兑人', roles: ['salesman'] },
+        meta: { title: '新增承兑人', roles: ['admin'] },
         hidden: true
       },
       {
         path: 'table/detail',
         name: 'Table',
         component: () => import('@/views/table/detail'),
-        meta: { title: '承兑人详情', roles: ['salesman'] },
+        meta: { title: '承兑人详情', roles: ['admin'] },
         hidden: true
       }
     ]
@@ -137,20 +137,20 @@ export const asyncRouterMap = [
         path: 'index',
         name: 'Form',
         component: () => import('@/views/form/index'),
-        meta: { title: '出票人列表', icon: 'form', roles: ['salesman'] }
+        meta: { title: '出票人列表', icon: 'form', roles: ['admin'] }
       },
       {
         path: '/form/addTicketdrawer',
         name: 'addTicketdrawer',
         component: () => import('@/views/form/addTicketdrawer'),
-        meta: { title: '新增出票人', roles: ['salesman'] },
+        meta: { title: '新增出票人', roles: ['admin'] },
         hidden: true
       },
       {
         path: '/form/detail',
         name: 'detail',
         component: () => import('@/views/form/detail'),
-        meta: { title: '出票人详情', roles: ['salesman'] },
+        meta: { title: '出票人详情', roles: ['admin'] },
         hidden: true
       }
     ]
@@ -163,13 +163,13 @@ export const asyncRouterMap = [
         path: 'index',
         name: 'delivery',
         component: () => import('@/views/delivery/index'),
-        meta: { title: '供应商账号', icon: 'el-icon-s-promotion', roles: ['salesman'] }
+        meta: { title: '供应商账号', icon: 'el-icon-s-promotion', roles: ['admin'] }
       },
       {
         path: '/edit',
         name: 'edit',
         component: () => import('@/views/delivery/edit'),
-        meta: { title: '编辑', roles: ['salesman'] },
+        meta: { title: '编辑', roles: ['admin'] },
         hidden: true
       }
     ]
@@ -182,27 +182,27 @@ export const asyncRouterMap = [
         path: '/shipments/index',
         name: 'shipments',
         component: () => import('@/views/shipments/index'),
-        meta: { title: '报表统计', icon: 'el-icon-s-marketing', roles: ['salesman'] }
+        meta: { title: '报表统计', icon: 'el-icon-s-marketing', roles: ['admin'] }
       },
       {
         path: '/shipments1',
         name: 'shipments1',
         component: () => import('@/views/shipments/shipments1'),
-        meta: { title: '出票人分类报表', roles: ['salesman'] },
+        meta: { title: '出票人分类报表', roles: ['admin'] },
         hidden: true
       },
       {
         path: '/shipments2',
         name: 'shipments2',
         component: () => import('@/views/shipments/shipments2'),
-        meta: { title: '合同统计列表', roles: ['salesman'] },
+        meta: { title: '合同统计列表', roles: ['admin'] },
         hidden: true
       },
       {
         path: '/shipments3',
         name: 'shipments3',
         component: () => import('@/views/shipments/shipments3'),
-        meta: { title: '供应商统计列表', roles: ['salesman'] },
+        meta: { title: '供应商统计列表', roles: ['admin'] },
         hidden: true
       }
 
@@ -216,7 +216,7 @@ export const asyncRouterMap = [
         path: 'index',
         name: 'management',
         component: () => import('@/views/management/index'),
-        meta: { title: '业务管理员', icon: 'el-icon-s-management', roles: ['salesman'] }
+        meta: { title: '业务管理员', icon: 'el-icon-s-management', roles: [] }
       }
     ]
   },
@@ -228,20 +228,20 @@ export const asyncRouterMap = [
         path: 'index',
         name: 'sucuirtyaudit',
         component: () => import('@/views/sucuirtyaudit/index'),
-        meta: { title: '安全审计', icon: 'el-icon-s-check', roles: ['salesman'] }
+        meta: { title: '安全审计', icon: 'el-icon-s-check', roles: [] }
       },
       {
         path: '/annexList',
         name: 'annexList',
         component: () => import('@/views/sucuirtyaudit/annexList'),
-        meta: { title: '附件列表', roles: ['salesman'] },
+        meta: { title: '附件列表', roles: [] },
         hidden: true
       },
       {
         path: '/logdetail',
         name: 'detail',
         component: () => import('@/views/sucuirtyaudit/detail'),
-        meta: { title: '审计日志详情', roles: ['salesman'] },
+        meta: { title: '审计日志详情', roles: [] },
         hidden: true
       }
     ]
@@ -254,7 +254,7 @@ export const asyncRouterMap = [
         path: 'index',
         name: 'databackup',
         component: () => import('@/views/databackup/index'),
-        meta: { title: '数据备份', icon: 'el-icon-upload', roles: ['salesman'] }
+        meta: { title: '数据备份', icon: 'el-icon-upload', roles: [] }
       }
     ]
   },
@@ -266,7 +266,7 @@ export const asyncRouterMap = [
         path: 'index',
         name: 'mine',
         component: () => import('@/views/mine/index'),
-        meta: { title: '个人资料', icon: 'el-icon-s-custom', roles: ['admin'] }
+        meta: { title: '个人资料', icon: 'el-icon-s-custom', roles: ['admin','salesman'] }
       }
     ]
   },

+ 2 - 2
src/store/modules/permission.js

xqd
@@ -23,9 +23,9 @@ const actions = {
     return new Promise(resolve => {
       let roles = []
       if (data.type === 1) {
-        roles = ['admin'] // 供应商
+        roles = ['admin'] // 业务员
       } else if (data.type === 2) {
-        roles = ['salesman'] // 业务员
+        roles = ['salesman'] // 供应商
       }
       const accessedRouters = asyncRouterMap.filter(v => {
         if (hasPermission(roles, v)) {

+ 406 - 466
src/views/contracts/detail.vue

xqd
@@ -1,484 +1,424 @@
 <template>
-  <div>
-    <el-card class="box-card">
-      <el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="12">
-        <div class="grid-content bg-purple ">
-          <span style="font-weight: 600;">合同基础信息</span>
-          <div class="titlein">
-            <span class="titlename">合同名称</span>
-            <span class="meatatitle">{{ contract.name }}</span>
-          </div>
-          <div class="titlein">
-            <span class="titlename">合同编号</span>
-            <span class="meatatitle">{{ contract.contractNo }}</span>
-          </div>
-          <div class="titlein">
-            <span class="titlename">合同附件</span>
-            <div style="display: flex;">
-              <div class="imgbox">
-                <el-image
-                  style="width: 100px; height: 100px"
-                  :src="url[0]"
-                  :preview-src-list="picList[0]"
-                />
-              </div>
-              <div class="imgbox">
-                <el-image
-                  style="width: 100px; height: 100px"
-                  :src="url[1]"
-                  :preview-src-list="picList[1]"
-                />
-              </div>
-            </div>
-          </div>
-          <div class="titlein">
-            <span class="titlename">发票附件</span>
-            <div style="display: flex;">
-              <div class="imgbox">
-                <el-image
-                  style="width: 100px; height: 100px"
-                  :src="url[1]"
-                  :preview-src-list="picList[1]"
-                />
-              </div>
-              <div class="imgbox">
-                <el-image
-                  style="width: 100px; height: 100px"
-                  :src="url[1]"
-                  :preview-src-list="picList[1]"
-                />
-              </div>
-            </div>
-          </div>
+	<div>
+		<el-card class="box-card">
+			<el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="12">
+				<div class="grid-content bg-purple ">
+					<span style="font-weight: 600;">合同基础信息</span>
+					<div class="titlein">
+						<span class="titlename">合同名称</span>
+						<span class="meatatitle">{{ contract.name }}</span>
+					</div>
+					<div class="titlein">
+						<span class="titlename">合同编号</span>
+						<span class="meatatitle">{{ contract.contractNo }}</span>
+					</div>
+					<div class="titlein">
+						<span class="titlename">合同附件</span>
+						<div style="display: flex;">
+							<div class="imgbox">
+								<el-image style="width: 100px; height: 100px" :src="url[0]"
+									:preview-src-list="picList[0]" />
+							</div>
+							<div class="imgbox">
+								<el-image style="width: 100px; height: 100px" :src="url[1]"
+									:preview-src-list="picList[1]" />
+							</div>
+						</div>
+					</div>
+					<div class="titlein">
+						<span class="titlename">发票附件</span>
+						<div style="display: flex;">
+							<div class="imgbox">
+								<el-image style="width: 100px; height: 100px" :src="url[1]"
+									:preview-src-list="picList[1]" />
+							</div>
+							<div class="imgbox">
+								<el-image style="width: 100px; height: 100px" :src="url[1]"
+									:preview-src-list="picList[1]" />
+							</div>
+						</div>
+					</div>
 
-        </div>
-      </el-col>
-      <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="12">
-        <div class="jas">
-          <div class="titlein jas">
-            <span class="titlename">贸易合同</span>
-            <div style="display: flex;">
-              <div class="imgbox">
-                <el-image
-                  style="width: 100px; height: 100px"
-                  :src="url[0]"
-                  :preview-src-list="picList[0]"
-                />
-              </div>
-              <div class="imgbox">
-                <el-image
-                  style="width: 100px; height: 100px"
-                  :src="url[1]"
-                  :preview-src-list="picList[1]"
-                />
-              </div>
-            </div>
-          </div>
-          <div class="yusa jas">
-            <!-- <el-tag type="warning" effect="dark">
+				</div>
+			</el-col>
+			<el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="12">
+				<div class="jas">
+					<div class="titlein jas">
+						<span class="titlename">贸易合同</span>
+						<div style="display: flex;">
+							<div class="imgbox">
+								<el-image style="width: 100px; height: 100px" :src="url[0]"
+									:preview-src-list="picList[0]" />
+							</div>
+							<div class="imgbox">
+								<el-image style="width: 100px; height: 100px" :src="url[1]"
+									:preview-src-list="picList[1]" />
+							</div>
+						</div>
+					</div>
+					<div class="yusa jas">
+						<!-- <el-tag type="warning" effect="dark">
               <span>合同状态:</span>
               <span style="color: #D05C39;">待审核</span>
             </el-tag> -->
-            <div class="boxas">
-              <span style="color: #fff;">合同状态:</span>
-              <span style="color: #D05C39;">{{ contract.statusText }}</span>
-            </div>
-            <span class="aoiisp">审核结果:<p style="color: #D8AB5A;">审核通过</p></span>
-          </div>
-          <div class="yusa">
-            <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="10" class="jas">
-              <el-form ref="form" :model="feed" label-width="0px">
-                <span class="sah">审核反馈:</span>
-                <el-form-item label="">
-                  <el-input v-model="feed.feedback" type="textarea" />
-                </el-form-item>
+						<div class="boxas">
+							<span style="color: #fff;">合同状态:</span>
+							<span style="color: #D05C39;">{{ contract.statusText }}</span>
+						</div>
+						<span class="aoiisp">审核结果:<p style="color: #D8AB5A;">审核通过</p></span>
+					</div>
+					<div class="yusa">
+						<el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="10" class="jas">
+							<el-form ref="form" :model="feed" label-width="0px">
+								<span class="sah">审核反馈:</span>
+								<el-form-item label="">
+									<el-input v-model="feed.feedback" type="textarea" />
+								</el-form-item>
 
-              </el-form>
-            </el-col>
-            <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="14" class="jas">
-              <span class="sah">审核截图:</span>
-              <div style="display: flex;justify-content: flex-end;">
-                <div class="imgbox">
-                  <el-image
-                    style="width: 100px; height: 100px"
-                    :src="url[0]"
-                    :preview-src-list="picList"
-                  />
-                </div>
-                <div class="imgbox">
-                  <el-image
-                    style="width: 100px; height: 100px"
-                    :src="url[1]"
-                    :preview-src-list="picList"
-                  />
-                </div>
-              </div>
-            </el-col>
-          </div>
-          <div slot="" class="clearfix">
-            <el-button type="primary" style="float: right; margin-left: 10px;" @click="Exports">导出
-            </el-button>
-            <el-button type="danger" style="float: right; " @click="deletedContract">删除</el-button>
-            <el-button
-              v-if="checked==1"
-              type="primary"
-              style="float: right;margin-right: 10px; "
-              @click="addNewBill"
-            >新增</el-button>
-            <el-button v-if="checked==0" type="primary" style="float: right; " @click="recoverContract">恢复
-            </el-button>
-            <el-button v-if="checked==0" type="warning" style="float: right; " @click="failed">审核失败
-            </el-button>
-            <el-button v-if="checked==0" type="success" style="float: right; " @click="success">审核成功
-            </el-button>
-          </div>
-        </div>
-      </el-col>
-    </el-card>
+							</el-form>
+						</el-col>
+						<el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="14" class="jas">
+							<span class="sah">审核截图:</span>
+							<div style="display: flex;justify-content: flex-end;">
+								<div class="imgbox">
+									<el-image style="width: 100px; height: 100px" :src="url[0]"
+										:preview-src-list="picList" />
+								</div>
+								<div class="imgbox">
+									<el-image style="width: 100px; height: 100px" :src="url[1]"
+										:preview-src-list="picList" />
+								</div>
+							</div>
+						</el-col>
+					</div>
+					<div slot="" class="clearfix">
+						<el-button type="primary" style="float: right; margin-left: 10px;" @click="Exports">导出
+						</el-button>
+						<el-button type="danger" style="float: right; " @click="deletedContract">删除</el-button>
 
-    <el-card class="box-card">
-      <el-table
-        v-loading="listLoading"
-        :data="temporaryList"
-        element-loading-text="Loading"
-        border
-        fit
-        highlight-current-row
-        @select="handleSelectionChange"
-        @select-all="handleAll"
-      >
-        <el-table-column align="center" label="" width="55" type="selection" />
-        <el-table-column label="汇票名称" align="center" prop="name" />
-        <el-table-column label="汇票编号" align="center" prop="draftNo" />
-        <el-table-column label="承兑人" align="center" prop="acceptorName" />
-        <el-table-column label="金额" align="center">
-          <template slot-scope="scope">
-            {{ scope.row.money }}
-          </template>
-        </el-table-column>
-        <el-table-column label="服务费" align="center">
-          <template slot-scope="scope">
-            {{ scope.row.serviceMoney }}
-          </template>
-        </el-table-column>
-        <el-table-column label="汇票状态" align="center" prop="draftStatusText" />
-        <el-table-column label="审核状态" align="center">
-          <template slot-scope="scope">
-            {{ scope.row.statusText }}
-          </template>
-        </el-table-column>
-        <el-table-column align="center" prop="created_at" label="操作" width="250">
-          <template slot-scope="scope">
-            <el-tag
-              type="primary"
-              style="cursor: pointer;margin-right: 15px;"
-              @click="tapDetail(scope.row.id)"
-            >查看详情</el-tag>
-            <el-tag
-              type="success"
-              style="margin-right: 15px;cursor: pointer;"
-              @click="recover(scope.row.id)"
-			  v-if="(scope.row.draftStatus==1)"
-            >恢复</el-tag>
-            <el-tag
-              type="danger"
-              style="margin-right: 15px;cursor: pointer;"
-              @click="deleted(scope.row.id)"
-			   v-if="(scope.row.draftStatus==0)"
-            >删除</el-tag>
-          </template>
-        </el-table-column>
-      </el-table>
+						<el-button v-if="role===1" type="primary" style="float: right; " @click="recoverContract">恢复
+						</el-button>
+						<el-button v-if="role===1" type="warning" style="float: right; " @click="failed">审核失败
+						</el-button>
+						<el-button v-if="role===1" type="success" style="float: right; " @click="success">审核成功
+						</el-button>
+					</div>
+				</div>
+			</el-col>
+		</el-card>
 
-      <div class="pagesip">
+		<el-card class="box-card">
+			<el-table v-loading="listLoading" :data="temporaryList" element-loading-text="Loading" border fit
+				highlight-current-row @select="handleSelectionChange" @select-all="handleAll">
+				<el-table-column align="center" label="" width="55" type="selection" />
+				<el-table-column label="汇票名称" align="center" prop="name" />
+				<el-table-column label="汇票编号" align="center" prop="draftNo" />
+				<el-table-column label="承兑人" align="center" prop="acceptorName" />
+				<el-table-column label="金额" align="center">
+					<template slot-scope="scope">
+						{{ scope.row.money }}
+					</template>
+				</el-table-column>
+				<el-table-column label="服务费" align="center">
+					<template slot-scope="scope">
+						{{ scope.row.serviceMoney }}
+					</template>
+				</el-table-column>
+				<el-table-column label="汇票状态" align="center" prop="draftStatusText" />
+				<el-table-column label="审核状态" align="center">
+					<template slot-scope="scope">
+						{{ scope.row.statusText }}
+					</template>
+				</el-table-column>
+				<el-table-column align="center" prop="created_at" label="操作" width="250">
+					<template slot-scope="scope">
+						<el-tag type="primary" style="cursor: pointer;margin-right: 15px;"
+							@click="tapDetail(scope.row.id)">查看详情</el-tag>
+						<el-tag type="success" style="margin-right: 15px;cursor: pointer;"
+							@click="recover(scope.row.id)" v-if="(scope.row.draftStatus==1)">恢复</el-tag>
+						<el-tag type="danger" style="margin-right: 15px;cursor: pointer;" @click="deleted(scope.row.id)"
+							v-if="(scope.row.draftStatus==0)">删除</el-tag>
+					</template>
+				</el-table-column>
+			</el-table>
 
-        <el-button
-          type="primary"
-          size="small"
-          style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-          @click="jumpFirstPage"
-        >首页
-        </el-button>
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :total="list.length"
-          :page-size="10"
-          prev-text="上一页"
-          ref="pagination"
-          next-text="下一页"
-          :hide-on-single-page="false"
-          @current-change="handleCurrentChange"
-        />
-        <el-button
-          type="primary"
-          size="small"
-          style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-          @click="jumpLastPage"
-        >尾页
-        </el-button>
-        <el-button type="primary" size="small" @click="back">返回
-        </el-button>
-      </div>
+			<div class="pagesip">
+				<el-button v-if="role===2" type="primary" style="float: right;margin-right: 10px; " @click="addNewBill">
+					新增汇票</el-button>
+				<el-button type="primary" size="small"
+					style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpFirstPage">首页
+				</el-button>
+				<el-pagination background layout="prev, pager, next" :total="list.length" :page-size="10"
+					prev-text="上一页" ref="pagination" next-text="下一页" :hide-on-single-page="false"
+					@current-change="handleCurrentChange" />
+				<el-button type="primary" size="small"
+					style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpLastPage">尾页
+				</el-button>
+				<el-button type="primary" size="small" @click="back">返回
+				</el-button>
+			</div>
 
-    </el-card>
-  </div>
+		</el-card>
+	</div>
 
 </template>
 
 <script>
-import {
-  getList
-} from '@/api/table'
-import {
-  dataConversionUtil
-} from '../../utils/Excel.js'
-export default {
-  data() {
-    return {
-      srcList: [],
-      temporaryList: [],
-      list: [],
-      contract: {},
-      currentPage: 1,
-      multipleSelection: [],
-      pagesize: 11,
-      listLoading: false,
-      checked: '',
-      form: '',
-      url: [],
-      picList: [],
-      feed: {
-        id: '',
-        feedback: '',
-        feedbackPicList: [],
-        approveStatus: ''
-      }
-    }
-  },
-  created() {},
-  mounted() {
-    this.checked = this.$store.state.user.checked
-   this.getData()
-  },
-  methods: {
-		getData(){
-			const id = this.$route.query.id
-			this.$request({
-			  url: '/api/Contract/' + id,
-			  method: 'get'
-			}).then((res) => {
-			  this.contract = res.data
-			  this.url = this.contract.invoicePicList
-			  this.picList = this.contract.picList
-			  this.list = res.data.contractDraft.result
-			  this.feed.feedbackPicList = this.picList
-			  this.feed.id = this.$route.query.id
-			  this.getPageData()
-			})
+	import {
+		getList
+	} from '@/api/table'
+	import {
+		dataConversionUtil
+	} from '../../utils/Excel.js'
+	export default {
+		data() {
+			return {
+				role: '',
+				srcList: [],
+				temporaryList: [],
+				list: [],
+				contract: {},
+				currentPage: 1,
+				multipleSelection: [],
+				pagesize: 11,
+				listLoading: false,
+				checked: '',
+				form: '',
+				url: [],
+				picList: [],
+				feed: {
+					id: '',
+					feedback: '',
+					feedbackPicList: [],
+					approveStatus: ''
+				}
+			}
 		},
-    addNewBill() {
-      this.$router.push({
-        path: 'contracts/addnewbill'
-      })
-    },
-    tapDetail(id) {
-      this.$router.push({
-        path: 'contracts/billDetail',
-        query: {
-          id: id
-        }
-      })
-    },
-    handleAll(data) {
-      this.multipleSelection = data
-      console.log(this.multipleSelection)
-    },
-    handleSelectionChange(data) {
-      this.multipleSelection = data
-      console.log(this.multipleSelection)
-    },
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getPageData()
-    },
-    jumpFirstPage() {
-      this.$refs.pagination.handleCurrentChange(1)
-      this.$emit('handleCurrentChange', 1)
-    },
-    jumpLastPage() {
-      const font = this.$refs.pagination
-      const cpage = Math.ceil(font.total / font.pageSize)
-      font.handleCurrentChange(cpage)
-    },
-    getPageData() {
-      const start = (this.currentPage - 1) * this.pagesize
-      const end = start + this.pagesize
-      this.srcList = this.list.slice(start, end)
-      this.temporaryList = this.srcList
-    },
-    Exports() {
-      // var tableHeader = [
-      // 	['序号', '汇票名称', '汇票编号', '承兑人', '金额', '服务费','汇票状态','审核状态'],
-      // ]
-      // var dataList = []
-      // this.multipleSelection.forEach((item, index) => {
-      // 	dataList.push([index + 1, item.name, item.draftNo, item.acceptorName,item.money,item.serviceMoney, item.draftStatusText, item
-      // 		.statusText
-      // 	]);
-      // })
-      // dataConversionUtil.dataToExcel('出票人列表', tableHeader, dataList)
-      // this.$message.success('导出成功!');
-    },
-    success() {
-      // this.feed.feedbackPicList=this.picList
-      // this.feed.id=this.$route.query.id
-      this.feed.approveStatus = 1
-      this.$request({
-        url: '/api/Contract/approveContract',
-        method: 'post',
-        data: this.feed
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-		  this.getData()
-        } else {
-          this.$message({
-            type: 'error',
-            message: '提交失败'
-          })
-		  this.getData()
-        }
-      })
-    },
-    failed() {
-      this.feed.approveStatus = 2
-      this.$request({
-        url: '/api/Contract/approveContract',
-        method: 'post',
-        data: this.feed
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-		  this.getData()
-        } else {
-          this.$message({
-            type: 'error',
-            message: '提交失败'
-          })
-		  this.getData()
-        }
-      })
-    },
-    recoverContract() {
-      const id = this.$route.query.id
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: [id],
-          operateType: 2
-        }
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-		  this.getData()
-        } else {
-          this.$message({
-            type: 'error',
-            message: '提交失败'
-          })
-		  this.getData()
-        }
-      })
-    },
-    deletedContract() {
-      const id = this.$route.query.id
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: [id],
-          operateType: 1
-        }
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-		  this.getData()
-        } else {
-          this.$message({
-            type: 'error',
-            message: '提交失败'
-          })
-		  this.getData()
-        }
-      })
-    },
-    recover(id) {
-      this.$request({
-        url: '/api/Contract/contractDraft/manager',
-        method: 'post',
-        data: {
-          ids: [id],
-          operateType: 2
-        }
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-		  this.getData()
-        } else {
-          this.$message({
-            type: 'error',
-            message: '提交失败'
-          })
-		  this.getData()
-        }
-      })
-    },
-    deleted(id) {
-      this.$request({
-        url: '/api/Contract/contractDraft/manager',
-        method: 'post',
-        data: {
-          ids: [id],
-          operateType: 1
-        }
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-		  this.getData()
-        } else {
-          this.$message({
-            type: 'error',
-            message: '提交失败'
-          })
-		  this.getData()
-        }
-      })
-    },
-    back() {
-      this.$router.go(-1)
-    }
-  }
-}
+		created() {},
+		mounted() {
+			this.role = this.$store.state.user.userInfo.type
+			console.log(this.$store.state.user.userInfo.type)
+			this.checked = this.$store.state.user.checked
+			this.getData()
+		},
+		methods: {
+			getData() {
+				const id = this.$route.query.id
+				this.$request({
+					url: '/api/Contract/' + id,
+					method: 'get'
+				}).then((res) => {
+					this.contract = res.data
+					this.url = this.contract.invoicePicList
+					this.picList = this.contract.picList
+					this.list = res.data.contractDraft.result
+					this.feed.feedbackPicList = this.picList
+					this.feed.id = this.$route.query.id
+					this.getPageData()
+				})
+			},
+			addNewBill() {
+				this.$router.push({
+					name: 'addnewbill'
+				})
+			},
+			tapDetail(id) {
+				this.$router.push({
+					name: 'billDetail',
+					query: {
+						id: id
+					}
+				})
+			},
+			handleAll(data) {
+				this.multipleSelection = data
+				console.log(this.multipleSelection)
+			},
+			handleSelectionChange(data) {
+				this.multipleSelection = data
+				console.log(this.multipleSelection)
+			},
+			handleCurrentChange(val) {
+				this.currentPage = val
+				this.getPageData()
+			},
+			jumpFirstPage() {
+				this.$refs.pagination.handleCurrentChange(1)
+				this.$emit('handleCurrentChange', 1)
+			},
+			jumpLastPage() {
+				const font = this.$refs.pagination
+				const cpage = Math.ceil(font.total / font.pageSize)
+				font.handleCurrentChange(cpage)
+			},
+			getPageData() {
+				const start = (this.currentPage - 1) * this.pagesize
+				const end = start + this.pagesize
+				this.srcList = this.list.slice(start, end)
+				this.temporaryList = this.srcList
+			},
+			Exports() {
+				// var tableHeader = [
+				// 	['序号', '汇票名称', '汇票编号', '承兑人', '金额', '服务费','汇票状态','审核状态'],
+				// ]
+				// var dataList = []
+				// this.multipleSelection.forEach((item, index) => {
+				// 	dataList.push([index + 1, item.name, item.draftNo, item.acceptorName,item.money,item.serviceMoney, item.draftStatusText, item
+				// 		.statusText
+				// 	]);
+				// })
+				// dataConversionUtil.dataToExcel('出票人列表', tableHeader, dataList)
+				// this.$message.success('导出成功!');
+			},
+			success() {
+				// this.feed.feedbackPicList=this.picList
+				// this.feed.id=this.$route.query.id
+				this.feed.approveStatus = 1
+				this.$request({
+					url: '/api/Contract/approveContract',
+					method: 'post',
+					data: this.feed
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.getData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: '提交失败'
+						})
+						this.getData()
+					}
+				})
+			},
+			failed() {
+				this.feed.approveStatus = 2
+				this.$request({
+					url: '/api/Contract/approveContract',
+					method: 'post',
+					data: this.feed
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.getData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: '提交失败'
+						})
+						this.getData()
+					}
+				})
+			},
+			recoverContract() {
+				const id = this.$route.query.id
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: [id],
+						operateType: 2
+					}
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.getData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: '提交失败'
+						})
+						this.getData()
+					}
+				})
+			},
+			deletedContract() {
+				const id = this.$route.query.id
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: [id],
+						operateType: 1
+					}
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.getData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: '提交失败'
+						})
+						this.getData()
+					}
+				})
+			},
+			recover(id) {
+				this.$request({
+					url: '/api/Contract/contractDraft/manager',
+					method: 'post',
+					data: {
+						ids: [id],
+						operateType: 2
+					}
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.getData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: '提交失败'
+						})
+						this.getData()
+					}
+				})
+			},
+			deleted(id) {
+				this.$request({
+					url: '/api/Contract/contractDraft/manager',
+					method: 'post',
+					data: {
+						ids: [id],
+						operateType: 1
+					}
+				}).then((res) => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.getData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: '提交失败'
+						})
+						this.getData()
+					}
+				})
+			},
+			back() {
+				this.$router.go(-1)
+			}
+		}
+	}
 </script>
 
 <style lang="scss">

+ 475 - 469
src/views/contracts/index.vue

xqd xqd xqd
@@ -1,67 +1,62 @@
 <template>
-  <div class="app-container">
-    <el-row type="flex" justify="space-between" style="margin-bottom: 20px">
-      <div class="grid-content bg-purple">
-        <el-input
-          v-model="search"
-          placeholder="合同名称/编号、承兑人名称或出票..."
-          clearable
-          style="width: 100%"
-          @change="Search"
-        >
-          <i slot="prefix" class="el-input__icon el-icon-search" />
-        </el-input>
-      </div>
-      <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommand">
-          <div class="pulldown">
-            <span v-if="!status" class="el-dropdown-link"> 合同状态 </span>
-            <span v-if="status" class="el-dropdown-link">
-              {{ status }}
-            </span>
-            <i class="el-icon-arrow-down el-icon--right" />
-          </div>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="合同状态">合同状态</el-dropdown-item>
-            <el-dropdown-item command="正常">正常</el-dropdown-item>
-            <el-dropdown-item command="删除">删除</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-      </div>
-      <div class="grid-content bg-purple">
-        <el-dropdown @command="handlehpCommand">
-          <div class="pulldown">
-            <span v-if="!hpstatus" class="el-dropdown-link"> 汇票状态 </span>
-            <span v-if="hpstatus" class="el-dropdown-link">
-              {{ hpstatus }}
-            </span>
-            <i class="el-icon-arrow-down el-icon--right" />
-          </div>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="汇票状态">汇票状态</el-dropdown-item>
-            <el-dropdown-item command="正常">正常</el-dropdown-item>
-            <el-dropdown-item command="删除">删除</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-      </div>
-      <div class="grid-content bg-purple">
-        <el-dropdown @command="handleCommandAuditstatus">
-          <div class="pulldown">
-            <span v-if="!Auditstatus" class="el-dropdown-link"> 审核状态 </span>
-            <span v-if="Auditstatus" class="el-dropdown-link">
-              {{ Auditstatus }}
-            </span>
-            <i class="el-icon-arrow-down el-icon--right" />
-          </div>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="审核状态">审核状态</el-dropdown-item>
-            <el-dropdown-item command="待审核">待审核</el-dropdown-item>
-            <el-dropdown-item command="成功">成功</el-dropdown-item>
-            <el-dropdown-item command="失败">失败</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-      </div>
-      <!-- <div class="grid-content bg-purple">
+	<div class="app-container">
+		<el-row type="flex" justify="space-between" style="margin-bottom: 20px">
+			<div class="grid-content bg-purple">
+				<el-input v-model="search" placeholder="合同名称/编号、承兑人名称或出票..." clearable style="width: 100%"
+					@change="Search">
+					<i slot="prefix" class="el-input__icon el-icon-search" />
+				</el-input>
+			</div>
+			<div class="grid-content bg-purple">
+				<el-dropdown @command="handleCommand">
+					<div class="pulldown">
+						<span v-if="!status" class="el-dropdown-link"> 合同状态 </span>
+						<span v-if="status" class="el-dropdown-link">
+							{{ status }}
+						</span>
+						<i class="el-icon-arrow-down el-icon--right" />
+					</div>
+					<el-dropdown-menu slot="dropdown">
+						<el-dropdown-item command="合同状态">合同状态</el-dropdown-item>
+						<el-dropdown-item command="正常">正常</el-dropdown-item>
+						<el-dropdown-item command="删除">删除</el-dropdown-item>
+					</el-dropdown-menu>
+				</el-dropdown>
+			</div>
+			<div class="grid-content bg-purple">
+				<el-dropdown @command="handlehpCommand">
+					<div class="pulldown">
+						<span v-if="!hpstatus" class="el-dropdown-link"> 汇票状态 </span>
+						<span v-if="hpstatus" class="el-dropdown-link">
+							{{ hpstatus }}
+						</span>
+						<i class="el-icon-arrow-down el-icon--right" />
+					</div>
+					<el-dropdown-menu slot="dropdown">
+						<el-dropdown-item command="汇票状态">汇票状态</el-dropdown-item>
+						<el-dropdown-item command="正常">正常</el-dropdown-item>
+						<el-dropdown-item command="删除">删除</el-dropdown-item>
+					</el-dropdown-menu>
+				</el-dropdown>
+			</div>
+			<div class="grid-content bg-purple">
+				<el-dropdown @command="handleCommandAuditstatus">
+					<div class="pulldown">
+						<span v-if="!Auditstatus" class="el-dropdown-link"> 审核状态 </span>
+						<span v-if="Auditstatus" class="el-dropdown-link">
+							{{ Auditstatus }}
+						</span>
+						<i class="el-icon-arrow-down el-icon--right" />
+					</div>
+					<el-dropdown-menu slot="dropdown">
+						<el-dropdown-item command="审核状态">审核状态</el-dropdown-item>
+						<el-dropdown-item command="待审核">待审核</el-dropdown-item>
+						<el-dropdown-item command="成功">成功</el-dropdown-item>
+						<el-dropdown-item command="失败">失败</el-dropdown-item>
+					</el-dropdown-menu>
+				</el-dropdown>
+			</div>
+			<!-- <div class="grid-content bg-purple">
         <div class="block">
           <el-date-picker
             v-model="value2"
@@ -76,416 +71,426 @@
           />
         </div>
       </div> -->
-    </el-row>
+		</el-row>
 
-    <el-table
-      v-loading="listLoading"
-      :data="temporaryList"
-      element-loading-text="Loading"
-      border
-      fit
-      highlight-current-row
-      @select="handleSelectionChange"
-      @select-all="handleAll"
-    >
-      <el-table-column align="center" label="" width="55" type="selection" />
-      <el-table-column label="合同名称" align="center" prop="name" />
-      <el-table-column label="合同编号" align="center" prop="contractNo" width="155" />
-      <el-table-column label="承兑人" align="center" prop="acceptorName" />
-      <el-table-column label="出票人" align="center" prop="drawersName" />
-      <el-table-column label="汇票状态" align="center" prop="draftStatusText" />
-      <el-table-column label="合同状态" align="center" prop="contractStatusText" />
-      <el-table-column class-name="status-col" label="审核状态" align="center" prop="statusText" />
-      <el-table-column align="center" label="时间" prop="createdAt" width="155" />
-      <el-table-column align="center" prop="created_at" label="操作" width="250">
-        <template slot-scope="scope">
-          <el-tag type="primary" style="cursor: pointer" @click="tapDetail(scope.row.id)">查看详情</el-tag>
-          <el-tag v-if="checked === 0" type="success" style="cursor: pointer" @click="Ssuccessed(scope.row.id)">
-            审核成功</el-tag>
-          <el-tag v-if="checked === 0" type="danger" style="cursor: pointer" @click="Sfailed(scope.row.id)">审核失败
-          </el-tag>
-          <el-tag v-if="checked === 1" type="success" style="cursor: pointer">恢复
-          </el-tag>
-          <el-tag v-if="checked === 1" type="danger" style="cursor: pointer">删除</el-tag>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div style="display: flex;justify-content: space-between;">
-      <el-row type="flex" justify="space-between">
-        <div class="btn" style="display: flex; justify-content: flex-end">
-          <el-button v-permission="['admin']" type="primary" @click="addNewContract">上传合同</el-button>
-          <el-button v-if="checked === 0" type="primary" @click="failed">审核失败</el-button>
-          <el-button v-if="checked === 0" type="primary" @click="successed">审核成功</el-button>
-          <el-button type="primary" @click="Exports">批量导出</el-button>
-          <el-button type="success" @click="recover">恢复</el-button>
-          <el-button type="danger" @click="deleted">删除</el-button>
-        </div>
-      </el-row>
-      <div class="pagesip">
-        <el-button
-          type="primary"
-          size="small"
-          style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-          @click="jumpFirstPage"
-        >首页
-        </el-button>
-        <el-pagination
-          ref="pagination"
-          background
-          layout="prev, pager, next"
-          :total="list.length"
-          :page-size="10"
-          prev-text="上一页"
-          next-text="下一页"
-          :hide-on-single-page="false"
-          @current-change="handleCurrentChange"
-        />
-        <el-button
-          type="primary"
-          size="small"
-          style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
-          @click="jumpLastPage"
-        >尾页
-        </el-button>
-      </div>
-    </div>
+		<el-table v-loading="listLoading" :data="temporaryList" element-loading-text="Loading" border fit
+			highlight-current-row @select="handleSelectionChange" @select-all="handleAll">
+			<el-table-column align="center" label="" width="55" type="selection" />
+			<el-table-column label="合同名称" align="center" prop="name" />
+			<el-table-column label="合同编号" align="center" prop="contractNo" width="155" />
+			<el-table-column label="承兑人" align="center" prop="acceptorName" />
+			<el-table-column label="出票人" align="center" prop="drawersName" />
+			<el-table-column label="汇票状态" align="center" prop="draftStatusText" />
+			<el-table-column label="合同状态" align="center" prop="contractStatusText" />
+			<el-table-column class-name="status-col" label="审核状态" align="center" prop="statusText" />
+			<el-table-column align="center" label="时间" prop="createdAt" width="155" />
+			<el-table-column align="center" prop="created_at" label="操作" width="250">
+				<template slot-scope="scope">
+					<el-tag type="primary" style="cursor: pointer" @click="tapDetail(scope.row.id)">查看详情</el-tag>
+					<el-tag v-if="checked === 0" type="success" style="cursor: pointer"
+						@click="Ssuccessed(scope.row.id)">
+						审核成功</el-tag>
+					<el-tag v-if="checked === 0" type="danger" style="cursor: pointer" @click="Sfailed(scope.row.id)">
+						审核失败
+					</el-tag>
+					<el-tag v-if="checked === 1" type="success" style="cursor: pointer">恢复
+					</el-tag>
+					<el-tag v-if="checked === 1" type="danger" style="cursor: pointer">删除</el-tag>
+				</template>
+			</el-table-column>
+		</el-table>
+		<div style="display: flex;justify-content: space-between;">
+			<el-row type="flex" justify="space-between">
+				<div class="btn" style="display: flex; justify-content: flex-end">
+					<el-button v-permission="['admin']" type="primary" @click="addNewContract">上传合同</el-button>
+					<el-button v-if="checked === 0" type="primary" @click="failed">审核失败</el-button>
+					<el-button v-if="checked === 0" type="primary" @click="successed">审核成功</el-button>
+					<el-button type="primary" @click="Exports">批量导出</el-button>
+					<el-button type="success" @click="recover">恢复</el-button>
+					<el-button type="danger" @click="deleted">删除</el-button>
+				</div>
+			</el-row>
+			<div class="pagesip">
+				<el-button type="primary" size="small"
+					style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpFirstPage">首页
+				</el-button>
+				<el-pagination ref="pagination" background layout="prev, pager, next" :total="list.length"
+					:page-size="10" prev-text="上一页" next-text="下一页" :hide-on-single-page="false"
+					@current-change="handleCurrentChange" />
+				<el-button type="primary" size="small"
+					style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px" @click="jumpLastPage">尾页
+				</el-button>
+			</div>
+		</div>
 
-  </div>
+	</div>
 </template>
 
 <script>
-import {
-  dataConversionUtil
-} from '../../utils/Excel.js'
-import { contractsPageApi } from '@/api/contracts'
-export default {
-  filters: {
-    statusFilter(status) {
-      const statusMap = {
-        published: 'success',
-        draft: 'gray',
-        deleted: 'danger'
-      }
-      return statusMap[status]
-    }
-  },
-  data() {
-    return {
-      srcList: [],
-      list: [],
-      temporaryList: [],
-      listLoading: false,
-      status: '',
-      hpstatus: '',
-      Auditstatus: '',
-      search: '',
-      currentPage: 1,
-      pagesize: 10,
-      checked: '',
-      pickerOptions: {
-        shortcuts: [{
-          text: '最近一周',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '最近一个月',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '最近三个月',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
-            picker.$emit('pick', [start, end])
-          }
-        }
-        ]
-      },
-      value2: '',
-      filter: {
-        current: 1,
-        size: 10
-      },
-      pagination: {
-        current: 0,
-        total: 0,
-        pageSize: 10
-      }
-    }
-  },
-  mounted() {
-    this.checked = this.$store.state.user.checked
-    // this.$request({
-    //   url: '/api/Contract/search',
-    //   method: 'post',
-    //   data: {
-    //     pageIndex: 1,
-    //     pageSize: 100
-    //   }
-    // }).then((res) => {
-    //   console.log(res)
-    //   this.list = res.data.result
-    //   this.getPageData()
-    // })
-    this.loadData()
-  },
-  methods: {
-    loadData(filtter = {}) {
-      const params = {
-        ...this.filter,
-        ...filtter
-      }
-      contractsPageApi(params).then(res => {
-        const { data } = res
-        this.filter = params
-        this.temporaryList = data.result
-        this.srcList = data.result
-        this.pagination = {
-          ...this.pagination,
-          current: params.current,
-          pageSize: params.size,
-          total: data.total
-        }
-      })
-    },
-    addNewContract() {
-      this.$router.push({
-        path: 'contracts/addcontract'
-      })
-    },
-    tapDetail(id) {
-      console.log(id)
-      this.$router.push({
-        path: '/detail',
-        query: {
-          id: id
-        }
-      })
-    },
-    successed() {
-      // let successed = this.list.filter(item => item.id === id)
-      const ids = Array.from(this.multipleSelection, ({ id }) => id)
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: ids,
-          operateType: 3
-        }
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-        } else {
-          this.$message({
-            type: 'danger',
-            message: res.msg
-          })
-        }
-      })
-    },
-    Ssuccessed(id) {
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: [id],
-          operateType: 3
-        }
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-        } else {
-          this.$message({
-            type: 'danger',
-            message: res.msg
-          })
-        }
-      })
-    },
-    failed() {
-      // let failed = this.list.filter(item => item.id === id)
-      const ids = Array.from(this.multipleSelection, ({ id }) => id)
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: ids,
-          operateType: 4
-        }
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-        } else {
-          this.$message({
-            type: 'danger',
-            message: res.msg
-          })
-        }
-      })
-    },
-    Sfailed(id) {
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: [id],
-          operateType: 4
-        }
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-        } else {
-          this.$message({
-            type: 'danger',
-            message: res.msg
-          })
-        }
-      })
-    },
-    recover(id) {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id)
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: ids,
-          operateType: 2
-        }
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-        } else {
-          this.$message({
-            type: 'danger',
-            message: res.msg
-          })
-        }
-      })
-    },
-    deleted() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id)
-      this.$request({
-        url: '/api/Contract/manage',
-        method: 'post',
-        data: {
-          ids: ids,
-          operateType: 1
-        }
-      }).then((res) => {
-        if (res.code === 200) {
-          this.$message({
-            type: 'success',
-            message: res.msg
-          })
-        } else {
-          this.$message({
-            type: 'danger',
-            message: res.msg
-          })
-        }
-      })
-    },
-    handleCommand(command) {
-      this.status = command
-      if (this.status === '正常' || this.status === '删除') {
-        this.temporaryList = this.srcList.filter(item => item.contractStatusText === this.status)
-      } else {
-        this.temporaryList = this.srcList
-      }
-    },
-    handlehpCommand(command) {
-      this.hpstatus = command
-      if (this.hpstatus === '正常' || this.hpstatus === '删除') {
-        this.temporaryList = this.srcList.filter(item => item.draftStatusText === this.hpstatus)
-      } else {
-        this.temporaryList = this.srcList
-      }
-    },
-    handleCommandAuditstatus(command) {
-      this.Auditstatus = command
-      if (this.Auditstatus === '成功' || this.Auditstatus === '失败' || this.Auditstatus === '待审核') {
-        this.temporaryList = this.srcList.filter(item => item.statusText === this.Auditstatus)
-      } else {
-        this.temporaryList = this.srcList
-      }
-    },
-    handleSelectionChange(data) {
-      this.multipleSelection = data
-      console.log(this.multipleSelection)
-    },
-    handleAll(data) {
-      this.multipleSelection = data
-      console.log(this.multipleSelection)
-    },
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getPageData()
-    },
-    jumpFirstPage() {
-      this.$refs.pagination.handleCurrentChange(1)
-      this.$emit('handleCurrentChange', 1)
-    },
-    jumpLastPage() {
-      const font = this.$refs.pagination
-      const cpage = Math.ceil(font.total / font.pageSize)
-      font.handleCurrentChange(cpage)
-    },
-    getPageData() {
-      const start = (this.currentPage - 1) * this.pagesize
-      const end = start + this.pagesize
-      this.srcList = this.list.slice(start, end)
-      this.temporaryList = this.srcList
-    },
-    Search() {
-      if (this.search === '') {
-        this.temporaryList = this.srcList
-      } else {
-        this.temporaryList = this.srcList.filter(item => item.name === this.search || item.contractNo === this
-          .search || item.acceptorName === this.search || item.drawersName === this.search)
-      }
-    },
-    Exports() {
-      var tableHeader = [
-        ['序号', '合同名称', '合同编号', '承兑人', '出票人', '汇票状态', '合同状态', '审核状态', '时间']
-      ]
-      var dataList = []
-      this.multipleSelection.forEach((item, index) => {
-        dataList.push([index + 1, item.name, item.contractNo, item.acceptorName, item.drawersName, item
-          .draftStatusText, item.contractStatusText, item.statusText, item.createdAt
-        ])
-      })
-      dataConversionUtil.dataToExcel('合同列表', tableHeader, dataList)
-      this.$message.success('导出成功!')
-    }
+	import {
+		dataConversionUtil
+	} from '../../utils/Excel.js'
+	import {
+		contractsPageApi
+	} from '@/api/contracts'
+	export default {
+		filters: {
+			statusFilter(status) {
+				const statusMap = {
+					published: 'success',
+					draft: 'gray',
+					deleted: 'danger'
+				}
+				return statusMap[status]
+			}
+		},
+		data() {
+			return {
+				srcList: [],
+				list: [],
+				temporaryList: [],
+				listLoading: false,
+				status: '',
+				hpstatus: '',
+				Auditstatus: '',
+				search: '',
+				currentPage: 1,
+				pagesize: 10,
+				checked: '',
+				pickerOptions: {
+					shortcuts: [{
+							text: '最近一周',
+							onClick(picker) {
+								const end = new Date()
+								const start = new Date()
+								start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+								picker.$emit('pick', [start, end])
+							}
+						},
+						{
+							text: '最近一个月',
+							onClick(picker) {
+								const end = new Date()
+								const start = new Date()
+								start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+								picker.$emit('pick', [start, end])
+							}
+						},
+						{
+							text: '最近三个月',
+							onClick(picker) {
+								const end = new Date()
+								const start = new Date()
+								start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+								picker.$emit('pick', [start, end])
+							}
+						}
+					]
+				},
+				value2: '',
+				filter: {
+					current: 1,
+					size: 10
+				},
+				pagination: {
+					current: 0,
+					total: 0,
+					pageSize: 10
+				}
+			}
+		},
+		mounted() {
+			this.checked = this.$store.state.user.checked
+			// this.$request({
+			//   url: '/api/Contract/search',
+			//   method: 'post',
+			//   data: {
+			//     pageIndex: 1,
+			//     pageSize: 100
+			//   }
+			// }).then((res) => {
+			//   console.log(res)
+			//   this.list = res.data.result
+			//   this.getPageData()
+			// })
+			this.loadData()
+		},
+		methods: {
+			loadData(filtter = {}) {
+				const params = {
+					...this.filter,
+					...filtter
+				}
+				contractsPageApi(params).then(res => {
+					const {
+						data
+					} = res
+					this.filter = params
+					this.temporaryList = data.result
+					this.srcList = data.result
+					this.pagination = {
+						...this.pagination,
+						current: params.current,
+						pageSize: params.size,
+						total: data.total
+					}
+				})
+			},
+			addNewContract() {
+				this.$router.push({
+					path: 'contracts/addcontract'
+				})
+			},
+			tapDetail(id) {
+				console.log(id)
+				this.$router.push({
+					path: '/detail',
+					query: {
+						id: id
+					}
+				})
+			},
+			successed() {
+				// let successed = this.list.filter(item => item.id === id)
+				const ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id)
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: ids,
+						operateType: 3
+					}
+				}).then((res) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.loadData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: res.msg
+						})
+						this.loadData()
+					}
+				})
+			},
+			Ssuccessed(id) {
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: [id],
+						operateType: 3
+					}
+				}).then((res) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.loadData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: res.msg
+						})
+						this.loadData()
+					}
+				})
+			},
+			failed() {
+				// let failed = this.list.filter(item => item.id === id)
+				const ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id)
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: ids,
+						operateType: 4
+					}
+				}).then((res) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.loadData()
+					} else {
+						this.$message({
+							type: 'error',
+							message: res.msg
+						})
+						this.loadData()
+					}
+				})
+			},
+			Sfailed(id) {
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: [id],
+						operateType: 4
+					}
+				}).then((res) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.loadData()
+					} else {
+						this.$message({
+							type: 'danger',
+							message: res.msg
+						})
+						this.loadData()
+					}
+				})
+			},
+			recover(id) {
+				const ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id)
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: ids,
+						operateType: 2
+					}
+				}).then((res) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.loadData()
+					} else {
+						this.$message({
+							type: 'danger',
+							message: res.msg
+						})
+						this.loadData()
+					}
+				})
+			},
+			deleted() {
+				const ids = Array.from(this.multipleSelection, ({
+					id
+				}) => id)
+				this.$request({
+					url: '/api/Contract/manage',
+					method: 'post',
+					data: {
+						ids: ids,
+						operateType: 1
+					}
+				}).then((res) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: res.msg
+						})
+						this.loadData()
+					} else {
+						this.$message({
+							type: 'danger',
+							message: res.msg
+						})
+						this.loadData()
+					}
+				})
+			},
+			handleCommand(command) {
+				this.status = command
+				if (this.status === '正常' || this.status === '删除') {
+					this.temporaryList = this.srcList.filter(item => item.contractStatusText === this.status)
+				} else {
+					this.temporaryList = this.srcList
+				}
+			},
+			handlehpCommand(command) {
+				this.hpstatus = command
+				if (this.hpstatus === '正常' || this.hpstatus === '删除') {
+					this.temporaryList = this.srcList.filter(item => item.draftStatusText === this.hpstatus)
+				} else {
+					this.temporaryList = this.srcList
+				}
+			},
+			handleCommandAuditstatus(command) {
+				this.Auditstatus = command
+				if (this.Auditstatus === '成功' || this.Auditstatus === '失败' || this.Auditstatus === '待审核') {
+					this.temporaryList = this.srcList.filter(item => item.statusText === this.Auditstatus)
+				} else {
+					this.temporaryList = this.srcList
+				}
+			},
+			handleSelectionChange(data) {
+				this.multipleSelection = data
+				console.log(this.multipleSelection)
+			},
+			handleAll(data) {
+				this.multipleSelection = data
+				console.log(this.multipleSelection)
+			},
+			handleCurrentChange(val) {
+				this.currentPage = val
+				this.getPageData()
+			},
+			jumpFirstPage() {
+				this.$refs.pagination.handleCurrentChange(1)
+				this.$emit('handleCurrentChange', 1)
+			},
+			jumpLastPage() {
+				const font = this.$refs.pagination
+				const cpage = Math.ceil(font.total / font.pageSize)
+				font.handleCurrentChange(cpage)
+			},
+			getPageData() {
+				const start = (this.currentPage - 1) * this.pagesize
+				const end = start + this.pagesize
+				this.srcList = this.list.slice(start, end)
+				this.temporaryList = this.srcList
+			},
+			Search() {
+				if (this.search === '') {
+					this.temporaryList = this.srcList
+				} else {
+					this.temporaryList = this.srcList.filter(item => item.name === this.search || item.contractNo === this
+						.search || item.acceptorName === this.search || item.drawersName === this.search)
+				}
+			},
+			Exports() {
+				if (this.multipleSelection == "") {
+					this.$message({
+						type: 'warning',
+						message: '请选择数据!'
+					})
+				} else {
+					var tableHeader = [
+						['序号', '合同名称', '合同编号', '承兑人', '出票人', '汇票状态', '合同状态', '审核状态', '时间']
+					]
+					var dataList = []
+					this.multipleSelection.forEach((item, index) => {
+						dataList.push([index + 1, item.name, item.contractNo, item.acceptorName, item.drawersName,
+							item
+							.draftStatusText, item.contractStatusText, item.statusText, item.createdAt
+						])
+					})
+					dataConversionUtil.dataToExcel('合同列表', tableHeader, dataList)
+					this.$message.success('导出成功!')
+				}
+			}
 
-  }
-}
+		}
+	}
 </script>
 <style lang="scss">
 	.pulldown {
@@ -517,7 +522,8 @@ export default {
 	.el-col {
 		margin-bottom: 20px;
 	}
-	.btn{
+
+	.btn {
 		padding: 20px;
 	}
-</style>
+</style>

+ 1 - 0
src/views/form/index.vue

xqd
@@ -128,6 +128,7 @@
 					// name:'',
 					// status:,
 				},
+				multipleSelection:[],
 				srcList: [],
 				list: [],
 				temporaryList: [],

+ 7 - 5
src/views/login/index.vue

xqd xqd xqd
@@ -81,6 +81,7 @@
 
 <script>
 import logo from '/src/assets/img/logo.png'
+import router from "@/router";
 export default {
   name: 'Login',
   data() {
@@ -183,10 +184,10 @@ export default {
           }
         }
       }).then(action => {
-        this.$message({
-          type: 'info',
-          message: 'action: ' + action
-        })
+        // this.$message({
+        //   type: 'info',
+        //   message: 'action: ' + action
+        // })
       })
     },
     handleLogin() {
@@ -197,7 +198,8 @@ export default {
           return
         }
         this.$store.dispatch('user/ActionLogin', this.loginForm)
-		this.$store.commit('user/getAdmin', that.checked)
+		this.$store.commit('user/getAdmin', this.checked)
+		
       })
     }
     //  handleLogin() {

+ 188 - 169
src/views/mine/index.vue

xqd
@@ -1,183 +1,202 @@
 <template>
-  <div class="app-container">
-    <el-row>
-      <el-col style=" box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) ;padding:30px" :xs="24" :sm="24" :md="24" :lg="24"
-        :xl="24" >
-        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-right: 10px;" v-if="checked==1">
-          <el-form ref="form" :model="form" label-width="120px" >
-            <el-form-item label="" style="border-bottom:1px solid #F4F4F4">
-              <span slot="label">
-                <span style="color:#262626;">供应商个人信息</span>
-              </span>
-            </el-form-item>
-            <el-form-item label="供应商" :rules="[{  message: '姓名不能为空不能为空'}]">
-              <el-input v-model="form.name" class="ipwidth" />
-            </el-form-item>
-            <el-form-item label="社会信用代码" :rules="[{ message: '电话号码不能为空'}]">
-              <el-input v-model="form.socialCode" class="ipwidth" />
-            </el-form-item>
-            <el-form-item label="法人姓名" :rules="[{  message: '身份证不能为空'}]">
-              <el-input v-model="form.legalPerson" class="ipwidth" />
-            </el-form-item>
-            <el-form-item label="联系人" :rules="[{  message: '身份证不能为空'}]">
-              <el-input v-model="form.contacts" class="ipwidth" />
-            </el-form-item>
-            </el-form-item>
-          </el-form>
-        </el-col>
-        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-left: 30px;" v-if="checked==1">
-          <el-form ref="form" :model="form" label-width="120px">
-            <el-form-item label="" style="border-bottom:1px solid #F4F4F4">
-              <span slot="label">
-                <span style="color:#262626;">其他信息</span>
-              </span>
-            </el-form-item>
-            <el-form-item label="联系电话">
-              <el-input v-model="form.contactsMobile" class="ipwidth" />
-            </el-form-item>
-            <el-form-item label="账号">
-              <el-input v-model="form.account" class="ipwidth" />
-            </el-form-item>
-            <el-collapse v-model="activeNames" @change="handleChange" style="width: 80%;float: right;">
-              <el-collapse-item title="认证照片" name="3" >
-                <div>
-                  <el-image style="width: 100px; height: 100px" :src="url" :preview-src-list="srcList">
-                  </el-image>
-                </div>
-              </el-collapse-item>
-              <el-collapse-item title="授权委托书" name="4">
-                <div>
-                  <el-image style="width: 100px; height: 100px" :src="url" :preview-src-list="srcList">
-                  </el-image>
-                </div>
-              </el-collapse-item>
-				<el-collapse-item title="修改密码" name="5">
-					<el-input v-model="oldPassword" placeholder="请输入旧密码"></el-input>
-					<el-input v-model="newPassword" placeholder="请输入新密码"></el-input>
-					<el-button type="primary" @click="onSubmit">确认修改</el-button>
-				</el-collapse-item>
-            </el-collapse>
-            </el-form-item>
-          </el-form>
-        </el-col>
-		<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-right: 10px;" v-if="checked==0">
-		  <el-form ref="form" :model="form" label-width="140px">
-		    <el-form-item label="" style="border-bottom:1px solid #F4F4F4">
-		      <span slot="label">
-		        <span style="color:#262626;">业务管理员个人信息</span>
-		      </span>
-		    </el-form-item>
-		    <el-form-item label="姓名" :rules="[{  message: '姓名不能为空不能为空'}]">
-		      <el-input v-model="form.realName" class="ipwidth" />
-		    </el-form-item>
-		    <el-form-item label="账号" :rules="[{ message: '账号不能为空'}]">
-		      <el-input v-model="form.account" class="ipwidth" />
-		    </el-form-item>
-		    <el-form-item label="联系电话" :rules="[{  message: '联系电话不能为空'}]">
-		      <el-input v-model="form.mobile" class="ipwidth" />
-		    </el-form-item>
-		  </el-form>
-		  <el-collapse v-model="activeNames" @change="handleChange" style="width: 90%;float: right;">
-			  <el-collapse-item title="修改密码" name="1">
-				 <el-input v-model="oldPassword" placeholder="请输入旧密码"></el-input>
-				 <el-input v-model="newPassword" placeholder="请输入新密码"></el-input>
-				 <el-button type="primary" @click="onSubmit">确认修改</el-button>
-			  </el-collapse-item>
-			  <el-collapse-item title="忘记密码">
-				  <div>请联系系统管理员</div>
-			  </el-collapse-item>
-		  </el-collapse>
-		</el-col>
-      </el-col>
-    </el-row>
-  </div>
+	<div class="app-container">
+		<el-row>
+			<el-col style=" box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) ;padding:30px" :xs="24" :sm="24" :md="24"
+				:lg="24" :xl="24">
+				<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-right: 10px;" v-if="role===2">
+					<el-form ref="form" :model="form" label-width="120px">
+						<el-form-item label="" style="border-bottom:1px solid #F4F4F4">
+							<span slot="label">
+								<span style="color:#262626;">供应商个人信息</span>
+							</span>
+						</el-form-item>
+						<el-form-item label="供应商" :rules="[{  message: '姓名不能为空不能为空'}]">
+							<el-input v-model="form.name" class="ipwidth" />
+						</el-form-item>
+						<el-form-item label="社会信用代码" :rules="[{ message: '电话号码不能为空'}]">
+							<el-input v-model="form.socialCode" class="ipwidth" />
+						</el-form-item>
+						<el-form-item label="法人姓名" :rules="[{  message: '身份证不能为空'}]">
+							<el-input v-model="form.legalPerson" class="ipwidth" />
+						</el-form-item>
+						<el-form-item label="联系人" :rules="[{  message: '身份证不能为空'}]">
+							<el-input v-model="form.contacts" class="ipwidth" />
+						</el-form-item>
+						</el-form-item>
+					</el-form>
+				</el-col>
+				<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-left: 30px;" v-if="role===2">
+					<el-form ref="form" :model="form" label-width="120px">
+						<el-form-item label="" style="border-bottom:1px solid #F4F4F4">
+							<span slot="label">
+								<span style="color:#262626;">其他信息</span>
+							</span>
+						</el-form-item>
+						<el-form-item label="联系电话">
+							<el-input v-model="form.contactsMobile" class="ipwidth" />
+						</el-form-item>
+						<el-form-item label="账号">
+							<el-input v-model="form.account" class="ipwidth" />
+						</el-form-item>
+						<el-collapse v-model="activeNames" @change="handleChange" style="width: 80%;float: right;">
+							<el-collapse-item title="认证照片" name="3">
+								<div>
+									<el-image style="width: 100px; height: 100px" :src="form.identifyPicList"
+										:preview-src-list="form.identifyPicList">
+									</el-image>
+								</div>
+							</el-collapse-item>
+							<el-collapse-item title="授权委托书" name="4">
+								<div>
+									<el-image style="width: 100px; height: 100px" :src="form.proxyFileList"
+										:preview-src-list="form.proxyFileList">
+									</el-image>
+								</div>
+							</el-collapse-item>
+							<el-collapse-item title="修改密码" name="5">
+								<el-input v-model="oldPassword" placeholder="请输入旧密码"></el-input>
+								<el-input v-model="newPassword" placeholder="请输入新密码"></el-input>
+								<el-button type="primary" @click="onSubmit">确认修改</el-button>
+							</el-collapse-item>
+						</el-collapse>
+						</el-form-item>
+					</el-form>
+				</el-col>
+				<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-right: 10px;" v-if="role===1">
+					<el-form ref="form" :model="form" label-width="140px">
+						<el-form-item label="" style="border-bottom:1px solid #F4F4F4">
+							<span slot="label">
+								<span style="color:#262626;">业务管理员个人信息</span>
+							</span>
+						</el-form-item>
+						<el-form-item label="姓名" :rules="[{  message: '姓名不能为空不能为空'}]">
+							<el-input v-model="form.name" class="ipwidth" />
+						</el-form-item>
+						<el-form-item label="账号" :rules="[{ message: '账号不能为空'}]">
+							<el-input v-model="form.account" class="ipwidth" />
+						</el-form-item>
+						<el-form-item label="联系电话" :rules="[{  message: '联系电话不能为空'}]">
+							<el-input v-model="form.contactsMobile" class="ipwidth" />
+						</el-form-item>
+					</el-form>
+					<el-collapse v-model="activeNames" @change="handleChange" style="width: 90%;float: right;">
+						<el-collapse-item title="修改密码" name="1">
+							<el-input v-model="oldPassword" placeholder="请输入旧密码"></el-input>
+							<el-input v-model="newPassword" placeholder="请输入新密码"></el-input>
+							<el-button type="primary" @click="onSubmit">确认修改</el-button>
+						</el-collapse-item>
+						<el-collapse-item title="忘记密码">
+							<div>请联系系统管理员</div>
+						</el-collapse-item>
+					</el-collapse>
+				</el-col>
+			</el-col>
+		</el-row>
+	</div>
 </template>
 
 <script>
 	let that
-  export default {
-    data() {
-      return {
-        url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
-        srcList: [
-          'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-          'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
-        ],
-				checked:'',
-        resource: '',
-        radio: '1',
-        activeNames:'',
-        form: {},
-		oldPassword:'',
-		newPassword:''
-      }
-    },
-	mounted(){
-		that=this
-		this.checked=that.$store.state.user.checked
-		if(this.checked==1){
-			this.$request({
-				url:'/api/Supplier/4',
-				method:'get'
-			}).then((res)=>{
-				this.form=res.data
-			})
-		}else if(this.checked==0){
-			this.$request({
-				url:'/api/Account',
-				method:'get'
-			}).then((res)=>{
-				this.form=res.data
-			})
-		}
-	},
-    methods: {
-      handleChange(){
+	export default {
+		data() {
+			return {
+				role: '',
+				id: '',
+				resource: '',
+				radio: '1',
+				activeNames: '',
+				form: {},
+				oldPassword: '',
+				newPassword: ''
+			}
+		},
+		mounted() {
+			this.role = this.$store.state.user.userInfo.type
+			console.log(this.$store.state.user.userInfo)
+			this.id=this.$store.state.user.userInfo.id
+			if (this.role === 2) {
+				this.$request({
+					url: '/api/Supplier/'+this.id,
+					method: 'get'
+				}).then((res) => {
+					this.form=res.data
+					console.log(res)
+				})
+			} else if (this.role === 1) {
+				this.$request({
+					url: '/api/Account',
+					method: 'get'
+				}).then((res) => {
+					console.log(res)
+					// this.form = res.data
+				})
+			}
+		},
+		methods: {
+			handleChange() {
 
-      },
-      onSubmit() {
-        this.$request({
-			url:'/api/Supplier/password',
-			method:'post',
-			data:{
-				oldPassword:this.oldPassword,
-				newPassword:this.newPassword
+			},
+			onSubmit() {
+				if(this.role===2){
+					this.$request({
+						url: '/api/Supplier/password',
+						method: 'post',
+						data: {
+							oldPassword: this.oldPassword,
+							newPassword: this.newPassword
+						}
+					}).then((res) => {
+						console.log(res)
+						this.$message({
+							type: 'success',
+							message: '修改密码成功'
+						})
+					}).catch((err) => {
+						console.log(err)
+					})
+				}else if(this.role===1){
+					this.$request({
+						url:'/api/Account/password',
+						method:'post',
+						data:{
+							oldPassword: this.oldPassword,
+							newPassword: this.newPassword
+						}
+					}).then((res)=>{
+						this.$message({
+							type: 'success',
+							message: '修改密码成功'
+						})
+					})
+				}
+				
+			},
+			onCancel() {
+				this.$message({
+					message: 'cancel!',
+					type: 'warning'
+				})
 			}
-		}).then((res)=>{
-			console.log(res)
-			this.$message({
-				type:'success',
-				message:'修改密码成功'
-			})
-		}).catch((err)=>{
-			console.log(err)
-		})
-      },
-      onCancel() {
-        this.$message({
-          message: 'cancel!',
-          type: 'warning'
-        })
-      }
-    }
-  }
+		}
+	}
 </script>
 
 <style lang="scss">
-  .line {
-    text-align: center;
-  }
+	.line {
+		text-align: center;
+	}
+
+	.ipwidth {
+		width: 100%;
+	}
 
-  .ipwidth {
-    width: 100%;
-  }
 
+	.el-radio__label {
+		margin-left: 80px;
+	}
 
-  .el-radio__label {
-    margin-left: 80px;
-  }
-  .el-collapse-item__header{
-    font-weight: 600;
-    color: #606266;
-  }
+	.el-collapse-item__header {
+		font-weight: 600;
+		color: #606266;
+	}
 </style>