Browse Source

【申报要素】查询

liangyan0105 2 years ago
parent
commit
492fbbf374

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 NODE_ENV=development
-VUE_APP_API_BASE_URL=http://localhost:8080/jeecg-boot
+VUE_APP_API_BASE_URL=http://106.15.206.14:8090/jeecg-boot
 VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
 VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview
 

+ 7 - 1
src/api/document/shipmentList.js

@@ -20,7 +20,13 @@ const deleteShipment = params => deleteAction('/shippingDetails/syShippingDetail
 // 提交
 const submitShipment = params => postAction('/shippingDetails/syShippingDetails/syShippingDetailsSubmit', params)
 
+// 申报要素查询
+const queryDeclarationElements = params => getAction('/shippingDetails/syShippingDetails/queryDeclarationElements', params)
+
+// 新增报关要素(保存)  文档上显示 为 get
+const syDeclarationElementsAdd = params => postAction('/shippingDetails/syShippingDetails/syDeclarationElementsAdd', params)
+
 // 参照订单数据
 const queryOrderData = params => getAction('/shippingDetails/syShippingDetails/queryOrderData', params)
 
-export { shipmentList, addShipmentList, deleteShipment, submitShipment, queryOrderData, shipmentQueryById, editById }
+export { shipmentList, addShipmentList, deleteShipment, submitShipment, queryOrderData, shipmentQueryById, editById, queryDeclarationElements, syDeclarationElementsAdd }

+ 2 - 1
src/views/shipment-details/addShipDetDrawer.vue

@@ -111,6 +111,7 @@
               <template slot="isTC" slot-scope="text, record, index">
                 <a-form-model-item prop="isTc">
                   <a-select v-model="record.isTC">
+                    <a-select-option value="">请选择</a-select-option>
                     <a-select-option :value="1">是</a-select-option>
                     <a-select-option :value="0">否</a-select-option>
                   </a-select>
@@ -442,7 +443,7 @@ export default {
     // 参照订单数据
     referOrderDataOpen() {
       this.$refs.referOrderDataModal.referOrderDataModVis = true
-      // console.log('点击参照订单数据')
+      console.log('点击参照订单数据')
     },
     // 新增 保存
     addSave() {

+ 84 - 52
src/views/shipment-details/declareElementsModal.vue

@@ -6,30 +6,32 @@
       v-model="declareElementsModVis"
       :confirmLoading="confirmLoading"
       @cancel="handleCancel"
-      width="86%"
+      width="60%"
+      keyboard="false"
+      destroyOnClose="true"
+      maskClosable="false"
       style="top:330px;left:100px;"
     >
-      <!-- 主表信息 填写  -->
+      <!-- 主表信息 回显  -->
       <a-card :bordered="false">
         <div class="table-page-search-wrapper">
           <a-form-model layout="inline" ref="form" :model="declareElements">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
-                <!-- required必填项 disabled 禁用  -->
                 <a-form-model-item label="报关品名" prop="declarationName">
-                  <a-input placeholder="请输入报关品名" v-model="declareElements.declarationName"></a-input>
+                  {{ declareElements.declarationName }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="HS code" prop="HScode">
-                  <a-input placeholder="请输入HS code" v-model="declareElements.HScode"></a-input>
+                <a-form-model-item label="HSCODE" prop="hsCode">
+                  {{ declareElements.hsCode }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="英文品名" prop="customer">
-                  <a-input placeholder="请输入英文品名" v-model="declareElements.englishName"></a-input>
+                <a-form-model-item label="英文品名" prop="englishProductName">
+                  {{ declareElements.englishProductName }}
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -37,10 +39,12 @@
         </div>
       </a-card>
 
-      <!-- 子表 -->
+      <!-- 増行 子表 -->
       <a-card :bordered="false" style="margin:10px 0">
-        <!-- 増行  -->
-        <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin:10px 0;">増行</a-button>
+        <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin:10px 0;">
+          増行
+        </a-button>
+        <!-- 子表 -->
         <a-spin :spinning="confirmLoading">
           <a-form-model ref="formRef">
             <a-table
@@ -52,10 +56,28 @@
               :loading="loading"
               :pagination="false"
             >
+              <!-- 类型 下拉选择 -->
+              <template slot="typeValueSlot" slot-scope="text, record, index">
+                <a-form-model-item prop="typeValue">
+                  <a-select v-model="record.typeValue" style="width:100%">
+                    <a-select-option value="">请选择</a-select-option>
+                    <a-select-option :value="0">品名</a-select-option>
+                    <a-select-option :value="1">织造方法(针织或钩编)</a-select-option>
+                    <a-select-option :value="2">种类(西服、便服套装、上衣、长裤、马裤、工装裤等)</a-select-option>
+                    <a-select-option :value="3">类别(女式)</a-select-option>
+                    <a-select-option :value="4">成分含量</a-select-option>
+                    <a-select-option :value="5">品牌</a-select-option>
+                    <a-select-option :value="6">货号</a-select-option>
+                    <a-select-option :value="7">品牌类型</a-select-option>
+                    <a-select-option :value="8">出口享惠情况</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </template>
+
               <!-- 描述 输入框-->
-              <template slot="description" slot-scope="text, record, index">
-                <a-form-model-item prop="description">
-                  <a-input style="width:100%" type="text" v-model="record.description" />
+              <template slot="describeText" slot-scope="text, record, index">
+                <a-form-model-item prop="describeText">
+                  <a-input style="width:100%" type="text" v-model="record.describeText" />
                 </a-form-model-item>
               </template>
 
@@ -69,28 +91,29 @@
           </a-form-model>
         </a-spin>
       </a-card>
+    </a-modal>
 
-      <!-- 页面底部保存取消 -->
-      <div
-        :style="{
-          position: 'absolute',
-          right: 0,
-          bottom: 0,
-          width: '100%',
-          borderTop: '1px solid #e9e9e9',
-          padding: '10px 16px',
-          background: '#fff',
-          textAlign: 'right',
-          zIndex: 1
-        }"
-      >
-        <a-popconfirm title="确定放弃?" @confirm="handleCancel" okText="确定" cancelText="取消">
-          <a-button :style="{ marginRight: '8px' }">返回</a-button>
-        </a-popconfirm>
-        <a-button type="primary" @click="addSave">
-          保存
-        </a-button>
-      </div>
+    <!-- 页面底部保存取消 -->
+    <div
+      :style="{
+        position: 'absolute',
+        right: 0,
+        bottom: 0,
+        width: '100%',
+        borderTop: '1px solid #e9e9e9',
+        padding: '10px 16px',
+        background: '#fff',
+        textAlign: 'right',
+        zIndex: 1
+      }"
+    >
+      <a-popconfirm title="确定放弃?" @confirm="handleCancel" okText="确定" cancelText="取消">
+        <a-button :style="{ marginRight: '8px' }">返回</a-button>
+      </a-popconfirm>
+      <a-button type="primary" @click="addSave">
+        保存
+      </a-button>
+    </div>
     </a-modal>
   </div>
 </template>
@@ -106,29 +129,33 @@ export default {
   components: { JEllipsis, moment },
 
   data() {
-    // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
+    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
 
     return {
       loading: false, // 表格加载
-      // 表头
+      // 子表表头
       declareElementsColumns: [
         {
           title: '序号',
-          width: 90,
+          width: 30,
           dataIndex: 'index',
           customRender: (text, record, index) => `${index + 1}`,
           className: 'replacecolor'
         },
         {
           title: '类型',
-          dataIndex: 'decEleContent',
-          width: 90,
+          dataIndex: 'typeValue',
+          width: 80,
+          scopedSlots: { customRender: 'typeValueSlot' },
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '描述',
-          dataIndex: 'desc',
-          width: 160,
+          dataIndex: 'describeText',
+          width: 80,
+          scopedSlots: { customRender: 'describeText' },
+          customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
 
@@ -136,14 +163,14 @@ export default {
           title: '操作',
           dataIndex: 'operation',
           scopedSlots: { customRender: 'operationSlot' },
-          width: 120,
+          width: 30,
           className: 'replacecolor'
         }
       ],
-      declareElementsData: [{}, {}],
+      declareElements: {}, // 主表信息
+      declareElementsData: [], // 子表信息
       confirmLoading: false,
-      declareElementsModVis: false,
-      declareElements: {} // 申报要素对象
+      declareElementsModVis: false
     }
   },
   // 接收父组件 方法
@@ -156,8 +183,8 @@ export default {
       console.log('増行')
       const addrow = {
         index: '',
-        type: '',
-        description: '',
+        typeValue: '',
+        describeText: '',
         operation: ''
       }
       this.declareElementsData.push(addrow)
@@ -165,15 +192,20 @@ export default {
     // 报关要素 保存
     addSave() {
       console.log('点击报关要素对话框 保存')
-      // var newDeclareElement = {} // 新增对象
+      // var newChild = {} // 新增子表
       // newDeclareElement.documentNo = this.addShipDet.documentNo // 单据号
-          this.close()
-          // 刷新
+      this.close()
+      // 刷新
+    },
+    handletypeValue(e) {
+      console.log('类型下拉菜单click', e)
     },
-
     close() {
       this.$emit('close')
       this.declareElementsModVis = false
+      this.declareElements = {}
+      // this.declareElementsData = []
+      console.log('清空')
     },
     handleCancel() {
       this.close()

+ 2 - 2
src/views/shipment-details/referOrderDataModal.vue

@@ -325,11 +325,11 @@ export default {
     getOrderList() {
       this.$nextTick(() => {
         queryOrderData(this.queryParam).then(res => {
-          // console.log('参照订单数据res', res)
+          console.log('参照订单数据res', res)
           if (res.success) {
             // 后台数据赋值给参照订单数据
             this.orderListData = res.result.records
-            // console.log('参照订单数据', this.orderListData)
+            console.log('参照订单数据', this.orderListData)
             this.pagination = {
               total: res.result.total,
               current: res.result.current,

+ 26 - 12
src/views/shipment-details/shipmentList.vue

@@ -184,7 +184,13 @@ import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
 import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
 import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
 import declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
-import { shipmentList, deleteShipment, submitShipment, shipmentQueryById } from '@api/document/shipmentList'
+import {
+  shipmentList,
+  deleteShipment,
+  submitShipment,
+  shipmentQueryById,
+  queryDeclarationElements
+} from '@api/document/shipmentList'
 
 export default {
   name: 'ShipmentList', // 发运明细列表
@@ -468,9 +474,17 @@ export default {
     // --------------------------------------
     // 操作 申报要素
     declareElements(record) {
-      console.log('点击申报要素id', record.id)
-      console.log('点击申报要素,打开弹框')
+      // console.log('点击申报要素hsCode', record.hsCode)
       this.$refs.declareElementsModal.declareElementsModVis = true
+      queryDeclarationElements({ hsCode: record.hsCode }).then(res => {
+        if (res.success) {
+          console.log('申报要素主子表数据', res.result)
+          // console.log('申报要素子表数据', res.result.syDeclarationElementsItemList)
+          this.$refs.declareElementsModal.declareElements = res.result
+          // 子表赋值
+          this.$refs.declareElementsModal.declareElementsData = res.result.syDeclarationElementsItemList
+        }
+      })
     },
 
     // 操作 详情
@@ -493,8 +507,7 @@ export default {
       shipmentQueryById({ id: record.id }).then(res => {
         if (res.success) {
           console.log('编辑对象', res.result)
-          console.log('子表信息', res.result.syShippingDetailsItemList)
-          // 把通过id查询到的对象,赋值给子组件
+          // console.log('子表信息', res.result.syShippingDetailsItemList)
           this.$refs.editShipDetDrawer.editShipDet = res.result
           this.$refs.editShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
         }
@@ -503,14 +516,15 @@ export default {
     // 操作 提交
     submit(record) {
       console.log('点击id:', record.id)
-      this.$nextTick(() => {
-        submitShipment({ id: record.id }).then(res => {
-          if (res.success) {
-            this.getShipmentList() // 渲染 发运明细列表
-            this.$message.success('提交成功')
-          }
-        })
+      // this.$nextTick(() => {
+      submitShipment({ id: record.id }).then(res => {
+        if (res.success) {
+          console.log('提交成功,推送状态要修改')
+          this.getShipmentList() // 渲染 发运明细列表
+          this.$message.success('提交成功')
+        }
       })
+      // })
     },
 
     // 操作 推送