caojunjie 1 éve
szülő
commit
2bfc850831

+ 56 - 6
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation/precontainers.vue

@@ -28,7 +28,9 @@
                    :disabled="seeDisabled"
                    @click.stop="handleDelete">删 除
         </el-button>
-        <el-button type="success" size="small" plain @click.stop="equalDistribution">均分箱量</el-button>
+        <el-button type="success" size="small" plain :disabled="seeDisabled"
+                   @click.stop="equalDistribution">均分箱量
+        </el-button>
       </template>
         <template slot-scope="scope" slot="menu">
             <el-button
@@ -283,6 +285,13 @@
                 });
                 return
             }
+            if (this.assemblyForm.preContainersList <= 0) {
+                this.$message({
+                    type: "warning",
+                    message: "请先添加箱型数据!"
+                });
+                return
+            }
             this.$confirm("确定平均分配?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -297,11 +306,52 @@
                   pid:this.assemblyForm.id,
                   waitingBox:this.assemblyForm.waitingBoxList[0]
               }).then(res=>{
-                  this.$message({
-                      type: "success",
-                      message: "操作成功!"
-                  })
-                  this.billsDetailfun()
+                  if (res.data.data instanceof Array) {
+                      this.$message({
+                          type: "success",
+                          message: "操作成功!"
+                      })
+                      this.billsDetailfun()
+                  }else {
+                      // 没有除开
+                      this.$message({
+                          type:'warning',
+                          dangerouslyUseHTMLString: true,
+                          message: '<table border="1">\n' +
+                              '  <thead>\n' +
+                              '    <tr>\n' +
+                              '      <th></th>\n' +
+                              '      <th>件数</th>\n' +
+                              '      <th>毛重</th>\n' +
+                              '      <th>尺码</th>\n' +
+                              '    </tr>\n' +
+                              '  </thead>\n' +
+                              '  <tbody>\n' +
+                              '    <tr>\n' +
+                              '      <td>总数</td>\n' +
+                              '      <td>'+ res.data.data.total.quantity +'</td>\n' +
+                              '      <td>'+ res.data.data.total.grossWeight +'</td>\n' +
+                              '      <td>'+ res.data.data.total.grossWeight +'</td>\n' +
+                              '    </tr>\n' +
+                              '    <tr>\n' +
+                              '      <td>入箱</td>\n' +
+                              '      <td>'+ res.data.data.average.quantity +'</td>\n' +
+                              '      <td>'+ res.data.data.average.grossWeight +'</td>\n' +
+                              '      <td>'+ res.data.data.average.grossWeight +'</td>\n' +
+                              '    </tr>\n' +
+                              '    <tr>\n' +
+                              '      <td>差额</td>\n' +
+                              '      <td>'+ res.data.data.subtract.quantity +'</td>\n' +
+                              '      <td>'+ res.data.data.subtract.grossWeight +'</td>\n' +
+                              '      <td>'+ res.data.data.subtract.grossWeight +'</td>\n' +
+                              '    </tr>\n' +
+                              '  </tbody>\n' +
+                              '</table>',
+                          duration:5000
+                      });
+
+                  }
+
               })
           },
         // 选择框的回调

+ 227 - 199
src/views/iosBasicData/SeafreightExportF/bills/assembly/filescenter.vue

@@ -2,7 +2,7 @@
   <basic-container>
     <avue-crud :option="option"
                :table-loading="loading"
-               :data="data"
+               :data="assemblyForm.filesList"
                :page.sync="page"
                :permission="permissionList"
                :before-open="beforeOpen"
@@ -19,32 +19,154 @@
                @current-change="currentChange"
                @size-change="sizeChange"
                @refresh-change="refreshChange"
-               @on-load="onLoad">
+               @on-load="onLoad" >
       <template slot="menuLeft">
+        <el-button type="primary"
+                   size="small"
+                   icon="el-icon-plus"
+                   plain
+                   :disabled="!assemblyForm.id"
+                   @click="addBtnfun">新 增
+        </el-button>
         <el-button type="danger"
                    size="small"
                    icon="el-icon-delete"
                    plain
-                   v-if="permission.filescenter_delete"
                    @click="handleDelete">删 除
         </el-button>
       </template>
