chris před 3 roky
rodič
revize
016e4bf10c

+ 6 - 3
src/views/modules/cus/contract-record-add-or-update.vue

@@ -95,6 +95,9 @@
                 header-align="center"
                 align="center"
                 label="税率">
+                <template slot-scope="scope">
+                  <span>{{scope.row.rate}}</span>&nbsp;%
+                </template>
               </el-table-column>
               <el-table-column
                 prop="notes"
@@ -128,7 +131,7 @@
           <el-button @click="onChose">取消</el-button>
           <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
         </span>
-      <add-or-update-product v-if="productUpdateVisible" ref="productDialog"/>
+      <add-or-update-product v-if="productUpdateVisible" ref="productDialog" @changeItem="changeItem"/>
       <template-chose v-if="inboundVisible" ref="inbound" @addItems="addItems" />
     </div>
 </template>
@@ -286,9 +289,9 @@ export default {
         this.productUpdateVisible = false
         let i = this.dataForm.cusCBookProducts.findIndex((item1) => item1.productId === item.productId)
         if (i > -1) {
-          this.productList.splice(i)
+          this.dataForm.cusCBookProducts.splice(i)
         }
-        this.productList.push(item)
+        this.dataForm.cusCBookProducts.push(item)
       },
       addItem (item) {
         if (!item) return

+ 138 - 0
src/views/modules/cus/contract-record-detail.vue

@@ -0,0 +1,138 @@
+<template>
+  <div>
+    <div class="my-title">查看</div>
+    <div style="margin-left: 20px;margin-right: 20px">
+      <e-desc title="基本信息" column="3">
+        <e-desc-item label="合同编码">{{dataForm.contractCode}}</e-desc-item>
+        <e-desc-item label="合同评审编码">{{dataForm.reCode}}</e-desc-item>
+        <e-desc-item label="合同号">{{dataForm.contractNumber}}</e-desc-item>
+        <e-desc-item label="合同交期">{{dataForm.deliveryTime}}</e-desc-item>
+        <e-desc-item label="实际交付日期" span="2">{{dataForm.actualDeliveryTime}}</e-desc-item>
+        <e-desc-item label="备注" span="3">{{dataForm.notes}}</e-desc-item>
+        <e-desc-item v-if="dataForm.attachList" label="附件" span="3">
+          <div v-for="(item, index) in dataForm.attachList" style="display: inline">
+            <span v-if="index > 0">,</span>
+            <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
+          </div>
+        </e-desc-item>
+      </e-desc>
+      <e-desc title="产品列表">
+        <el-table
+          :data="dataForm.cusCBookProducts"
+          border
+          style="width: 100%;">
+          <el-table-column
+            label="序号"
+            type="index"
+            width="50"
+            align="center">
+          </el-table-column>
+          <el-table-column
+            prop="productName"
+            header-align="center"
+            align="center"
+            label="产品名称">
+          </el-table-column>
+          <el-table-column
+            prop="cnt"
+            header-align="center"
+            align="center"
+            label="数量"
+            width="170">
+          </el-table-column>
+          <el-table-column
+            prop="price"
+            header-align="center"
+            align="center"
+            min-width="160"
+            label="含税单价">
+          </el-table-column>
+          <el-table-column
+            prop="amount"
+            header-align="center"
+            align="center"
+            min-width="100"
+            label="含税总价">
+          </el-table-column>
+          <el-table-column
+            prop="rate"
+            header-align="center"
+            align="center"
+            label="税率">
+            <template slot-scope="scope">
+              <span>{{scope.row.rate}}</span>&nbsp;%
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="notes"
+            header-align="center"
+            align="center"
+            min-width="140"
+            :show-tooltip-when-overflow="true"
+            label="备注">
+          </el-table-column>
+        </el-table>
+      </e-desc>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">返回</el-button>
+    </span>
+    <!-- 文件预览 -->
+    <preview-component v-if="previewVisible" ref="preview"/>
+  </div>
+</template>
+
+<script>
+  import EDesc from '../common/e-desc'
+  import EDescItem from '../common/e-desc-item'
+  import { geContractBookDetail } from '@/api/cus'
+  import PreviewComponent from '../common/preview-component'
+  export default {
+    name: 'contract-record-detail',
+    components: {
+      PreviewComponent,
+      EDesc,
+      EDescItem
+    },
+    data () {
+      return {
+        visible: false,
+        previewVisible: false,
+        id: 0,
+        dataForm: {},
+        cusRCommProductVOS: [],
+        fileList: []
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init (id) {
+        this.visible = true
+        this.id = id || 0
+        this.dataForm = {}
+        this.cusRCommProductVOS = []
+        this.fileList = []
+        this.getDetails()
+      },
+      getDetails () {
+        geContractBookDetail(this.id).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+.my-line{
+  border-bottom: 1px solid #c0c4cc;
+  margin-bottom: 10px;
+}
+.title{
+  padding: 10px 0 ;
+}
+</style>

+ 5 - 4
src/views/modules/cus/contract-record.vue

@@ -1,7 +1,7 @@
 <!-- 合同台账 -->
 <template>
   <div class="contract">
-    <template v-if="!addOrUpdateVisible && !changeFormVisible && !attachVisible && !noticeChangeVisible">
+    <template v-if="!detailVisible && !addOrUpdateVisible && !changeFormVisible && !attachVisible && !noticeChangeVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
         <el-form-item label="名称">
           <el-input v-model="dataForm.customerName" placeholder="客户名称" clearable/>
@@ -151,7 +151,7 @@
     </template>
     <!-- 弹窗, 新增 / 修改 -->
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
-<!--    <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>-->
+    <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
 <!--    <crafts-detail v-if="craftsVisible" ref="craftsDetail" @onChose="onChose"/>-->
 <!--    <product-draw-detail v-if="drawVisible" ref="drawDetail" @onChose="onChose"/>-->
 <!--    <attach-detail v-if="changeVisible" ref="changeDetail" @onChose="onChose"/>-->
@@ -163,7 +163,7 @@
 
 <script>
 import AddOrUpdate from './contract-record-add-or-update'
-// import Detail from './product-detail'
+import Detail from './contract-record-detail'
 import { getCusContractBookList } from '@/api/cus'
 // import CraftsDetail from './crafts-detail'
 // import ProductDrawDetail from './product-draw-detail'
@@ -176,7 +176,8 @@ export default {
     AttachDetail,
     // ProductDrawDetail,
     // CraftsDetail,
-    AddOrUpdate
+    AddOrUpdate,
+    Detail
     // Detail,
     // NoticeChangeSetting,
     // ChangeForm