|  | @@ -1,98 +1,115 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -  <basic-container>
 | 
	
		
			
				|  |  | -    <avue-crud :option="option"
 | 
	
		
			
				|  |  | -               :table-loading="loading"
 | 
	
		
			
				|  |  | -               :data="assemblyForm.containersList"
 | 
	
		
			
				|  |  | -               :permission="permissionList"
 | 
	
		
			
				|  |  | -               :before-open="beforeOpen"
 | 
	
		
			
				|  |  | -               v-model="form"
 | 
	
		
			
				|  |  | -               id="out-table"
 | 
	
		
			
				|  |  | -               :header-cell-class-name="headerClassName"
 | 
	
		
			
				|  |  | -               ref="crud"
 | 
	
		
			
				|  |  | -               :row-style="{height:'20px'}"
 | 
	
		
			
				|  |  | -               :cell-style="{padding:'0px'}"
 | 
	
		
			
				|  |  | -               @row-update="rowUpdate"
 | 
	
		
			
				|  |  | -               @row-save="rowSave"
 | 
	
		
			
				|  |  | -               @row-del="rowDel"
 | 
	
		
			
				|  |  | -               @selection-change="selectionChange"
 | 
	
		
			
				|  |  | -               @refresh-change="refreshChange">
 | 
	
		
			
				|  |  | -      <template slot="menuLeft">
 | 
	
		
			
				|  |  | -        <div style="display: flex;align-items: center;justify-content: space-between">
 | 
	
		
			
				|  |  | -            <div>
 | 
	
		
			
				|  |  | -                <!--<el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>-->
 | 
	
		
			
				|  |  | -                <el-button type="danger" size="small" :disabled="detailData.seeDisabled" @click="revokefun">撤销</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="danger" size="small" :disabled="detailData.seeDisabled" @click="wholeRevokefun">全部撤销</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="warning" size="small" :disabled="detailData.seeDisabled" @click="cleanCntrNofun">清除箱号</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="primary" size="small" :disabled="detailData.seeDisabled" @click="containersSubmitListfun" >批量保存</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="success" size="small" :disabled="detailData.seeDisabled" @click="containersExportContainersfun" >导出导入模板</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="success" size="small" :disabled="detailData.seeDisabled"  >导入箱号,铅封号</el-button>
 | 
	
		
			
				|  |  | +  <div>
 | 
	
		
			
				|  |  | +      <basic-container>
 | 
	
		
			
				|  |  | +          <avue-crud :option="option"
 | 
	
		
			
				|  |  | +                     :table-loading="loading"
 | 
	
		
			
				|  |  | +                     :data="assemblyForm.containersList"
 | 
	
		
			
				|  |  | +                     :permission="permissionList"
 | 
	
		
			
				|  |  | +                     :before-open="beforeOpen"
 | 
	
		
			
				|  |  | +                     v-model="form"
 | 
	
		
			
				|  |  | +                     id="out-table"
 | 
	
		
			
				|  |  | +                     :header-cell-class-name="headerClassName"
 | 
	
		
			
				|  |  | +                     ref="crud"
 | 
	
		
			
				|  |  | +                     :row-style="{height:'20px'}"
 | 
	
		
			
				|  |  | +                     :cell-style="{padding:'0px'}"
 | 
	
		
			
				|  |  | +                     @row-update="rowUpdate"
 | 
	
		
			
				|  |  | +                     @row-save="rowSave"
 | 
	
		
			
				|  |  | +                     @row-del="rowDel"
 | 
	
		
			
				|  |  | +                     @selection-change="selectionChange"
 | 
	
		
			
				|  |  | +                     @refresh-change="refreshChange">
 | 
	
		
			
				|  |  | +              <template slot="menuLeft">
 | 
	
		
			
				|  |  | +                  <div style="display: flex;align-items: center;justify-content: space-between">
 | 
	
		
			
				|  |  | +                      <div>
 | 
	
		
			
				|  |  | +                          <!--<el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>-->
 | 
	
		
			
				|  |  | +                          <el-button type="danger" size="small" :disabled="detailData.seeDisabled" @click="revokefun">撤销</el-button>
 | 
	
		
			
				|  |  | +                          <el-button type="danger" size="small" :disabled="detailData.seeDisabled" @click="wholeRevokefun">全部撤销</el-button>
 | 
	
		
			
				|  |  | +                          <el-button type="warning" size="small" :disabled="detailData.seeDisabled" @click="cleanCntrNofun">清除箱号</el-button>
 | 
	
		
			
				|  |  | +                          <el-button type="primary" size="small" :disabled="detailData.seeDisabled" @click="containersSubmitListfun" >批量保存</el-button>
 | 
	
		
			
				|  |  | +                          <el-button type="success" size="small" :disabled="detailData.seeDisabled || !assemblyForm.id" @click="excelBox = true" >导入箱号,铅封号</el-button>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                          <el-button type="warning" size="small"
 | 
	
		
			
				|  |  | +                                     :disabled="numberfalsefun() || assemblyForm.id"
 | 
	
		
			
				|  |  | +                                     @click="equalDistribution">平均分配</el-button>
 | 
	
		
			
				|  |  | +                      </div>
 | 
	
		
			
				|  |  | +                      <!--<div>-->
 | 
	
		
			
				|  |  | +                      <!--    <el-button size="small">Copy</el-button>-->
 | 
	
		
			
				|  |  | +                      <!--    <el-button size="small">查看箱信息</el-button>-->
 | 
	
		
			
				|  |  | +                      <!--    <el-button size="small">校验箱信息</el-button>-->
 | 
	
		
			
				|  |  | +                      <!--</div>-->
 | 
	
		
			
				|  |  | +                  </div>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="menu">
 | 
	
		
			
				|  |  | +                  <el-button v-if="scope.row.edit" :type="scope.type" :size="scope.size" icon="el-icon-edit"
 | 
	
		
			
				|  |  | +                             @click.stop="rowSavefun(scope.row, scope.index)">保存
 | 
	
		
			
				|  |  | +                  </el-button>
 | 
	
		
			
				|  |  | +                  <el-button v-else :type="scope.type" :size="scope.size" icon="el-icon-edit"
 | 
	
		
			
				|  |  | +                             :disabled="detailData.seeDisabled"
 | 
	
		
			
				|  |  | +                             @click.stop="rowCellfun(scope.row, scope.index)">编辑
 | 
	
		
			
				|  |  | +                  </el-button>
 | 
	
		
			
				|  |  | +                  <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
 | 
	
		
			
				|  |  | +                             :disabled="detailData.seeDisabled"
 | 
	
		
			
				|  |  | +                             @click.stop="rowDel(scope.row, scope.index)">删除
 | 
	
		
			
				|  |  | +                  </el-button>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="cntrNo">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.cntrNo"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入箱号"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.cntrNo}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="sealNo">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.sealNo"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入封号"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.sealNo}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="quantity">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.quantity"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入件数"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{Number(scope.row.quantity).toFixed(2)}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="grossWeight">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.grossWeight"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入毛重"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.grossWeight}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="netWeight">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.netWeight"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入净重"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.netWeight}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="measurement">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.measurement"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入尺码"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.measurement}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="remarks">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.remarks"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入备注"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.remarks}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +              <template slot-scope="scope" slot="marks">
 | 
	
		
			
				|  |  | +                  <el-input v-if="scope.row.edit" v-model="scope.row.marks"
 | 
	
		
			
				|  |  | +                            size="small" clearable placeholder="请输入MARKS"></el-input>
 | 
	
		
			
				|  |  | +                  <span v-else>{{scope.row.marks}}</span>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +          </avue-crud>
 | 
	
		
			
				|  |  | +      </basic-container>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      <el-dialog title="导入箱号,铅封号" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
 | 
	
		
			
				|  |  | +                 v-dialog-drag>
 | 
	
		
			
				|  |  | +          <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
 | 
	
		
			
				|  |  | +                     :upload-after="onSuccess">
 | 
	
		
			
				|  |  | +              <template slot="excelTemplate">
 | 
	
		
			
				|  |  | +                  <el-button type="primary" @click="handleGet">
 | 
	
		
			
				|  |  | +                      点击下载<i class="el-icon-download el-icon--right"></i>
 | 
	
		
			
				|  |  | +                  </el-button>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +          </avue-form>
 | 
	
		
			
				|  |  | +          <p style="text-align: center;color: #DC0505">
 | 
	
		
			
				|  |  | +              温馨提示 第一次导入时请先下载模板
 | 
	
		
			
				|  |  | +          </p>
 | 
	
		
			
				|  |  | +      </el-dialog>
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                <el-button type="warning" size="small"
 | 
	
		
			
				|  |  | -                           :disabled="numberfalsefun() || assemblyForm.id"
 | 
	
		
			
				|  |  | -                           @click="equalDistribution">平均分配</el-button>
 | 
	
		
			
				|  |  | -            </div>
 | 
	
		
			
				|  |  | -            <!--<div>-->
 | 
	
		
			
				|  |  | -            <!--    <el-button size="small">Copy</el-button>-->
 | 
	
		
			
				|  |  | -            <!--    <el-button size="small">查看箱信息</el-button>-->
 | 
	
		
			
				|  |  | -            <!--    <el-button size="small">校验箱信息</el-button>-->
 | 
	
		
			
				|  |  | -            <!--</div>-->
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -      </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="menu">
 | 
	
		
			
				|  |  | -            <el-button v-if="scope.row.edit" :type="scope.type" :size="scope.size" icon="el-icon-edit"
 | 
	
		
			
				|  |  | -                       @click.stop="rowSavefun(scope.row, scope.index)">保存
 | 
	
		
			
				|  |  | -            </el-button>
 | 
	
		
			
				|  |  | -            <el-button v-else :type="scope.type" :size="scope.size" icon="el-icon-edit"
 | 
	
		
			
				|  |  | -                       :disabled="detailData.seeDisabled"
 | 
	
		
			
				|  |  | -                       @click.stop="rowCellfun(scope.row, scope.index)">编辑
 | 
	
		
			
				|  |  | -            </el-button>
 | 
	
		
			
				|  |  | -            <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
 | 
	
		
			
				|  |  | -                       :disabled="detailData.seeDisabled"
 | 
	
		
			
				|  |  | -                       @click.stop="rowDel(scope.row, scope.index)">删除
 | 
	
		
			
				|  |  | -            </el-button>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="cntrNo">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.cntrNo"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入箱号"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.cntrNo}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="sealNo">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.sealNo"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入封号"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.sealNo}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="quantity">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.quantity"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入件数"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{Number(scope.row.quantity).toFixed(2)}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="grossWeight">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.grossWeight"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入毛重"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.grossWeight}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="netWeight">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.netWeight"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入净重"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.netWeight}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="measurement">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.measurement"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入尺码"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.measurement}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="remarks">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.remarks"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入备注"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.remarks}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -        <template slot-scope="scope" slot="marks">
 | 
	
		
			
				|  |  | -            <el-input v-if="scope.row.edit" v-model="scope.row.marks"
 | 
	
		
			
				|  |  | -                      size="small" clearable placeholder="请输入MARKS"></el-input>
 | 
	
		
			
				|  |  | -            <span v-else>{{scope.row.marks}}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -    </avue-crud>
 | 
	
		
			
				|  |  | -  </basic-container>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
	
		
			
				|  | @@ -125,6 +142,35 @@ import {getToken} from "@/util/auth";
 | 
	
		
			
				|  |  |            extendedDisabled:false,
 | 
	
		
			
				|  |  |            // 装货港数据
 | 
	
		
			
				|  |  |            polData:[],
 | 
	
		
			
				|  |  | +          // 附件配置
 | 
	
		
			
				|  |  | +          excelOption: {
 | 
	
		
			
				|  |  | +              submitBtn: false,
 | 
	
		
			
				|  |  | +              emptyBtn: false,
 | 
	
		
			
				|  |  | +              column: [
 | 
	
		
			
				|  |  | +                  {
 | 
	
		
			
				|  |  | +                      label: "模板下载",
 | 
	
		
			
				|  |  | +                      prop: "excelTemplate",
 | 
	
		
			
				|  |  | +                      formslot: true,
 | 
	
		
			
				|  |  | +                      span: 24
 | 
	
		
			
				|  |  | +                  },
 | 
	
		
			
				|  |  | +                  {
 | 
	
		
			
				|  |  | +                      label: "模板上传",
 | 
	
		
			
				|  |  | +                      prop: "excelFile",
 | 
	
		
			
				|  |  | +                      type: "upload",
 | 
	
		
			
				|  |  | +                      drag: true,
 | 
	
		
			
				|  |  | +                      loadText: "模板上传中,请稍等",
 | 
	
		
			
				|  |  | +                      span: 24,
 | 
	
		
			
				|  |  | +                      propsHttp: {
 | 
	
		
			
				|  |  | +                          res: "data"
 | 
	
		
			
				|  |  | +                      },
 | 
	
		
			
				|  |  | +                      tip: "请上传 .xls,.xlsx 标准格式文件",
 | 
	
		
			
				|  |  | +                      action: "/api/blade-los/containers/importBoxNo"
 | 
	
		
			
				|  |  | +                  }
 | 
	
		
			
				|  |  | +              ]
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          excelForm:{},
 | 
	
		
			
				|  |  | +          excelLoading: false,
 | 
	
		
			
				|  |  | +          excelBox:false,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          form: {},
 | 
	
		
			
				|  |  |          query: {},
 | 
	
	
		
			
				|  | @@ -229,6 +275,24 @@ import {getToken} from "@/util/auth";
 | 
	
		
			
				|  |  |        created() {
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        methods: {
 | 
	
		
			
				|  |  | +          uploadBefore(file, done, loading) {
 | 
	
		
			
				|  |  | +              done();
 | 
	
		
			
				|  |  | +              loading = true;
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          // 上传成功
 | 
	
		
			
				|  |  | +          onSuccess(res, done, loading, column) {
 | 
	
		
			
				|  |  | +              this.excelBox = false;
 | 
	
		
			
				|  |  | +              this.$message.success("导入成功!");
 | 
	
		
			
				|  |  | +              loading = false;
 | 
	
		
			
				|  |  | +              done();
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          // 下载模板
 | 
	
		
			
				|  |  | +          handleGet() {
 | 
	
		
			
				|  |  | +              window.open(
 | 
	
		
			
				|  |  | +                  `/api/blade-los/containers/exportContainers?${this.website.tokenHeader
 | 
	
		
			
				|  |  | +                  }=${getToken()}&pid=${this.assemblyForm.id}`
 | 
	
		
			
				|  |  | +              );
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  |            // 查询件数是否为零
 | 
	
		
			
				|  |  |            numberfalsefun() {
 | 
	
		
			
				|  |  |                if (!this.assemblyForm.containersList) {
 | 
	
	
		
			
				|  | @@ -342,23 +406,6 @@ import {getToken} from "@/util/auth";
 | 
	
		
			
				|  |  |                    })
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  | -          // 导出导入模板
 | 
	
		
			
				|  |  | -          containersExportContainersfun(){
 | 
	
		
			
				|  |  | -              this.$confirm('是否导出?', '提示', {
 | 
	
		
			
				|  |  | -                  confirmButtonText: '确定',
 | 
	
		
			
				|  |  | -                  cancelButtonText: '取消',
 | 
	
		
			
				|  |  | -                  type: 'warning'
 | 
	
		
			
				|  |  | -              }).then(()=>{
 | 
	
		
			
				|  |  | -                  window.open(
 | 
	
		
			
				|  |  | -                      `/api/blade-los/containers/exportContainers?${this.website.tokenHeader
 | 
	
		
			
				|  |  | -                      }=${getToken()}&pid=${this.assemblyForm.id}`
 | 
	
		
			
				|  |  | -                  );
 | 
	
		
			
				|  |  | -              })
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          // 导入箱号,铅封号
 | 
	
		
			
				|  |  | -          containersImportBoxNofun(){
 | 
	
		
			
				|  |  | -              // containersImportBoxNo
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        rowSave(row, done, loading) {
 | 
	
		
			
				|  |  |          containersSubmit(row).then(() => {
 |