Browse Source

前端mxx

gjy 4 years ago
parent
commit
c9b010d71f

+ 6 - 3
src/api/V2/contract/index.js

@@ -1,9 +1,9 @@
 // 根据ID,常量类别获常量数据
-// 查看合同接口
-export const API_GET_EXAMINE_HISTORY = '/contractManagementInfo/getInfo'
 export const API_GET_CONTRACT_TENANT = '/contractManagementInfo/selectInfo'
 export const API_POST_ADD_CONTRACT_TENANT = '/contractManagementInfo/api/addInfo'
 export const API_POST_MANNER_OF_PACKING_TENANT = '/commonSysParameter/getInfo'
+// 查看
+export const API_GET_CONTRACT_MANAGEMENTINFO = '/contractManagementInfo/getInfo'
 // 验收下拉
 export const API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN = `/customDropDown/query/customDropDown`
 // 下拉添加
@@ -15,4 +15,7 @@ export const API_POST_CUSTOM_DOWN_DELETE = '/customDropDown/api/saveDelete'
 // 导出
 export const API_POST_EXPORT = '/contractManagementInfo/export'
 // 操作历史
-export const API_POST_BILL_OPERATE_HIS = '/billOperateHis/query/commonBillOperateHis'
+export const API_GET_BILL_OPERATE_HIS = '/billOperateHis/query/commonBillOperateHis'
+// 修改当前状态
+export const API_POST_EDITSTATUS = '/contractManagementInfo/editStatus'
+

+ 9 - 7
src/model/contarct/index.js

