Browse Source

前端--sdy

zhongtianhaoyuan 4 years ago
parent
commit
9c10258734

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

@@ -18,8 +18,11 @@ export const API_POST_EXPORT = '/contractManagementInfo/export'
 export const API_GET_BILL_OPERATE_HIS = '/billOperateHis/query/commonBillOperateHis'
 // 修改状态
 export const API_POST_EDITSTATUS = '/contractManagementInfo/editStatus'
+//删除销售合同
+export const API_POST_CONTRACT_DELETE ='contractManagementInfo/deleteInfo '
 //销售合同修改编辑
+
 export const API_POST_EDITINFO ='/contractManagementInfo/editInfo'
-//删除
-export const API_POST_CONTRACT_DELETE = '/contractManagementInfo/deleteInfo'
-                                         
+
+                                         
+

+ 3 - 2
src/model/contarct/index.js

@@ -35,7 +35,8 @@ export const export1 = appRx.get(API_POST_EXPORT)
 export const billoperatehis = appRx.get(API_GET_BILL_OPERATE_HIS, errorCatcher, errorHandle, filter)
 // 修改状态
 export const editstatus = appRx.post(API_POST_EDITSTATUS, errorCatcher, errorHandle, filter)
+//删除销售合同
+export const deletecontract = appRx.post(API_POST_CONTRACT_DELETE,errorCatcher,errorHandle,filter) 
 //修改销售合同编辑
 export const editInfo = appRx.post(API_POST_EDITINFO, errorCatcher, errorHandle, filter)
-//删除
-export const deletecontract = appRx.post(API_POST_CONTRACT_DELETE,errorCatcher,errorHandle,filter)
+

+ 76 - 20
src/views/contractManagement/purchaseContract.vue

@@ -92,7 +92,7 @@
       <el-table-column prop="seller" label="卖方"> </el-table-column>
       <el-table-column prop="imperfectGrain" label="已完成(吨)">
       </el-table-column>
-      <el-table-column prop="status" label="状态">
+      <el-table-column prop="status" label="状态" >
         <template slot-scope="scope">
           <el-popover
             placement="left"
@@ -111,13 +111,13 @@
                 <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>
+              </div>
             </div>
           </el-popover>
           <i class="el-icon-edit" @click="editClick(scope.row)"></i>
@@ -148,28 +148,34 @@
         </template>
       </el-table-column>
     </el-table>
-
+    <el-pagination
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :current-page="currentPage"
+      :page-size="deptCircularPage.pageSize"
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="deptBudgetTotal"
+    >
+    </el-pagination>
     <!-- 附件弹框 -->
-    <!-- <WinseaContentModal
+    <WinseaContentModal
       v-model="accessoryTFs"
       :title="$t('system.noticeCircular.information')"
       @on-cancel="handleClose"
     >
+      <p>查看附件</p>
       <ws-upload
-        ref="uploads"
-        table-name="ism_circular_management_info "
-        :vesselId="my_vesselId ? my_vesselId : ''"
-        oss-key="circularLetter"
-        :editable="false"
-        :appendix-ids="appendixIdss"
+        ref="upload"
+        table-name="maintain_work_order"
+        oss-key="mainPlan"
         :comp-id="compId"
+        :appendix-ids="appendixIdsAdd"
+        :vesselId="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @uploadSuccess="uploadSuccess"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
       />
-      <template slot="footer" class="dialog-footer">
-        <ws-button @click="hiddenHistory">{{
-          $t('crew.interviewManagement.button.cancel')
-        }}</ws-button>
-      </template>
-    </WinseaContentModal> -->
+    </WinseaContentModal>
   </div>
 </template>
 <script>
@@ -181,9 +187,15 @@ import {
   deletecontract,
 } from '@/model/contarct/index'
 import { downloadFile } from '@/utils/batchDown'
+import Pagination from '@/components/Pagination'
+import WsUpload from '@/components/WsUpload'
 import { dayjs, fmoney, EventBus } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