+        <template slot="menu" slot-scope="{ row, index }">
+            <el-button size="small" icon="el-icon-delete" type="text"
+                       @click="rowDel(row, index)">预 览
+            </el-button>
+            <el-button v-if="row.edit" size="small" icon="el-icon-edit" type="text"
+                       @click="rowCell(row, index)">保 存
+            </el-button>
+            <el-button v-else size="small" icon="el-icon-edit" type="text"
+                       @click="rowEdit(row, index)">修 改
+            </el-button>
+            <el-button size="small" icon="el-icon-delete" type="text"
+                       @click="rowDel(row, index)">删 除
+            </el-button>
+        </template>
+
+      <template slot-scope="scope" slot="serialNo">
+          <el-input v-if="scope.row.edit" type="age" style="width: 100%;" v-model="scope.row.serialNo"
+                    size="small" autocomplete="off"
+                    :disabled="detailData.seeDisabled"
+                    clearable placeholder="请输入自定义序号" ></el-input>
+          <span v-else>{{scope.row.serialNo}}</span>
+      </template>
+        <template slot="url" slot-scope="scope">
+            <el-input
+                v-if="scope.row.edit"
+                v-model="scope.row.url"
+                style="width: 80%"
+                size="small"
+            >
+            </el-input>
+            <el-button
+                style="width: 20%"
+                size="small"
+                v-if="scope.row.edit"
+                @click="uploadFiles(scope.row,scope.index)"
+            >
+                附件
+            </el-button>
+            <span v-else>{{ scope.row.url }}</span>
+        </template>
+        <template slot-scope="scope" slot="isImage">
+            <el-select v-if="scope.row.edit" v-model="scope.row.isImage" size="small" placeholder="请选择">
+                <el-option
+                    v-for="item in isImageData"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                </el-option>
+            </el-select>
+            <span v-else>{{scope.row.isImage?'是':'否'}}</span>
+        </template>
+        <template slot-scope="scope" slot="remarks">
+            <el-input
+                v-if="scope.row.edit"
+                v-model="scope.row.remarks"
+                size="small"
+            >
+            </el-input>
+            <span v-else>{{scope.row.remarks}}</span>
+        </template>
     </avue-crud>
+
+      <el-dialog
+          title="上传附件"
+          append-to-body
+          :visible.sync="excelBox"
+          width="555px"
+          v-dialog-drag
+          placeholder="请输入"
+      >
+          <avue-form
+              :option="excelOption"
+              v-model="excelForm"
+              table-loading="excelLoading"
+              :upload-before="uploadBefore"
+              :upload-after="uploadAfter"
+          >
+          </avue-form>
+      </el-dialog>
+
   </basic-container>
 </template>
 
 <script>
   import {filescenterList, filescenterDetail, filescenterSubmit, filescenterRemove} from "@/api/iosBasicData/filescenter";
   import {mapGetters} from "vuex";
