Переглянути джерело

发运明细 补充缺少字段

liangy 3 роки тому
батько
коміт
fc19a7d62a

+ 33 - 26
src/views/shipment-details/addShipDetDrawer.vue

@@ -115,17 +115,23 @@
                 </a-form-model-item>
               </a-col> -->
 
-              <!-- <a-col :md="6" :sm="8">
+              <a-col :md="6" :sm="8">
                 <a-form-model-item label="中文品名" prop="chineseName">
                   <a-input placeholder="请输入中文品名" v-model="addShipDet.chineseName"></a-input>
                 </a-form-model-item>
               </a-col>
-
+          
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="英文品名" prop="englishName">
-                  <a-input placeholder="请输入英文品名" v-model="addShipDet.englishName"></a-input>
+                <a-form-model-item label="英文品名" prop="englishProductName">
+                  <a-input placeholder="请输入英文品名" v-model="addShipDet.englishProductName"></a-input>
                 </a-form-model-item>
-              </a-col> -->
+              </a-col> 
+
+                 <a-col :md="6" :sm="8">
+                <a-form-model-item label="报关品名" prop="declarationName">
+                  <a-input placeholder="请输入报关品名" v-model="addShipDet.declarationName"></a-input>
+                </a-form-model-item>
+              </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="成衣工厂" prop="garmentFactory">
@@ -238,17 +244,17 @@
                 </a-form-model-item>
               </template>
                 <!-- 中文品名 :rules="rules.chineseName"-->
-               <template slot="chineseName" slot-scope="text, record, index">
+               <!-- <template slot="chineseName" slot-scope="text, record, index">
                 <a-form-model-item prop="chineseName">
                   <a-input style="width:100%" type="text" v-model="record.chineseName" />
                 </a-form-model-item>
-              </template>
+              </template> -->
                 <!-- 英文品名 :rules="rules.englishName"-->
-               <template slot="englishName" slot-scope="text, record, index">
+               <!-- <template slot="englishName" slot-scope="text, record, index">
                 <a-form-model-item prop="englishName">
                   <a-input style="width:100%" type="text" v-model="record.englishName" />
                 </a-form-model-item>
-              </template>
+              </template> -->
 
               <!-- 操作 -->
               <template slot="operationSlot" slot-scope="text, record, index">
@@ -319,7 +325,7 @@ export default {
       columns: [
         {
           title: '账套',
-          dataIndex: 'pkOrg',
+          dataIndex: 'account',
           width: 80,
           fixed: 'left',
           className: 'replacecolor'
@@ -568,21 +574,21 @@ export default {
           scopedSlots: { customRender: 'declarationElements' },
           className: 'replacecolor'
         },
-         {
-          title: '中文品名',
-          dataIndex: 'chineseName',
-          width: 160,
-          scopedSlots: { customRender: 'chineseName' },
-          className: 'replacecolor'
-        },
+        //  {
+        //   title: '中文品名',
+        //   dataIndex: 'chineseName',
+        //   width: 160,
+        //   scopedSlots: { customRender: 'chineseName' },
+        //   className: 'replacecolor'
+        // },
         
-        {
-          title: '英文品名',
-          dataIndex: 'englishName',
-          width: 160,
-          scopedSlots: { customRender: 'englishName' },
-          className: 'replacecolor'
-        },
+        // {
+        //   title: '英文品名',
+        //   dataIndex: 'englishName',
+        //   width: 160,
+        //   scopedSlots: { customRender: 'englishName' },
+        //   className: 'replacecolor'
+        // },
         {
           title: '价格备注',
           dataIndex: 'priceRemarks',
@@ -663,10 +669,11 @@ export default {
       // newObj.factoryUnitPrice = this.addShipDet.factoryUnitPrice
       // newObj.declarationElements = this.addShipDet.declarationElements
       // newObj.numberOfSets = this.addShipDet.numberOfSets
-      // newObj.chineseName = this.addShipDet.chineseName
-      // newObj.englishName = this.addShipDet.englishName
+       newObj.chineseName = this.addShipDet.chineseName
+       newObj.englishProductName = this.addShipDet.englishProductName
        newObj.garmentFactory = this.addShipDet.garmentFactory
        newObj.hsCode = this.addShipDet.hsCode
+       newObj.declarationName = this.addShipDet.declarationName
       // newObj.customsDeclarationUnitPrice = this.addShipDet.customsDeclarationUnitPrice
 
       newObj.memo = this.addShipDet.memo // U8系统适用

+ 35 - 5
src/views/shipment-details/declareElementsModal.vue

@@ -1,4 +1,5 @@
 <template>
+<!-- 申报要素 -->
   <div id="declareElementsModal">
     <!-- @ok="onSubmit"      keyboard="{false}"
       destroyOnClose="{true}"
@@ -16,6 +17,13 @@
         <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" style="display: none;">
+                <a-form-model-item label="ID" prop="id">
+                  {{ declareElements.id }}
+                </a-form-model-item>
+              </a-col>
+
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="报关品名" prop="declarationName">
                   {{ declareElements.declarationName }}
@@ -81,8 +89,8 @@
               </template>
 
               <!-- 操作 -->
-              <span slot="operationSlot" slot-scope="text, record">
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
+              <span slot="operationSlot" slot-scope="text, record, index">
+                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(index)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
                 </a-popconfirm>
               </span>
@@ -120,6 +128,7 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
+import { syDeclarationElementsAdd } from '@api/document/shipmentList'
 
 export default {
   name: 'DeclareElementsModal', // 报关要素
@@ -133,6 +142,7 @@ export default {
       loading: false, // 表格加载
       // 子表表头
       declareElementsColumns: [
+      
         {
           title: '序号',
           width: 30,
@@ -145,7 +155,7 @@ export default {
           dataIndex: 'typeValue',
           width: 80,
           scopedSlots: { customRender: 'typeValueSlot' },
-          customRender: t => ellipsis(t),
+          // customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
@@ -153,7 +163,7 @@ export default {
           dataIndex: 'describeText',
           width: 80,
           scopedSlots: { customRender: 'describeText' },
-          customRender: t => ellipsis(t),
+        
           className: 'replacecolor'
         },
 
@@ -190,13 +200,33 @@ export default {
     // 报关要素 保存
     addSave() {
       console.log('点击报关要素对话框 保存')
-      // var newChild = {} // 新增子表
+      var newObj = {} // 新增主表
+      newObj.id = this.declareElements.id
+      newObj.declarationName = this.declareElements.declarationName //报关品名
+      newObj.hsCode = this.declareElements.hsCode //报关品名
+      newObj.englishProductName = this.declareElements.englishProductName //英文品名
+      // 新增子表
+      newObj.syDeclarationElementsItemList = this.declareElementsData
       // newDeclareElement.documentNo = this.addShipDet.documentNo // 单据号
+      syDeclarationElementsAdd(newObj).then(res => {
+          if (res.success) {
+            this.$message.success('新增成功')
+            console.log('新增的对象', newObj)
+            this.close()
+        
+          }
+        })
       this.close()
       // 刷新
     },
     handletypeValue(e) {
       console.log('类型下拉菜单click', e)
+    },
+     // 操作 删除
+    handleDelete(index) {
+      console.log('index', index)
+      console.log('删除报关要素数据', index)
+      return this.declareElementsData.splice(index, 1)
     },
     close() {
       this.$emit('close')