@@ -4,24 +4,24 @@ import { appRx } from '../defalutConfig/indexRx'
 import {
     API_GET_CONTRACT_TENANT,
     API_POST_ADD_CONTRACT_TENANT,
-    API_GET_EXAMINE_HISTORY,
     API_POST_MANNER_OF_PACKING_TENANT,
     API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN,
     API_POST_CUSTOM_DOWN_ADD,
     API_POST_CUSTOM_DOWN_EDIT,
     API_POST_CUSTOM_DOWN_DELETE,
     API_POST_EXPORT,
-    API_POST_BILL_OPERATE_HIS,
-    
+    API_GET_BILL_OPERATE_HIS,
+    API_POST_EDITSTATUS,
+    API_GET_CONTRACT_MANAGEMENTINFO
 } from '@/api/V2/contract'
 // 列表
 export const getList = appRx.get(API_GET_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
 // 添加
 export const addList = appRx.post(API_POST_ADD_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
-// 下拉
+// 包装方式
 export const packList = appRx.get(API_POST_MANNER_OF_PACKING_TENANT, errorCatcher, errorHandle, filter)
-//查看
-export const getInquiry = appRx.get(API_GET_EXAMINE_HISTORY,errorCatcher,errorHandle,filter)
+// 查看
+export const examineList = appRx.get(API_GET_CONTRACT_MANAGEMENTINFO, errorCatcher, errorHandle, filter)
 // 下拉
 export const xiala = appRx.get(API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
 export const addxiala = appRx.post(API_POST_CUSTOM_DOWN_ADD, errorCatcher, errorHandle, filter)
@@ -30,4 +30,6 @@ export const delxiala = appRx.post(API_POST_CUSTOM_DOWN_DELETE, errorCatcher, er
 // 导出
 export const export1 = appRx.get(API_POST_EXPORT)
 // 操作历史
-export const billoperatehis = appRx.get(API_POST_BILL_OPERATE_HIS, errorCatcher, errorHandle, filter)
+export const billoperatehis = appRx.get(API_GET_BILL_OPERATE_HIS, errorCatcher, errorHandle, filter)
+// 修改状态
+export const editstatus = appRx.post(API_POST_EDITSTATUS, errorCatcher, errorHandle, filter)

+ 1 - 1
src/views/contractManagement/component/routers/route.js

@@ -46,7 +46,7 @@ const contractManagementRouter = {
         import(/* webpackChunkName: "applDetail" */ '@/views/contractManagement/purchaseContractExamine'),
       name: 'purchaseContractExamine',
       meta: {
-        title: 'salesContractExamine',
+        title: 'purchaseContractExamine',
         shortcutEntrance: 'contractManagement',
         module: 'contractManagement.salesContract.purchaseContractExamine',
         permissicon: [],

+ 117 - 14
src/views/contractManagement/purchaseContract.vue

@@ -22,10 +22,11 @@
       </template>
       <template slot="right">
         <ws-select
-          v-model="deptBudgetList.crtDutyId"
+          v-model="searchTypeText"
           placeholder=""
           class="typeselect"
           @change="selecttaskType"
+          :value="searchType"
         >
           <ws-option
             v-for="item in taskTypeList"
@@ -72,11 +73,12 @@
         >
       </template>
     </BaseHeaderLayout>
-    <el-table class="wenzi"
+    <el-table
+      class="wenzi"
       :data="contractList.records"
       style="width: 100%; margin-top: 10px"
     >
-      <el-table-column type="index" />
+      <el-table-column type="index" label="序号" />
       <el-table-column prop="contractNo" label="合同编号" width="80">
       </el-table-column>
       <el-table-column prop="goodsName" label="货名" width="80">
@@ -92,8 +94,32 @@
       </el-table-column>
       <el-table-column prop="status" label="状态">
         <template slot-scope="scope">
-          <span>{{ scope.row.status }}</span>
-          <i class="el-icon-edit" @click.stop="editClick(item, index)"></i>
+          <el-popover
+            placement="left"
+            :width="400"
+            trigger="click"
+            @show="history(scope.row)"
+          >
+            <template #reference>
+              <span>{{ scope.row.status }}</span>
+            </template>
+            <div>
+              <p>操作历史</p>
+              <div v-for="(item, index) in historyList">
+                <div class="vertical-circle"></div>
+                <div class="vertical-text">
+                  {{ item.operateUser }}{{ item.dealMsg }}<br />{{
+                    item.updateDate
+                  }}
+                </div>
+                <div
+                  v-if="index != historyList.length - 1"
+                  class="vertical-line"
+                ></div>
+              </div>
+            </div>
+          </el-popover>
+          <i class="el-icon-edit" @click="editClick(scope.row)"></i>
         </template>
       </el-table-column>
       <el-table-column prop="signingDate" label="签订日期"> </el-table-column>
@@ -121,6 +147,7 @@
         </template>
       </el-table-column>
     </el-table>
+
     <!-- 附件弹框 -->
     <!-- <WinseaContentModal
       v-model="accessoryTFs"
@@ -145,9 +172,14 @@
   </div>
 </template>
 <script>
-import { getList, export1 } from '@/model/contarct/index'
+import {
+  getList,
+  export1,
+  editstatus,
+  billoperatehis,
+} from '@/model/contarct/index'
 import { downloadFile } from '@/utils/batchDown'
-import { dayjs, fmoney } from 'base-core-lib'
+import { dayjs, fmoney, EventBus } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
   watch: {
@@ -174,7 +206,9 @@ export default {
       currentPage: 1,
       pageSize: 10,
       searchType: 1,
+      searchTypeText: '未完成',
       searchKeyWord: '',
+      contractType: 2,
       startDate: null,
       endDate: null,
       // 提交类型
@@ -185,6 +219,7 @@ export default {
       },
       contractList: [],
       deptBudgetList: {},
+      historyList: [],
       pickerBeginDateBefore: {
         disabledDate: (time) => {
           return time.getTime() > Date.now()
@@ -192,14 +227,13 @@ export default {
       },
       accessoryTFs: false,
       taskTypeList: [
-        { value: '未完成(默认)', type: 1 },
+        { value: '未完成', type: 1 },
         { value: '已完成', type: 2 },
-        { value: '待回款', type: 3 },
         { value: '全部合同', type: '' },
       ],
     }
   },
-  created() {
+  mounted() {
     //cg.viewBudget
     //cg.viewSpareMoney
     // this.getVesselData();
@@ -210,6 +244,7 @@ export default {
     getList() {
       getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
+        contractType: this.contractType,
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         searchType: this.searchType,
@@ -223,6 +258,36 @@ export default {
           this.contractList = response
         })
     },
+    editClick(row) {
+      var status = ''
+      if (row.status == '待执行' || row.status == '已完成') {
+        status = '执行中'
+      } else if (row.status == '执行中') {
+        status = '已完成'
+      }
+      this.$confirm(`是否将状态改为${status}`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          editstatus({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '状态修改成功',
+              })
+              this.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    },
     selecttaskType(e) {
       for (var i = 0; i < this.taskTypeList.length; i++) {
         if (this.taskTypeList[i].value == e) {
@@ -245,7 +310,11 @@ export default {
       this.appendixIdss = row.receiveAttachmentPath
     },
     handleExamine(row) {
-      this.$router.push({ path: 'purchaseContractExamine' })
+      console.log(row)
+      this.$router.push({
+        name: 'purchaseContractExamine',
+        params: { id: row.id },
+      })
     },
     handleAdd() {
       this.$router.push({ path: 'purchaseContractAdd' })
@@ -257,11 +326,22 @@ export default {
     handleCloe() {
       this.dialogViewSpareMoney = false
     },
-    find() {},
+    history(row) {
+      console.log(row)
+      billoperatehis({ id: row.id })
+        .toPromise()
+        .then((response) => {
+          this.historyList = response
+        })
+    },
+    find() {
+      this.getList()
+    },
     async exportlist() {
       const { data } = await export1(
         {
           compId: sessionStorage.getItem('ws-pf_compId'),
+          contractType: this.contractType,
           currentPage: this.currentPage,
           pageSize: this.pageSize,
           searchType: this.searchType,
@@ -284,8 +364,32 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+.vertical-line {
+  height: 100px;
+  border-left: 2px solid;
+  margin-left: 4px;
+  // border-image: -webkit-linear-gradient(#00eba7, #08b8e6) 30 30;
+  // border-image: -moz-linear-gradient(#00eba7, #08b8e6) 30 30;
+  // border-image: linear-gradient(#00eba7, #08b8e6) 30 30;
+}
 
-/deep/.cell{
+.vertical-circle {
+  float: left;
+  width: 10px;
+  height: 10px;
+  border: 2px solid white;
+  background-color: #08b8e6;
+  -webkit-border-radius: 100px;
+}
+.vertical-circle:first-child {
+  color: red;
+}
+.vertical-text {
+  float: left;
+  margin-top: -7px;
+}
+/deep/.el-table .el-table__header .cell,
+/deep/.el-table .el-table__body .cell {
   text-align: center;
 }
 .typeselect {
@@ -320,7 +424,6 @@ export default {
     margin: 10px 20px;
     cursor: pointer;
     font-size: 14px;
-
     p {
       margin: 8px 0px;
       span {

+ 73 - 7
src/views/contractManagement/purchaseContractExamine.vue

@@ -257,8 +257,8 @@
         <div class="remark">
           <h3>备注信息</h3>
         </div>
-        {{deptBudgetList.contractProcessInfo.remarks}}
-        <img :src="deptBudgetList.contractProcessInfo.addressUrl" alt="">
+        {{deptBudgetList.remarks}}
+        <img :src="deptBudgetList.addressUrl" alt="">
       </base-card>
     </ws-form>
     <div style='text-align:right;padding:10px;'>
@@ -273,7 +273,15 @@
   </div>
 </template>
 <script>
-import { getVesselOne } from '@/model/procurement/basic'
+import {
+  packList,
+  addList,
+  xiala,
+  addxiala,
+  editxiala,
+  delxiala,
+  examineList,
+} from '@/model/contarct/index'
 import { dayjs } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
@@ -302,17 +310,75 @@ export default {
       submitType: true,
       tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
       ruleDeptBudget: [],
-      deptBudgetList: {},
+      deptBudgetList: {
+        contractProcessInfo: {},
+        contractGoodsInfo: {},
+      },
       mainReportAdd: {},
+      list: {},
     }
   },
+
   created() {
-    //cg.viewBudget
-    //cg.viewSpareMoney
-    // this.getVesselData();
+    this.loaddata()
     this.showType = this.isShow
   },
   methods: {
+    loaddata() {
+      // 数据
+      examineList({ id: this.$route.params.id })
+        .toPromise()
+        .then((response) => {
+          this.deptBudgetList = response
+        })
+      // 包装方式
+      packList({ constId: 'CON1' })
+        .toPromise()
+        .then((response) => {
+          this.packtypeList = response
+        })
+      // 验收方式
+      this.getUnitList()
+      // 货名
+      packList({ constId: 'CON2' })
+        .toPromise()
+        .then((response) => {
+          this.goodnameList = response
+        })
+      // 品级
+      packList({ constId: 'CON3' })
+        .toPromise()
+        .then((response) => {
+          this.gradeList = response
+        })
+      // 双章
+      packList({ constId: 'CON4' })
+        .toPromise()
+        .then((response) => {
+          this.ChapterTwoList = response
+        })
+    },
+    getUnitList() {
+      xiala({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        constCode: 'TYPEYAN',
+      })
+        .toPromise()
+        .then((response) => {
+          this.unitList = response
+          let currItem
+          this.unitList.forEach((item, index, arr) => {
+            item.flag = 'delete'
+            if (this.vModel == item.constKey) {
+              currItem = item
+            }
+          })
+          //
+          if (currItem) {
+            this.selectContract(currItem.constValue)
+          }
+        })
+    },
     // 关闭 dialog时 处理文件url 初始化upload组件
     handleClose() {
       this.dialogViewSpareMoney = false

+ 80 - 55
src/views/contractManagement/salesContract.vue

@@ -2,12 +2,41 @@
 <!--2019年5月30日 20:25:16 by jlx-->
 <template>
   <div>
-    <BaseHeaderLayout :leftSpan="16"> 
-     
+    <BaseHeaderLayout :leftSpan="10">
       <template slot="left">
-       
-       
-        <ws-date-picker class="times"
+        <ws-button
+          type="primary"
+          :disable="checkBtn"
+          @click="handleAdd()"
+          v-hasPermission="
+            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+          "
+          >添加</ws-button
+        >
+        <ws-button
+          :disable="checkBtn"
+          @click="enquiry(3)"
+          v-hasPermission="
+            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+          "
+          >导出</ws-button
+        >
+      </template>
+      <template slot="right">
+        <ws-select
+          v-model="deptBudgetList.crtDutyId"
+          placeholder=""
+          class="typeselect"
+          @change="selectCrtDuty"
+        >
+          <ws-option
+            v-for="item in taskTypeList"
+            :key="item.value"
+            :label="item.value"
+            :value="item.value"
+          />
+        </ws-select>
+        <ws-date-picker
           :picker-options="pickerBeginDateBefore"
           v-model="deptBudgetList.birthday"
           type="date"
@@ -17,7 +46,7 @@
           value-format="yyyy-MM-dd"
         />
         <span>至</span>
-        <ws-date-picker class="times"
+        <ws-date-picker
           :picker-options="pickerBeginDateBefore"
           v-model="deptBudgetList.birthday"
           type="date"
@@ -26,7 +55,7 @@
           format="yyyy-MM-dd"
           value-format="yyyy-MM-dd"
         />
-        <ws-input 
+        <ws-input
           v-model="deptBudgetList.interviewOpinion"
           placeholder="可按照合同编号、买方名称、卖方名称进行查找"
           clearable
@@ -44,40 +73,6 @@
           "
           >查找</ws-button
         >
-          <ws-select
-          v-model="deptBudgetList.crtDutyId"
-          placeholder=""
-          class="typeselect"
-          @change="selectCrtDuty"
-        >
-       
-          <ws-option class="topcenter"
-            v-for="item in taskTypeList"
-            :key="item.value"
-            :label="item.value"
-            :value="item.value"
-          />
-        </ws-select>
-      </template>
-       <template slot="right" >
-         
-        <ws-button
-          type="primary"
-          :disable="checkBtn"
-          @click="handleAdd()"
-          v-hasPermission="
-            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-          "
-          >添加</ws-button
-        >
-        <ws-button
-          :disable="checkBtn"
-          @click="enquiry(3)"
-          v-hasPermission="
-            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-          "
-          >导出</ws-button
-        >
       </template>
     </BaseHeaderLayout> 
     <el-table :data="tableData.records" style="width: 100%; margin-top: 10px">
@@ -123,8 +118,12 @@
   </div>
 </template>
 <script>
-import { getVesselOne } from '@/model/procurement/basic'
-import{getList}from'@/model/contarct/index'
+import {
+  getList,
+  export1,
+  editstatus,
+  billoperatehis,
+} from '@/model/contarct/index'
 import { dayjs } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
@@ -192,13 +191,19 @@ export default {
         aliasName: '',
         
       },
+      currentPage: 1,
+      pageSize: 10,
+      searchType: 1,
+      searchTypeText: '未完成',
+      searchKeyWord: '',
+      contractType: 1,
+      startDate: null,
+      endDate: null,
     }
   },
-  created() {
-    //cg.viewBudget
-    //cg.viewSpareMoney
-    // this.getVesselData();\
+  mounted() {
     this.getList()
+    this.showType = this.isShow
   },
   methods: {
     getList() {
@@ -241,13 +246,36 @@ export default {
     listQuery() {},
     total() {},
     clearfiltQuery() {},
+    selectCrtDuty() {},
+    pickerBeginDateBefore: {
+      disabledDate: (time) => {
+        return time.getTime() > Date.now()
+      },
+    },
+    getList() {
+      getList({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        contractType: this.contractType,
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchType: this.searchType,
+        searchKeyWord: this.searchKeyWord,
+        startDate: this.startDate,
+        endDate: this.endDate,
+        contrPage: this.contrPage,
+      })
+        .toPromise()
+        .then((response) => {
+          this.contractList = response
+        })
+    },
   },
 }
 </script>
-
 <style lang="scss" scoped>
-
-
+.typeselect {
+  width: 500px;
+}
 .padding-xs {
   padding: 15px;
   text-align: right;
@@ -324,12 +352,9 @@ export default {
     }
   }
 }
-/deep/.el-table .el-table__header .cell, /deep/.el-table .el-table__body .cell{
-    text-align: center;
-}
 .box-app {
   display: inline-block;
-  
+  float: left;
   margin-left: 30px;
   line-height: 50px;
 }
@@ -412,4 +437,4 @@ export default {
     padding: 0 !important;
   }
 }
-</style>
+</style>