+  components: {
+    WsUpload,
+    Pagination,
+  },
   watch: {
     vesselId(val) {
       this.getList()
@@ -201,12 +213,15 @@ export default {
       monetaryKey: null,
       // 表格显示数据
       tableDate: [],
+      size: 10,
       // 是否显示
       showType: true,
       // 年
       year: '',
+      deptBudgetTotal: 0,
       currentPage: 1,
       pageSize: 10,
+      appendixIdsAdd: '',
       searchType: 1,
       searchTypeText: '未完成',
       searchKeyWord: '',
@@ -215,6 +230,7 @@ export default {
       endDate: null,
       // 提交类型
       submitType: true,
+      deptCircularPage: {},
       date: {
         year: dayjs().format('YYYY'),
         month: dayjs().format('MM'),
@@ -222,6 +238,7 @@ export default {
       contractList: [],
       deptBudgetList: {},
       historyList: [],
+      compId: sessionStorage.getItem('ws-pf_compId'),
       pickerBeginDateBefore: {
         disabledDate: (time) => {
           return time.getTime() > Date.now()
@@ -243,6 +260,17 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    handleClose() {
+      this.accessoryTFs = false
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`)
+      this.getList()
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`)
+      this.getList()
+    },
     getList() {
       getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
@@ -257,20 +285,36 @@ export default {
       })
         .toPromise()
         .then((response) => {
+          this.deptCircularPage.currentPage = response.current
+          this.deptCircularPage.pageSize = response.size
+          this.deptBudgetTotal = response.total
           this.contractList = response
         })
     },
+    // 上传附件
+    uploadSuccess(data, files, url) {
+      console.log(data, files, url)
+
+      // this.deptBudgetList.
+      // this.formData.append('files', files)
+      // this.feedbackObj.uploadNameAttachment = data.appendixName
+      // this.feedbackObj.pathUploadAttachment = data.appendixPath
+      // // this.newAppendixs = files
+      // this.onChangeFlag = true
+    },
     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 })
@@ -297,7 +341,7 @@ export default {
         }
       }
     },
-    fujian() {
+    fujian(row) {
       if (
         row.receiveAttachmentPath === null ||
         row.receiveAttachmentPath === ''
@@ -406,6 +450,14 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+.wrap {
+  width: 400px;
+  position: absolute;
+  top: 131px;
+  left: 794px;
+  transform-origin: right center;
+  z-index: 2005;
+}
 .vertical-line {
   height: 100px;
   border-left: 2px solid;
@@ -414,7 +466,11 @@ export default {
   // border-image: -moz-linear-gradient(#00eba7, #08b8e6) 30 30;
   // border-image: linear-gradient(#00eba7, #08b8e6) 30 30;
 }
-
+.el-pagination {
+  padding: 10px 15px;
+  margin-bottom: 0;
+  text-align: right;
+}
 .vertical-circle {
   float: left;
   width: 10px;

+ 133 - 8
src/views/contractManagement/salesContract.vue

@@ -91,7 +91,36 @@
       <el-table-column prop="seller" label="卖方"> </el-table-column>
       <el-table-column prop="imperfectGrain" label="已完成(吨)">
       </el-table-column>
-      <el-table-column prop="status" label="状态"> </el-table-column>
+      <el-table-column prop="status" label="状态"> 
+        <template slot-scope="scope">
+          <el-popover
+            placement="left"
+            :width="400"
+            trigger="hover"
+            @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>
       <el-table-column prop="mildewGrain" label="未回款(元)">
       </el-table-column>
@@ -128,6 +157,7 @@ import {
   export1,
   editstatus,
   billoperatehis,
+  deletecontract,
 } from '@/model/contarct/index'
 // import { dayjs } from 'base-core-lib'
 export default {
@@ -154,18 +184,29 @@ export default {
       // 年
       year: '',
       // 提交类型
+      
+      
+    contractType:1,
+        currentPage:1,
+        pageSize:10,
+        searchType:1,
+        searchKeyWord:'',
+        startDate:null,
+        endDate: null,
 
       contractType: 1,
       currentPage: 1,
       pageSize: 10,
       searchType: 1,
-      searchKeyWord: '',
+      searchKeyWord:'',
       startDate: null,
       endDate: null,
+historyList:{},
       submitType: true,
       contractForm: {},
       categoryIndex: 0,
       rulesVendor: {},
+      // pickerBeginDateBefore: {},
       tableData: [],
       taskTypeList: [
         { value: '未完成' ,type:1},
@@ -194,12 +235,23 @@ export default {
       },
       searchTypeText: '未完成',
     }
+    
   },
+  
   activated() {
+    this.deletecontract()
     this.getList()
     this.showType = this.isShow
   },
   methods: {
+    // deletecontract(){
+    //   deletecontract({
+
+    //   }).toPromise()
+    //     .then((response) => {
+    //       this.tableData = response
+    //     })
+    // },
     getList() {
       getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
@@ -228,29 +280,71 @@ export default {
        console.log(this)
       this.getList()
     },
+    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
+        })
+    },
+    
     // 关闭 dialog时 处理文件url 初始化upload组件
     handleClose() {
       this.dialogViewSpareMoney = false
     },
+    
     handleExamine(row) {
-      this.$router.push({ path: 'salesContractExamine' })
+      
+      this.$router.push({
+        
+        name: 'salesContractExamine',
+        params: { id: row.id },
+        })
     },
     handleAdd() {
       this.$router.push({ path: 'salesContractAdd' })
     },
+
+  
+    deletecontract(){},
     filtlistQuery() {},
     searchDialog() {},
     vesselIdSelected() {},
     seelctShips() {},
     checkBtn() {},
     handleEdit(row) {
-      this.$router.push({ name: 'salesContractEdit' ,
-      
-      params: { id: row.id },
+      this.$router.push({
+        name: 'salesContractEdit',
 
+        params: { id: row.id },
       })
     },
-    
+
     approve() {},
     listQuery() {},
     total() {},
@@ -261,6 +355,38 @@ export default {
         return time.getTime() > Date.now()
       },
     },
+    handleDelete(row){
+    var handleDelete = ''
+      if (row.handleDelete == '待执行' || row.handleDelete == '已完成') {
+       handleDelete = '执行中'
+      } else if (row.handleDelete == '执行中') {
+        handleDelete = '已完成'
+        
+      }
+      this.$confirm(`合同删除后不可恢复,是否继续删除?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      
+      })
+        .then(() => {
+          deletecontract({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '删除成功',
+              })
+              this.deletecontract()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    }
   },
 }
 </script>
@@ -294,7 +420,6 @@ export default {
     margin: 10px 20px;
     cursor: pointer;
     font-size: 14px;
-
     p {
       margin: 8px 0px;
       span {

+ 2 - 0
src/views/contractManagement/salesContractEdit.vue

@@ -557,6 +557,8 @@ export default {
         },
         contractProcessInfo: {},
       },
+      // selectpackingMethod:{},
+      //  change:{},
       ruleDeptBudget: {},
       isEdited: false,
       registered: {},

+ 198 - 83
src/views/contractManagement/salesContractExamine.vue

@@ -18,6 +18,7 @@
         >
       </el-col>
     </el-row>
+   
     <ws-form
       ref="deptBudgetList"
       :rules="mainReportAdd"
@@ -91,79 +92,124 @@
 
       <!--面试信息-->
       <div class="remark">
-        <h3>货物信息</h3>
-      </div>
-      <ws-info-table>
-        <ws-form-item label="货名" span="1" prop="waterContent">
-          {{ deptBudgetList.contractGoodsInfo.goodsName }}
-        </ws-form-item>
-        <ws-form-item label="水分(%)<=" span="1" prop="intendedShipId">
-          {{ deptBudgetList.contractGoodsInfo.waterContent }}
-        </ws-form-item>
-        <ws-form-item label="品级" span="1" prop="grade">
-          {{ deptBudgetList.contractGoodsInfo.grade }}
-        </ws-form-item>
-        <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
-          {{ deptBudgetList.contractGoodsInfo.impurity }}
-        </ws-form-item>
-        <ws-form-item label="容重(克/升)<=" span="1" prop="bulkDensity">
-          {{ deptBudgetList.contractGoodsInfo.bulkDensity }}
-        </ws-form-item>
-        <ws-form-item
-          label="霉变粒(%)<="
-          span="1"
-          prop="mildewGrain"
-          class="result"
-        >
-          {{ deptBudgetList.contractGoodsInfo.mildewGrain }}
-        </ws-form-item>
-        <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
-          {{ deptBudgetList.contractGoodsInfo.jiaorenli }}
-        </ws-form-item>
-        <ws-form-item
-          label="不完善粒(%)<="
-          span="1"
-          prop="imperfectGrain"
-          class="result"
-        >
-          {{ deptBudgetList.contractGoodsInfo.imperfectGrain }}
-        </ws-form-item>
-      </ws-info-table>
-      <div class="remark">
-        <h3>流程信息</h3>
-      </div>
-      <ws-info-table>
-        <ws-form-item label="合同收入(元)" span="1" prop="goodsNameKey">
-          {{ deptBudgetList.contractProcessInfo.goodsNameKey }}
-        </ws-form-item>
-        <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
-          {{ deptBudgetList.contractProcessInfo.goodsName }}
-        </ws-form-item>
-        <ws-form-item label="费用支出(元)" span="1" prop="waterContent"
-          >{{ deptBudgetList.contractProcessInfo.waterContent }}
-        </ws-form-item>
-        <ws-form-item label="未开发票(元)" span="1" prop="impurity"
-          >{{ deptBudgetList.contractProcessInfo.impurity }}
-        </ws-form-item>
-        <ws-form-item label="未回款(元)" span="1" prop="mildewGrain"
-          >{{ deptBudgetList.contractProcessInfo.mildewGrain }}
-        </ws-form-item>
-        <ws-form-item
-          label="已完成发运量(吨)"
-          span="1"
-          prop="imperfectGrain"
-          class="result"
-          >{{ deptBudgetList.contractProcessInfo.imperfectGrain }}
-        </ws-form-item>
-        <ws-form-item label="双章原件回收情况" span="1" prop="grade"
-          >{{ deptBudgetList.contractProcessInfo.grade }}
-        </ws-form-item>
-      </ws-info-table>
-      <div class="remark">
-        <h3>备注信息</h3>
-      </div>
-      {{ deptBudgetList.contractProcessInfo.remarks }}
-      <img :src="deptBudgetList.contractProcessInfo.addressUrl" alt="" />
+      <h3>货物信息</h3>
+    </div>
+        <ws-info-table>
+          <ws-form-item
+            label="货名"
+            span="1"
+            prop="waterContent"
+          >
+          {{deptBudgetList.contractGoodsInfo.goodsName}}
+          </ws-form-item>
+          <ws-form-item
+            label="水分(%)<="
+            span="1"
+            prop="intendedShipId"
+          >
+          {{deptBudgetList.contractGoodsInfo.waterContent}}
+          </ws-form-item>
+          <ws-form-item
+            label="品级"
+            span="1"
+            prop="grade"
+          >
+           {{deptBudgetList.contractGoodsInfo.grade}}
+          </ws-form-item>
+          <ws-form-item
+            label="杂质(%)<="
+            span="1"
+            prop="impurity"
+          >
+          {{deptBudgetList.contractGoodsInfo.impurity}}
+          </ws-form-item>
+          <ws-form-item
+            label="容重(克/升)<="
+            span="1"
+            prop="bulkDensity"
+          >
+          {{deptBudgetList.contractGoodsInfo.bulkDensity}}
+          </ws-form-item>
+          <ws-form-item
+            label="霉变粒(%)<="
+            span="1"
+            prop="mildewGrain"
+            class="result"
+          >
+            {{deptBudgetList.contractGoodsInfo.mildewGrain}}
+          </ws-form-item>
+           <ws-form-item
+            label="热损伤(%)<="
+            span="1"
+            prop="jiaorenli"
+          >
+            {{deptBudgetList.contractGoodsInfo.jiaorenli}}
+          </ws-form-item>
+          <ws-form-item
+            label="不完善粒(%)<="
+            span="1"
+            prop="imperfectGrain"
+            class="result"
+          >
+            {{deptBudgetList.contractGoodsInfo.imperfectGrain}}
+          </ws-form-item>
+        </ws-info-table>
+        <div class="remark">
+          <h3>流程信息</h3>
+        </div>
+        <ws-info-table>
+          <ws-form-item
+            label="合同收入(元)"
+            span="1"
+            prop="goodsNameKey"
+          >
+          {{deptBudgetList.contractProcessInfo.goodsNameKey}}
+          </ws-form-item>
+          <ws-form-item
+            label="已开发票(元)"
+            span="1"
+            prop="goodsName"
+          >
+          {{deptBudgetList.contractProcessInfo.goodsName}}
+          </ws-form-item>
+          <ws-form-item
+            label="费用支出(元)"
+            span="1"
+            prop="waterContent"
+          >{{deptBudgetList.contractProcessInfo.waterContent}}
+          </ws-form-item>
+          <ws-form-item
+            label="未开发票(元)"
+            span="1"
+            prop="impurity"
+          >{{deptBudgetList.contractProcessInfo.impurity}}
+          </ws-form-item>
+          <ws-form-item
+            label="未回款(元)"
+            span="1"
+            prop="mildewGrain"
+          >{{deptBudgetList.contractProcessInfo.mildewGrain}}
+          </ws-form-item>
+          <ws-form-item
+            label="已完成发运量(吨)"
+            span="1"
+            prop="imperfectGrain"
+            class="result"
+          >{{deptBudgetList.contractProcessInfo.imperfectGrain}}
+          </ws-form-item>
+           <ws-form-item
+            label="双章原件回收情况"
+            span="1"
+            prop="grade"
+          >{{deptBudgetList.contractProcessInfo.grade}}
+          </ws-form-item>
+        </ws-info-table>
+        <div class="remark">
+          <h3>备注信息</h3>
+        </div>
+        {{deptBudgetList.remarks}}
+        <img :src="deptBudgetList.addressUrl" alt="">
+
       <!-- </base-card> -->
     </ws-form>
     <div style="text-align: right; padding: 10px">
@@ -179,8 +225,17 @@
 </template>
 
 <script>
-import { getVesselOne } from '@/model/procurement/basic'
-import { getList } from '@/model/contarct/index'
+import {
+  
+  getList,
+  packList,
+  addList,
+  xiala,
+  addxiala,
+  editxiala,
+  delxiala,
+  examineList,
+} from '@/model/contarct/index'
 import { dayjs } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
@@ -207,20 +262,80 @@ export default {
       year: '',
       // 提交类型
       submitType: true,
-      tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
+      tableData: [],
       ruleDeptBudget: [],
-      deptBudgetList: {},
+      deptBudgetList: {
+        contractProcessInfo: {},
+        contractGoodsInfo: {},
+      },
       mainReportAdd: {},
+      list: {},
     }
   },
-  activated() {
-    //cg.viewBudget
-    //cg.viewSpareMoney
-    // this.getVesselData();
+
+  created() {
+    this.loaddata()
     this.showType = this.isShow
     this.getList()
+    this.examineList()
   },
   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
@@ -228,7 +343,7 @@ export default {
     handleExamine() {},
     approve() {},
     returnsales() {
-      this.$router.push({ path: 'purchaseContract' })
+      this.$router.push({ path: 'salesContract' })
     },
   },
 }
@@ -388,4 +503,4 @@ export default {
   overflow: scroll;
   height: 93vh;
 }
-</style>
+</style>