+  import {requiredMessage} from "@/util/messageReminder";
 
   export default {
       props:{
           detailData:{
               type:Boolean
-          }
+          },
+          assemblyForm:{
+              type:Object
+          },
       },
     data() {
       return {
+          // 上传附件弹窗
+          excelBox:false,
+          selectIndex:null,
+          excelForm: {},
+          excelOption: {
+              submitBtn: false,
+              emptyBtn: false,
+              column: [
+                  {
+                      label: "附件上传",
+                      prop: "excelFile",
+                      type: "upload",
+                      drag: true,
+                      dataType: "string",
+                      loadText: "模板上传中,请稍等",
+                      span: 24,
+                      propsHttp: {
+                          res: "data",
+                          url: "link"
+                      },
+                      action: "/api/blade-resource/oss/endpoint/put-file"
+                  }
+              ]
+          },
+          // 是否图片
+          isImageData: [{
+              label: '否',
+              value: 0
+          }, {
+              label: '是',
+              value: 1
+          }],
+
         form: {},
         query: {},
         loading: true,
@@ -65,34 +187,13 @@
           viewBtn: true,
           selection: true,
           dialogClickModal: false,
+          cellBtn:true, // 行编辑
           column: [
-            {
-              label: "业务类型",
-              prop: "businessType",
-              rules: [{
-                required: true,
-                message: "请输入业务类型",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "类别",
-              prop: "classifyCode",
-              rules: [{
-                required: true,
-                message: "请输入类别",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "组别",
-              prop: "groupCode",
-              rules: [{
-                required: true,
-                message: "请输入组别",
-                trigger: "blur"
-              }]
-            },
+            // {
+            //   label: "业务类型",
+            //   prop: "businessType",
+            //   cell: true,
+            // },
             // {
             //   label: "主表 Id",
             //   prop: "pid",
@@ -111,196 +212,55 @@
             //     trigger: "blur"
             //   }]
             // },
-            // {
-            //   label: "自定义序号",
-            //   prop: "serialNo",
-            //   rules: [{
-            //     required: true,
-            //     message: "请输入自定义序号",
-            //     trigger: "blur"
-            //   }]
-            // },
-            {
-              label: "业务编号",
-              prop: "billNo",
-              rules: [{
-                required: true,
-                message: "请输入业务编号",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "MB/L NO",
-              prop: "mblno",
-              rules: [{
-                required: true,
-                message: "请输入MB/L NO",
-                trigger: "blur"
-              }]
-            },
             {
-              label: "HB/L NO",
-              prop: "hblno",
-              rules: [{
-                required: true,
-                message: "请输入HB/L NO",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "文件接收日期",
-              prop: "receivedData",
-                width:"120",
-              rules: [{
-                required: true,
-                message: "请输入文件接收日期",
-                trigger: "blur"
-              }]
+              label: "自定义序号",
+              prop: "serialNo",
+                width: "100"
             },
+            // {
+            //   label: "业务编号",
+            //   prop: "billNo",
+            // },
+            // {
+            //   label: "MB/L NO",
+            //   prop: "mblno",
+            // },
+            // {
+            //   label: "HB/L NO",
+            //   prop: "hblno",
+            // },
             {
               label: "文件名",
               prop: "fileName",
-              rules: [{
-                required: true,
-                message: "请输入文件名",
-                trigger: "blur"
-              }]
             },
             {
               label: "文件扩展名",
               prop: "fileExt",
                 width:"120",
-              rules: [{
-                required: true,
-                message: "请输入文件扩展名",
-                trigger: "blur"
-              }]
             },
             {
               label: "文件地址",
               prop: "url",
-              rules: [{
-                required: true,
-                message: "请输入文件地址",
-                trigger: "blur"
-              }]
+                width: "400"
             },
             {
               label: "是否图片",
               prop: "isImage",
-              rules: [{
-                required: true,
-                message: "请输入是否图片(0 否 1是)",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "缩略图 64*64 文件地址",
-              prop: "thumbnailSmall",
-                width:"160",
-              rules: [{
-                required: true,
-                message: "请输入缩略图 64*64 文件地址",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "缩略图 128*128 文件地址",
-              prop: "thumbnailMiddle",
-                width:"170",
-              rules: [{
-                required: true,
-                message: "请输入缩略图 128*128 文件地址",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "缩略图 256*256 文件地址",
-              prop: "thumbnailLarge",
-                width:"170",
-              rules: [{
-                required: true,
-                message: "请输入缩略图 256*256 文件地址",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "缩略图 512*512 文件地址",
-              prop: "thumbnailHuge",
-                width:"170",
-              rules: [{
-                required: true,
-                message: "请输入缩略图 512*512 文件地址",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "参考1",
-              prop: "reference1",
-              rules: [{
-                required: true,
-                message: "请输入参考1",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "参考2",
-              prop: "reference2",
-              rules: [{
-                required: true,
-                message: "请输入参考2",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "参考3",
-              prop: "reference3",
-              rules: [{
-                required: true,
-                message: "请输入参考3",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "参考4",
-              prop: "reference4",
-              rules: [{
-                required: true,
-                message: "请输入参考4",
-                trigger: "blur"
-              }]
             },
+              {
+                  label: "文件接收日期",
+                  prop: "receivedData",
+                  width:"120",
+              },
             // {
             //   label: "排序",
             //   prop: "sort",
-            //   rules: [{
-            //     required: true,
-            //     message: "请输入排序",
-            //     trigger: "blur"
-            //   }]
-            // },
-            // {
-            //   label: "是否已删除(0 否 1是)",
-            //   prop: "isDeleted",
-            //   rules: [{
-            //     required: true,
-            //     message: "请输入是否已删除(0 否 1是)",
-            //     trigger: "blur"
-            //   }]
-            // },
-            // {
-            //   label: "状态(0 正常 1停用)",
-            //   prop: "status",
-            //   rules: [{
-            //     required: true,
-            //     message: "请输入状态(0 正常 1停用)",
-            //     trigger: "blur"
-            //   }]
-            // },
-            // {
-            //   label: "备注",
-            //   prop: "remarks",
             // },
+            {
+              label: "备注",
+              prop: "remarks",
+            },
+
           ]
         },
         data: []
@@ -310,7 +270,7 @@
       ...mapGetters(["permission"]),
       permissionList() {
         return {
-          // addBtn: this.vaildData(this.permission.filescenter_add, false),
+          addBtn: this.vaildData(this.permission.filescenter_add, false),
           viewBtn: this.vaildData(this.permission.filescenter_view, false),
           delBtn: this.vaildData(this.permission.filescenter_delete, false),
           editBtn: this.vaildData(this.permission.filescenter_edit, false)
@@ -325,6 +285,74 @@
       }
     },
     methods: {
+          // 新增
+        addBtnfun(){
+            this.assemblyForm.filesList.push({
+                edit:true
+            })
+            // this.$refs.crud.rowAdd()
+        },
+        // 点击附件按钮
+        uploadFiles(row,index){
+            this.selectIndex = index
+            this.excelBox = true
+        },
+        uploadBefore(file, done, loading) {
+            done();
+            loading = true;
+        },
+        uploadAfter(res, done, loading, column) {
+            this.excelBox = false;
+            this.$message.success("上传成功!");
+            this.$set(this.assemblyForm.filesList[this.selectIndex],'url',res.link)
+            this.$set(this.assemblyForm.filesList[this.selectIndex],'fileName',res.originalName)
+            this.$set(this.assemblyForm.filesList[this.selectIndex],'fileExt',res.originalName)
+            loading = false;
+            done();
+        },
+        // 编辑
+        rowEdit(row,index) {
+            this.$set(row,'edit',true)
+        },
+        // 保存
+        rowCell(row,index){
+            // 需要加判断是否必填的数据
+            const messageData = [
+                {
+                    name:'自定义序号',
+                    value:'serialNo',
+                },
+                {
+                    name:'文件地址',
+                    value:'url',
+                },
+            ]
+            // 保存
+            if (!requiredMessage(row,messageData)){
+                return
+            }
+            row.sort = index
+            row.businessType = 'SE'
+            row.pid = this.assemblyForm.id
+            row.hblno = this.assemblyForm.hblno
+            row.mblno = this.assemblyForm.mblno
+            row.serialNo = Number(row.serialNo)
+            // 保存接口
+            this.filescenterSubmitfun(row)
+        },
+        // 保存接口
+        filescenterSubmitfun(row){
+            console.log(row,337)
+            filescenterSubmit(row).then(res=>{
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+                // 编辑
+                this.$set(row,'edit',row.edit)
+            })
+        },
+
       rowSave(row, done, loading) {
         filescenterSubmit(row).then(() => {
           this.onLoad(this.page);

+ 24 - 6
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -284,6 +284,7 @@ import {dateFormat} from "@/util/date";
                     numberOfCopy:'ONE', // 副本份数 默认 ONE
                     seaType:'E', // 进出口 默认出口 E=出口 I=进口"
                     cargoType:'dry', // 货物类型默认普货
+                    filesList:[], // 文件中心
                 },
                 basicData:{
                     column:[
@@ -762,14 +763,20 @@ import {dateFormat} from "@/util/date";
             },
             // 申请B/L NO
             billsGetBillNofun(){
+                let billNoFormat = ''
+                if (this.form.cargoType == 'dry') {
+                    billNoFormat = 'HYCK-PH'
+                }else if (this.form.cargoType == 'danger') {
+                    billNoFormat = 'HYCK-WXP'
+                }else if (this.form.cargoType == 'reefer') {
+                    billNoFormat = 'HYCK-DG'
+                }else {}
                 billsGetBillNo({
-                    businessType:this.form.businessType,
-                    seaType:this.form.seaType,
-                    billType:this.form.businessType,
-                    corpCode:this.form.corpCode,
+                    businessTypeCode:'HYCK',
+                    billNoFormat:billNoFormat
                 }).then(res=>{
                     this.columnforfun('hpaymode').disabled = false
-                    this.form.hblno = res.data.data
+                    this.$set(this.form,'hblno',res.data.data)
                 })
             },
             /* 远程模糊查询操作用户 */
@@ -941,6 +948,13 @@ import {dateFormat} from "@/util/date";
                     });
                     return
                 }
+                if (this.form.hblno) {
+                    this.$message({
+                        message: 'B/L NO 只能申请一次',
+                        type: 'warning'
+                    });
+                    return
+                }
                 if (!this.form.businessType) {
                     this.$message({
                         message: '请先选择业务类型',
@@ -998,7 +1012,7 @@ import {dateFormat} from "@/util/date";
             // 主表保存接口大保存
             billsSubmitfun(){
                 this.form.billNoFormat = 'HYCK'
-                this.form.businessTypeId = '1714186930489712641'
+                this.form.businessTypeCode = 'HYCK'
                 // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
                 this.searchSplit()
                 // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
@@ -1054,6 +1068,10 @@ import {dateFormat} from "@/util/date";
                     }
                     item.edit = false
                 }
+                // 文件中心
+                for(let item of this.form.filesList) {
+                    this.$set(item,'edit',false)
+                }
 
             },
             // 下拉 把拼接的拆分