Browse Source

预托书第三版

fenghaifu 2 years ago
parent
commit
80026f5a9d

+ 1 - 1
src/api/document/pre-book.js

@@ -15,7 +15,7 @@ const preBookById = params => getAction('/letterDeposit/syLetterDeposit/queryByI
 const editById = params => postAction('/letterDeposit/syLetterDeposit/edit', params)
 
 //  删除
-const deletePreBook = params => deleteAction('//letterDeposit/syLetterDeposit/delete', params)
+const deletePreBook = params => deleteAction('/letterDeposit/syLetterDeposit/delete', params)
 
 // 提交
 const submit = params => postAction('/letterDeposit/syLetterDeposit/syShippingDetailsSubmit', params)

+ 9 - 2
src/views/pre-book/addPreBookDrawer.vue

@@ -422,6 +422,7 @@ export default {
       validatorRules:{
           shippingOrderDate:[{required: true, message: '托书日期不能为空!'}],
           consignee:[{required: true, message: '收货人不能为空!'}],
+          depositaryReceiptNo:[{required: true, message: '预托书号不能为空!'}],
       },
     }
   },
@@ -471,7 +472,6 @@ export default {
     },
     // 抽屉 取消
     handleCancel() {
-      console.log('点击抽屉取消')
       this.close()
     },
     myHandSave(){
@@ -623,7 +623,14 @@ export default {
     
   },
 
-  mounted() {}
+  mounted() {},
+  // 接收父组件查询方法
+  props: {
+    fatherList: {
+      type: Function,
+      default: null
+    }
+  },
 }
 </script>
 <style lang="less" scoped>

+ 0 - 2
src/views/pre-book/advancePackingListModal.vue

@@ -109,14 +109,12 @@ export default {
           title: '款号',
           dataIndex: 'itemNumber',
           width: 120,
-          fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '客户简称',
           dataIndex: 'customerAbbreviation',
           width: 120,
-          fixed: 'left',
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },

+ 24 - 100
src/views/pre-book/detailsPreBookDrawer.vue

@@ -7,15 +7,16 @@
         <div class="table-page-search-wrapper">
           <a-form-model layout="inline" ref="form" :model="preBook">
             <a-row :gutter="24">
+              
+
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="托书日期" prop="shippingOrderDate">
-                  {{ preBookDetails.shippingOrderDate }}
+                <a-form-model-item label="预托书号" prop="depositaryReceiptNo">
+                  {{ preBookDetails.depositaryReceiptNo }}
                 </a-form-model-item>
               </a-col>
-
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="托书号" prop="shippingOrderNumber">
-                  {{ preBookDetails.shippingOrderNumber }}
+                <a-form-model-item label="托书日期" prop="shippingOrderDate">
+                  {{ preBookDetails.shippingOrderDate }}
                 </a-form-model-item>
               </a-col>
 
@@ -80,8 +81,8 @@
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="运抵国别" prop="billOfLadingOrCarriageReceipt">
-                  {{ preBookDetails.billOfLadingOrCarriageReceipt }}
+                <a-form-model-item label="运抵国别" prop="arriveInCountry">
+                  {{ preBookDetails.arriveInCountry }}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
@@ -114,17 +115,6 @@
                 </a-form-model-item>
               </a-col>
 
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="人民币" prop="cny">
-                  {{ preBookDetails.cny }}
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="美元" prop="usd">
-                  {{ preBookDetails.usd }}
-                </a-form-model-item>
-              </a-col>
             </a-row>
           </a-form-model>
         </div>
@@ -148,34 +138,6 @@
           </a-form-model>
         </a-spin>
 
-        <!-- 人民币、美金 -->
-        <a-row style="marginTop:10px;marginBottom:50px;padding:10px;">
-          <div class="purchase-order-table" style="width:48%;marginRight:4%;float:left;">
-            <h6 class="table-title">人民币</h6>
-            <a-table
-              :row-key="record => record.id"
-              :loading="loading"
-              :columns="CNYColumns"
-              :data-source="CNYData"
-              bordered
-              :pagination="false"
-            >
-            </a-table>
-          </div>
-
-          <div class="purchase-order-table" style="width:48%;float:right;">
-            <h6 class="table-title">美金</h6>
-            <a-table
-              :row-key="record => record.id"
-              :loading="loading"
-              :columns="USDColumns"
-              :data-source="USDData"
-              bordered
-              :pagination="false"
-            >
-            </a-table>
-          </div>
-        </a-row>
       </a-card>
     </a-drawer>
   </div>
