Bläddra i källkod

前端孟祥旭

gjy 4 år sedan
förälder
incheckning
465360f25e

+ 5 - 1
src/api/V2/contract/index.js

@@ -21,4 +21,8 @@ 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_EDITINFO ='/contractManagementInfo/editInfo'
+
+                                         
+

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

@@ -13,8 +13,8 @@ import {
     API_GET_BILL_OPERATE_HIS,
     API_POST_EDITSTATUS,
     API_GET_CONTRACT_MANAGEMENTINFO,
-    API_POST_CONTRACT_DELETE,
-    API_POST_EDITINFO
+    API_POST_EDITINFO,
+    API_POST_CONTRACT_DELETE
 } from '@/api/V2/contract'
 // 列表
 export const getList = appRx.get(API_GET_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
@@ -39,3 +39,4 @@ export const editstatus = appRx.post(API_POST_EDITSTATUS, errorCatcher, errorHan
 export const deletecontract = appRx.post(API_POST_CONTRACT_DELETE,errorCatcher,errorHandle,filter) 
 //修改销售合同编辑
 export const editInfo = appRx.post(API_POST_EDITINFO, errorCatcher, errorHandle, filter)
+

+ 40 - 3
src/views/contractManagement/purchaseContract.vue

@@ -101,8 +101,8 @@
             visible-arrow="false"
             @show="history(scope.row)"
           >
-            <template>
-              <span slot="reference">{{ scope.row.status }}</span>
+            <template >
+              <span  slot="reference">{{ scope.row.status }}</span>
             </template>
             <div>
               <p>操作历史</p>
@@ -184,6 +184,7 @@ import {
   export1,
   editstatus,
   billoperatehis,
+  deletecontract,
 } from '@/model/contarct/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
@@ -255,7 +256,6 @@ export default {
     //cg.viewBudget
     //cg.viewSpareMoney
     // this.getVesselData();
-    console.log(11111)
     this.getList()
     this.showType = this.isShow
   },
@@ -409,6 +409,43 @@ export default {
         type: 'xls',
       })
     },
+    // deletecontract(){},
+    //删除
+   handleDelete(row){
+    var handleDelete = ' '//sfdkd
+      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.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    }
+
+    
   },
 }
 </script>

+ 4 - 3
src/views/contractManagement/purchaseContractAdd.vue

