Forráskód Böngészése

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

18513069273 4 éve
szülő
commit
2099ad2263

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

@@ -18,5 +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_EDITINFO ='/contractManagementInfo/editInfo'
+
+                                         
+

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

@@ -13,8 +13,8 @@ import {
     API_GET_BILL_OPERATE_HIS,
     API_POST_EDITSTATUS,
     API_GET_CONTRACT_MANAGEMENTINFO,
-    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)
@@ -35,5 +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 editInfo = appRx.post(API_POST_EDITINFO, errorCatcher, errorHandle, filter)
+

+ 43 - 4
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"
@@ -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
   },
@@ -308,11 +308,13 @@ export default {
         status = '执行中'
       } else if (row.status == '执行中') {
         status = '已完成'
+        
       }
       this.$confirm(`是否将状态改为${status}`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning',
+      
       })
         .then(() => {
           editstatus({ id: row.id })
@@ -407,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 {
       //弹出框

+ 266 - 35
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')}`
           "
@@ -75,6 +76,7 @@
         >
       </template>
     </BaseHeaderLayout>
+    
     <el-table :data="tableData.records" style="width: 100%; margin-top: 10px">
       <el-table-column type="index" />
       <el-table-column prop="contractNo" label="合同编号" width="80">
@@ -90,11 +92,46 @@
       <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="click"
+            @show="history(scope.row)"
+          >
+            <template>
+              <span slot="reference">{{ 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>
-      <el-table-column prop="addressUrl" label="附件"> </el-table-column>
+
+      <el-table-column prop="addressUrl" label="附件">
+        <template slot-scope="scope">
+           <i @click="fujian(scope.row)" class="el-icon-paperclip iconCss"></i>
+        </template>
+      </el-table-column>
+
       <el-table-column prop="address" label="操作" width="300">
         <template slot-scope="scope">
           <el-button
@@ -112,13 +149,26 @@
         </template>
       </el-table-column>
     </el-table>
-    <!-- 弹出页面-审核通过 -->
-    <BaseContentModalScrap
-      v-model="dialogApproveFormVisible"
-      :title="$t('common.opinion')"
-      :isRules="false"
-      @confirm="approve"
-    />
+    
+    <!-- 附件弹框 -->
+    <WinseaContentModal
+      v-model="accessoryTFs"
+      :title="$t('system.noticeCircular.information')"
+      @on-cancel="handleClose"
+    >
+      <p>查看附件</p>
+      <ws-upload
+        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" />
+    </WinseaContentModal>
+
   </div>
 </template>
 <script>
@@ -127,10 +177,19 @@ import {
   export1,
   editstatus,
   billoperatehis,
+  deletecontract,
 } from '@/model/contarct/index'
-import { dayjs } from 'base-core-lib'
+
+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.getVesselData()
@@ -153,26 +212,39 @@ export default {
       // 年
       year: '',
       // 提交类型
+      
+      
+    contractType:1,
+        currentPage:1,
+        pageSize:10,
+        searchType:1,
+        searchKeyWord:'',
+        startDate:null,
+        endDate: null,
+        appendixIdsAdd: '',
 
       contractType: 1,
       currentPage: 1,
       pageSize: 10,
       searchType: 1,
-      searchKeyWord: '',
+      searchKeyWord:'',
       startDate: null,
       endDate: null,
-
+      historyList:{},
       submitType: true,
       contractForm: {},
       categoryIndex: 0,
       rulesVendor: {},
-      // pickerBeginDateBefore:{},
+
+
+      accessoryTFs: false,
+      // 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'),
@@ -193,21 +265,47 @@ export default {
         interviewOpinion: '',
         aliasName: '',
       },
-      currentPage: 1,
-      pageSize: 10,
-      searchType: 1,
       searchTypeText: '未完成',
-      searchKeyWord: '',
-      contractType: 1,
-      startDate: null,
-      endDate: null,
     }
+    
   },
+   
   activated() {
+    this.deletecontract()
     this.getList()
     this.showType = this.isShow
+    console.log(11111)
   },
   methods: {
+    handleClose() {
+      this.accessoryTFs = false
+    },
+    history(row) {
+      console.log(row)
+      billoperatehis({ id: row.id })
+        .toPromise()
+        .then((response) => {
+          this.historyList = 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
+    },
+    // deletecontract(){
+    //   deletecontract({
+
+    //   }).toPromise()
+    //     .then((response) => {
+    //       this.tableData = response
+    //     })
+    // },
     getList() {
       getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
@@ -223,18 +321,98 @@ export default {
         .toPromise()
         .then((response) => {
           this.tableData = response
+          this.deptCircularPage.currentPage = response.current
+          this.deptCircularPage.pageSize = response.size
+          this.deptBudgetTotal = response.total
+          this.contractList = response
         })
     },
-    // 关闭 dialog时 处理文件url 初始化upload组件
-    handleClose() {
-      this.dialogViewSpareMoney = false
+     // 上传附件
+    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 = ''
+      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
+        })
+    },
+    fujian(row) {
+      if (
+        row.receiveAttachmentPath === null ||
+        row.receiveAttachmentPath === ''
+      ) {
+        EventBus.$emit(
+          'warning',
+          this.$t('system.noticeCircular.NoInformation')
+        )
+      } else {
+        this.accessoryTFs = true
+      }
+      this.appendixIdss = row.receiveAttachmentPath
     },
+    
+    
+    // 关闭 dialog时 处理文件url 初始化upload组件
     handleExamine(row) {
-      this.$router.push({ path: 'salesContractExamine' })
+      console.log(row)
+      this.$router.push({
+        
+        name: 'salesContractExamine',
+        params: { id: row.id },
+        })
     },
     handleAdd() {
       this.$router.push({ path: 'salesContractAdd' })
     },
+
+  
+    deletecontract(){},
     filtlistQuery() {},
     searchDialog() {},
     vesselIdSelected() {},
@@ -258,6 +436,39 @@ 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.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    }
   },
 }
 </script>
@@ -291,7 +502,6 @@ export default {
     margin: 10px 20px;
     cursor: pointer;
     font-size: 14px;
-
     p {
       margin: 8px 0px;
       span {
@@ -341,6 +551,27 @@ export default {
     }
   }
 }
+.vertical-line {
+  height: 100px;
+  border-left: 2px solid;
+  margin-left: 4px;
+}
+.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;
+}
+
 .box-app {
   display: inline-block;
   float: left;

+ 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>
 

+ 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>