@@ -205,7 +167,7 @@ export default {
         },
         {
           title: '款号',
-          dataIndex: 'styleNum',
+          dataIndex: 'itemNumber',
           width: 120,
 
           fixed: 'left',
@@ -213,21 +175,21 @@ export default {
         },
         {
           title: '小po号',
-          dataIndex: 'smallPoNum',
+          dataIndex: 'poNo',
           width: 120,
 
           className: 'replacecolor'
         },
         {
           title: '数量',
-          dataIndex: 'quantity',
+          dataIndex: 'total',
           width: 120,
 
           className: 'replacecolor'
         },
         {
           title: '箱数',
-          dataIndex: 'boxedNum',
+          dataIndex: 'boxNumber',
           width: 90,
 
           className: 'replacecolor'
@@ -235,21 +197,21 @@ export default {
 
         {
           title: '毛重',
-          dataIndex: 'roughWeigh',
+          dataIndex: 'totalGrossWeight',
           width: 120,
 
           className: 'replacecolor'
         },
         {
           title: '净重',
-          dataIndex: 'suttle',
+          dataIndex: 'totalNetWeight',
           width: 120,
 
           className: 'replacecolor'
         },
         {
           title: '体积',
-          dataIndex: 'volume',
+          dataIndex: 'totalVolume',
           width: 160,
 
           className: 'replacecolor'
@@ -271,14 +233,14 @@ export default {
 
         {
           title: '集装箱号',
-          dataIndex: 'containerNo',
+          dataIndex: 'containerNumber',
           width: 120,
           scopedSlots: { customRender: 'containerNo' },
           className: 'replacecolor'
         },
         {
           title: '单价',
-          dataIndex: 'price',
+          dataIndex: 'unitPrice',
           width: 120,
 
           className: 'replacecolor'
@@ -292,6 +254,13 @@ export default {
         //     return moment(text).format('YYYY-MM-DD')
         //   }
         // },
+        {
+          title: '金额',
+          key: 'totalPrice',
+          width: 120,
+
+          className: 'replacecolor'
+        },
         {
           title: '预发货日期',
           dataIndex: 'scheduledShipDate',
@@ -331,51 +300,6 @@ export default {
         }
       ],
       data: [],
-      CNYColumns: [
-        {
-          title: '货代',
-          dataIndex: 'CNYfreighForward',
-          width: 20,
-          className: 'replacecolor'
-        },
-        {
-          title: '金额',
-          dataIndex: 'CNYmoney',
-          width: 20,
-          className: 'replacecolor'
-        },
-        {
-          title: '项目列',
-          dataIndex: 'CNYProjectList',
-          width: 90,
-          scopedSlots: { customRender: 'CNYProjectList' },
-          className: 'replacecolor'
-        }
-      ],
-      CNYData: [],
-
-      USDColumns: [
-        {
-          title: '货代',
-          dataIndex: 'USDfreighForward',
-          width: 20,
-          className: 'replacecolor'
-        },
-        {
-          title: '金额',
-          dataIndex: 'USDmoney',
-          width: 20,
-          className: 'replacecolor'
-        },
-        {
-          title: '项目列',
-          dataIndex: 'USDProjectList',
-          width: 90,
-          scopedSlots: { customRender: 'USDProjectList' },
-          className: 'replacecolor'
-        }
-      ],
-      USDData: [],
 
       loading: false, // 表格加载
       preBook: {},

+ 19 - 25
src/views/pre-book/preBookList.vue

@@ -69,7 +69,7 @@
       <a-table
         bordered
         v-if="preBookListData"
-        rowKey="id"
+        :rowKey=" (row, index) => {return index;}"
         :columns="preBookListColumns"
         :data-source="preBookListData"
         :loading="loading"
@@ -77,12 +77,6 @@
         @change="handleTableChange"
         :scroll="{ x: 1500 }"
       >
-        <!-- 金额 输入框-->
-        <template slot="money" slot-scope="text, record, index">
-          <a-form-model-item prop="money" :rules="rules.money" required>
-            <a-input style="width:100%" type="text" v-model="record.money" />
-          </a-form-model-item>
-        </template>
 
         <!-- 单据状态 -->
         <span slot="documentStateSlot" slot-scope="text, record">
@@ -111,8 +105,7 @@
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
-                </a-popconfirm></a-menu-item
-              >
+                </a-popconfirm></a-menu-item>
             </a-menu>
 
             <!-- 已提交 -->
@@ -130,9 +123,8 @@
     </a-card>
 
     <!-- 抽屉 -->
-    <addPreBook-drawer ref="addPreBookDrawer" :father="aa" @ok="modalFormOk"></addPreBook-drawer>
-    <detailsPreBook-drawer ref="detailsPreBookDrawer" :father="bb" @ok="modalFormOk"></detailsPreBook-drawer>
-    <editPreBook-drawer ref="editPreBookDrawer" :father="cc" @ok="modalFormOk"></editPreBook-drawer>
+    <addPreBook-drawer ref="addPreBookDrawer" :fatherList="getPreBookData" @ok="modalFormOk"></addPreBook-drawer>
+    <detailsPreBook-drawer ref="detailsPreBookDrawer" @ok="modalFormOk"></detailsPreBook-drawer>
   </div>
 </template>
 
@@ -145,7 +137,7 @@ import addPreBookDrawer from '@views/pre-book/addPreBookDrawer.vue'
 import detailsPreBookDrawer from '@views/pre-book/detailsPreBookDrawer.vue'
 import editPreBookDrawer from '@views/pre-book/editPreBookDrawer.vue'
 
-import { preBookList, addPreBook, preBookById, editById } from '@api/document/pre-book.js'
+import { preBookList, addPreBook, preBookById, editById,deletePreBook,submit,cancelSubmit } from '@api/document/pre-book.js'
 
 export default {
   name: 'PreBookList', // 预托书列表
@@ -184,11 +176,10 @@ export default {
         },
         { title: '总箱数', dataIndex: 'boxNumber', width: 120, className: 'replacecolor' },
         { title: '总毛重', dataIndex: 'totalGrossWeight', width: 120, className: 'replacecolor' },
-        { title: '总体积', dataIndex: 'totalVolume', width: 100, className: 'replacecolor' },
+        { title: '总体积', dataIndex: 'totalVolume', width: 150, className: 'replacecolor' },
         {
           title: '金额',
           dataIndex: 'money',
-          scopedSlots: { customRender: 'money' },
           width: 140,
           className: 'replacecolor'
         },
@@ -287,13 +278,14 @@ export default {
       this.$nextTick(() => {
         preBookList(this.queryParam).then(res => {
           if (res.success) {
-            this.preBookListData = res.result.records
-            console.log('预托书列表', this.preBookListData)
+            this.preBookListData = res.result.records;
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
               pageSize: res.result.size
             }
+          }else{
+            this.$message.error(res.message)
           }
         })
       })
@@ -308,7 +300,6 @@ export default {
     //  详情
     details(record) {
       
-      // console.log('点击项的ID', record.id)
       preBookById({ id: record.id }).then(res => {
         if (res.success) {
           // 把通过id查询到的对象,赋值给子组件
@@ -326,9 +317,10 @@ export default {
       
       preBookById({ id: record.id }).then(res => {
         if (res.success) {
+          res.result.consigneeAll = res.result.consignee+"+"+res.result.consigneeAddress+"+"+res.result.notifyParty+"+"+res.result.notifyPartyAddress;
           this.$refs.addPreBookDrawer.addPreBook = res.result;
           this.$refs.addPreBookDrawer.data = res.result.syLetterDepositItemList;
-          this.$refs.editPreBookDrawer.visible = true
+          this.$refs.addPreBookDrawer.visible = true
         }else{
           this.$message.error(res.message)
         }
@@ -337,40 +329,42 @@ export default {
 
     // 操作 提交
     submit(record) {
-      console.log('点击id:', record.id)
       this.$nextTick(() => {
         submit({ id: record.id, type: '1' }).then(res => {
           if (res.success) {
-            console.log('提交成功,单据状态改为【已提交】')
             this.preBookListData.theDocumentsState == '1'
             this.getPreBookData()
             this.$message.success('提交成功')
+          }else{
+            this.$message.error(res.message)
           }
         })
       })
     },
     // 取消提交
     cancel(record) {
-      console.log('取消订单id:', record.id)
       this.$nextTick(() => {
         cancelSubmit({ id: record.id, type: '2' }).then(res => {
           if (res.success) {
-            console.log('取消提交成功,单据状态改为【仅保存】')
             this.preBookListData.theDocumentsState == '0'
             this.getPreBookData()
             this.$message.success('取消提交成功')
+          }else{
+            this.$message.error(res.message)
           }
         })
       })
     },
     //  删除
     handleDelete(record) {
-      console.log('点击删除项id:', record.id)
       this.$nextTick(() => {
         deletePreBook({ id: record.id }).then(res => {
-          console.log('res:', res)
+          if (res.success) {
           this.getPreBookData()
           this.$message.success('删除成功')
+          }else{
+            this.$message.error(res.message)
+          }
         })
       })
     },