@@ -435,6 +435,9 @@ import {
 import WsUpload from '@/components/WsUpload'
 export default {
   name: 'viewSpareMoney',
+   components: {
+    WsUpload,
+  },
   watch: {
     vesselId(val) {
       this.getVesselData()
@@ -446,9 +449,7 @@ export default {
       this.loaddata()
     },
   },
-  components: {
-    WsUpload,
-  },
+ 
   data() {
     return {
       //弹出框

+ 23 - 17
src/views/contractManagement/salesContract.vue

@@ -24,10 +24,11 @@
       </template>
       <template slot="right">
         <ws-select
-          v-model="deptBudgetList.crtDutyId"
+          v-model="searchTypeText"
           placeholder=""
           class="typeselect"
-          @change="selectCrtDuty"
+          @change="selecttaskType"
+          :value="searchType"
         >
           <ws-option
             v-for="item in taskTypeList"
@@ -38,7 +39,7 @@
         </ws-select>
         <ws-date-picker
           :picker-options="pickerBeginDateBefore"
-          v-model="deptBudgetList.birthday"
+          v-model="startDate"
           type="date"
           default-value="1980-01-01"
           placeholder="起始日期"
@@ -48,7 +49,7 @@
         <span>至</span>
         <ws-date-picker
           :picker-options="pickerBeginDateBefore"
-          v-model="deptBudgetList.birthday"
+          v-model="endDate"
           type="date"
           default-value="1980-01-01"
           placeholder="截止日期"
@@ -56,7 +57,7 @@
           value-format="yyyy-MM-dd"
         />
         <ws-input
-          v-model="deptBudgetList.interviewOpinion"
+          v-model="searchKeyWord"
           placeholder="可按照合同编号、买方名称、卖方名称进行查找"
           clearable
           maxlength="500"
@@ -67,7 +68,7 @@
         <ws-button
           type="primary"
           :disable="checkBtn"
-          @click="enquiry(3)"
+          @click="find()"
           v-hasPermission="
             `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
           "
@@ -240,10 +241,10 @@ export default {
       // pickerBeginDateBefore: {},
       tableData: [],
       taskTypeList: [
-        { value: '未完成(默认)' },
-        { value: '已完成' },
-        { value: '待回款' },
-        { value: '全部合同' },
+        { value: '未完成' ,type:1},
+        { value: '已完成' ,type:2},
+        { value: '待回款' ,type:3},
+        { value: '全部合同',type:'' },
       ],
       deptBudgetList: {
         compId: sessionStorage.getItem('ws-pf_compId'),
@@ -264,14 +265,7 @@ export default {
         interviewOpinion: '',
         aliasName: '',
       },
-      currentPage: 1,
-      pageSize: 10,
-      searchType: 1,
       searchTypeText: '未完成',
-      searchKeyWord: '',
-      contractType: 1,
-      startDate: null,
-      endDate: null,
     }
     
   },
@@ -337,12 +331,24 @@ export default {
     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
+     selecttaskType(e) {
+      for (var i = 0; i < this.taskTypeList.length; i++) {
+        if (this.taskTypeList[i].value == e) {
+          this.searchType = this.taskTypeList[i].type
+        }
+      }
+    },
+     find() {
+       console.log(this)
+      this.getList()
     },
     editClick(row) {
       var status = ''

+ 14 - 11
src/views/contractManagement/salesContractAdd.vue

@@ -209,7 +209,7 @@
           </ws-form-item>
 
           <!--溢短装(%)-->
-          <ws-form-item label="溢短装(%)" span="1" prop="contractNo">
+          <ws-form-item label="溢短装(%)" span="1" prop="contractNo">
             <ws-input
               v-model="deptBudgetList.overShort"
               maxlength="100"
@@ -507,8 +507,8 @@
   </div>
 </template>
 <script>
- import { getVesselOne } from '@/model/procurement/basic'
- import { dayjs } from 'base-core-lib'
+//  import { getVesselOne } from '@/model/procurement/basic'
+//  import { dayjs } from 'base-core-lib'
 import {
   packList,
   addList,
@@ -517,8 +517,14 @@ import {
   editxiala,
   delxiala,
 } from '@/model/contarct/index'
+import WsUpload from '@/components/WsUpload'
+
 export default {
   name: 'viewSpareMoney',
+  components:{
+  WsUpload,
+
+  },
   watch: {
     vesselId(val) {
       this.getVesselData()
@@ -721,14 +727,11 @@ export default {
           })
       }
     },
-    selectContract(val) {
-      let key = this.unitList.find((item) => item.constValue === val).constKey
-      this.pleaseChoose = val
-    },
-    selectContract(val) {
-      let key = this.unitList.find((item) => item.constValue === val).constKey
-      this.pleaseChoose = val
-    },
+    // selectContract(val) {
+    //   let key = this.unitList.find((item) => item.constValue === val).constKey
+    //   this.pleaseChoose = val
+    // },
+   
     handleExamine() {},
     approve() {},
     // returnsales() {

+ 156 - 31
src/views/contractManagement/salesContractEdit.vue

@@ -32,12 +32,13 @@
         <ws-info-table>
           <!--合同编号-->
           <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-input
+            <!-- <ws-input
               v-model="deptBudgetList.contractNo"
               maxlength="100"
               size="small"
-            />
-            <span class="unchangeable">*</span>
+            /> -->
+            {{deptBudgetList.contractNo}}
+            
           </ws-form-item>
 
           <!--运输方式-->
@@ -51,12 +52,9 @@
 
           <!--买方-->
           <ws-form-item label="买方" span="1" prop="contractNo">
-            <ws-input
-              v-model="deptBudgetList.buyer"
-              maxlength="100"
-              size="small"
-            />
-            <span class="unchangeable">*</span>
+            
+            {{deptBudgetList.buyer}}
+            
           </ws-form-item>
 
           <!--结算方式-->
@@ -70,12 +68,9 @@
 
           <!--卖方-->
           <ws-form-item label="卖方" span="1" prop="contractNo">
-            <ws-input
-              v-model="deptBudgetList.seller"
-              maxlength="100"
-              size="small"
-            />
-            <span class="unchangeable">*</span>
+           
+            {{deptBudgetList.seller}}
+          
           </ws-form-item>
 
           <!--货源地-->
@@ -206,7 +201,7 @@
           </ws-form-item>
 
           <!--溢短装(%)-->
-          <ws-form-item label="溢短装(%)" span="1" prop="contractNo">
+          <ws-form-item label="溢短装(%)" span="1" prop="contractNo">
             <ws-input
               v-model="deptBudgetList.overShort"
               maxlength="100"
@@ -289,7 +284,7 @@
           <ws-info-table>
             <!--货名-->
             <ws-form-item label="货名" span="1" prop="goodsName">
-              <ws-select
+              <!-- <ws-select
                 v-model="deptBudgetList.contractGoodsInfo.goodsName"
                 placeholder=""
                 class="typeselect"
@@ -301,8 +296,9 @@
                   :label="item.constValue"
                   :value="item.constValue"
                 />
-              </ws-select>
-              <span class="unchangeable">*</span>
+              </ws-select> -->
+              {{deptBudgetList.contractGoodsInfo.goodsName}}
+              
             </ws-form-item>
 
             <!--水分(%)<=-->
@@ -507,7 +503,10 @@
 <script>
 // import { getVesselOne } from '@/model/procurement/basic'
 // import { dayjs } from 'base-core-lib'
-import { examineList, editInfo, packList } from '@/model/contarct/index'
+import { examineList, editInfo, packList , xiala,
+  addxiala,
+  editxiala,
+  delxiala,} from '@/model/contarct/index'
 export default {
   name: 'viewSpareMoney',
   watch: {
@@ -534,25 +533,41 @@ export default {
       // 提交类型
       submitType: true,
       tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
-      pickerBeginDateBefore: {},
+      pickerBeginDateBefore: {
+         disabledDate: (time) => {
+          return time.getTime() > Date.now()
+        },
+      },
       // selectpackingMethod:{},
-      selectunitList: {},
-      //  change:{},
+     selectunitList: {},
+      //change:{},
+      onChange:{},
+      uploadSuccess:{},
+      selectgrade:{},
+      goodnameList: {},
+     selectpackingMethod:{},
       unitList: {},
-      packtypeList: {},
-      compId: {},
-      appendixIdsAdd: {},
-      size: {},
-      deptBudgetList: {},
+      packtypeList: [],
+      compId: sessionStorage.getItem('ws-pf_compId'),
+      appendixIdsAdd: '',
+      size: 10,
+      deptBudgetList: {
+         contractGoodsInfo: {
+          goodsName: '',
+        },
+        contractProcessInfo: {},
+      },
+      // selectpackingMethod:{},
+      //  change:{},
       ruleDeptBudget: {},
       isEdited: false,
       registered: {},
       selectCrtDuty: {},
       dutyList: {},
       sexList: {},
-      pickerBeginDateBefore: {},
       selectDuty: {},
-
+gradeList:{},
+ChapterTwoList:{},
       selectIntendedShip: {},
       interviewTypeList: {},
     }
@@ -564,7 +579,7 @@ export default {
     this.loaddata()
     this.editInfo()
     this.showType = this.isShow
-    console.log(this.$route.params)
+  // console.log(this.$route.params)
     this.showType = this.isShow
   },
   methods: {
@@ -609,11 +624,121 @@ export default {
           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)
+          }
+        })
+    },
+    // 编辑
+    editClick(item, index) {
+      const map = JSON.parse(JSON.stringify(item))
+      if (Object.is(item.id, 1)) {
+        return
+      }
+      if (Object.is(this.unitList[index].flag, 'delete')) {
+        map.flag = 'check'
+        this.$set(this.unitList, index, map)
+      } else {
+        map.flag = 'delete'
+        this.$set(this.unitList, index, map)
+      }
+    },
+    // 删除
+    deleteClick(item, index) {
+      if (Object.is(item.constKey, 1)) {
+        return
+      }
+      if (!item.constValue) {
+        this.unitList.splice(index, 1)
+        return
+      }
+      delxiala({ id: this.unitList[index].id })
+        .toPromise()
+        .then((response) => {
+          this.getUnitList()
+          this.pleaseChoose = ''
+        })
+    },
+     saveClick(item, index) {
+    //  console.log(item)
+
+      if (Object.is(item.id, 1)) {
+        return
+      }
+      if (Object.is(this.unitList[index].flag, 'delete')) {
+        this.$set(this.unitList, index, { flag: 'check' })
+      } else {
+        this.$set(this.unitList, index, { flag: 'delete' })
+      }
+      if (!item.constValue) {
+        this.unitList.splice(index, 1)
+        return
+      }
+      if (item.flag == 'add') {
+        item.constKey = Math.random() * 20
+        this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
+        this.trainingMethods.constKey = item.constKey
+        this.trainingMethods.constCode = 'TYPEYAN'
+        this.trainingMethods.constValue = item.constValue
+        this.trainingMethods.id = item.id
+        addxiala(this.trainingMethods)
+          .toPromise()
+          .then((response) => {
+            this.getUnitList()
+          })
+      } else if (item.flag == 'check') {
+        this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
+        this.trainingMethods.constKey = item.constKey
+        this.trainingMethods.constCode = 'TYPEYAN'
+        this.trainingMethods.constValue = item.constValue
+        this.trainingMethods.id = item.id
+        editxiala(this.trainingMethods)
+          .toPromise()
+          .then((response) => {
+            this.getUnitList()
+          })
+      }
+    },
+    submit() { 
+      this.$refs.deptBudgetList.validate((valid) => {
+        if (valid) {
+          this.deptBudgetList.compId = this.compId
+          this.deptBudgetList.contractType = 1
+         editInfo(this.deptBudgetList)
+            .toPromise()
+            .then((response) => {
+              this.$message.success('添加成功')
+              this.$router.push({ path: 'salesContract' })
+            })
+        } else {
+          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+          return false
+        }
+      })
+    },
     editInfo() {
       editInfo({})
     },
     // getList(){}
   },
+  
 }
 </script>