Browse Source

Merge branch 'master' of git.echepei.com:zhujiawei/Warehouse_management_ui

caojunjie 4 years ago
parent
commit
45f697898b

+ 400 - 235
src/views/finance/contrast/index.vue

@@ -1,16 +1,20 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams_s" ref="TWareHouseFees" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams_s"
+      ref="TWareHouseFees"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="货权方" prop="fCorpid">
         <el-select
           v-model="queryParams_s.fCorpid"
-          filterable
-          remote
+          placeholder="请输入客户名称"
           clearable
-          style="width: 200px"
+          size="small"
           @keyup.enter.native="handleQuery"
           :remote-method="corpsRemoteMethod"
-          placeholder="请输入客户名称"
         >
           <el-option
             v-for="(dict, index) in fMblnoOptions"
@@ -21,17 +25,17 @@
         </el-select>
       </el-form-item>
 
-
       <el-form-item label="结算单位" prop="fCorpid">
         <el-select
-        v-model="queryParams_s.fCorpid"
-        placeholder="请选择结算单位"
-        filterable
+          v-model="queryParams_s.fCorpid"
+          placeholder="请选择结算单位"
+          filterable
           remote
           clearable
           style="width: 200px"
-        @keyup.enter.native="handleQuery"
-        :remote-method="corpsRemoteMethod">
+          @keyup.enter.native="handleQuery"
+          :remote-method="corpsRemoteMethod"
+        >
           <el-option
             v-for="(dict, index) in fMblnoOptions"
             :key="index.fId"
@@ -43,12 +47,12 @@
 
       <el-form-item label="录入人" prop="createBy">
         <el-input
-            v-model="TWareHouseFees.createBy"
-            :disabled="true"
-            placeholder="默认录入人"
-            clearable
-            size="small"
-          />
+          v-model="TWareHouseFees.createBy"
+          :disabled="true"
+          placeholder="默认录入人"
+          clearable
+          size="small"
+        />
       </el-form-item>
 
       <!-- <el-form-item label="提单号" prop="tMblno">
@@ -84,7 +88,7 @@
         </el-select>
       </el-form-item> -->
 
-      <el-form-item label="对账日期">
+      <el-form-item label="对账日期" prop="fAccbilldate">
         <el-date-picker
           v-model="dateRange"
           size="small"
@@ -103,7 +107,8 @@
             v-for="item in options"
             :key="item.value"
             :label="item.dictLabel"
-            :value="item.dictValue">
+            :value="item.dictValue"
+          >
           </el-option>
         </el-select>
       </el-form-item>
@@ -117,17 +122,29 @@
         />
       </el-form-item>-->
       <el-form-item label="系统编号" prop="fBillno">
-        <el-input placeholder="请输入"
-        v-model="queryParams_s.fBillno"
-        @keyup.enter.native="handleQuery"/>
+        <el-input
+          v-model="queryParams_s.fBillno"
+          placeholder="请输入系统编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
       </el-form-item>
 
       <!-- <el-form-item label="制单部门" prop="fDeptid">
         <el-input label="请选择字典生成" value="" v-model="queryParams.fDeptid" placeholder="请选择制单部门" clearable size="small"/>
       </el-form-item> -->
       <el-form-item>
-        <el-button type="cyan" icon="el-icon-search" size="mini" @click="searchFee">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="cyan"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -135,60 +152,79 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
+          icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
           v-hasPermi="['finance:contrast:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
+          icon="el-icon-edit"
           size="mini"
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['warehouse:fee:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"
+          icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['finance:contrast + fId']"
-        >删除</el-button>
+          v-hasPermi="['finance:contrast:remove']"
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
           type="warning"
+          icon="el-icon-download"
           size="mini"
           @click="handleExport"
           v-hasPermi="['finance:contrast:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="contrastList" @selection-change="handleSelectionChange">
-      <el-table-column width="55" align="center" type="selection"/>
+    <el-table
+      v-loading="loading"
+      :data="contrastList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column width="55" align="center" type="selection" />
       <!-- <el-table-column label="制单部门" align="center" prop="fId" /> -->
-      <el-table-column label="行号" align="center" type="index" width="55"/>
-      <el-table-column label="系统编号" align="center" prop="fBillno"/>
-      <el-table-column label="货权方" align="center" prop="fCtrlcorpid"/>
-      <el-table-column label="结算单位" align="center" prop="fCorpid"/>
+      <el-table-column label="行号" align="center" type="index" width="55" />
+      <el-table-column label="系统编号" align="center" prop="fBillno" />
+      <el-table-column label="货权方" align="center" prop="fCtrlcorpid" />
+      <el-table-column label="结算单位" align="center" prop="fCorpid" />
       <el-table-column label="账单日期" align="center" prop="createTime">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.fAccbilldate, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.fAccbilldate, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="提单号" align="center" prop="tMblno"/>
-      <el-table-column label="应收合计" align="center" prop="fAmtdr"/>
-      <el-table-column label="应付合计" align="center" prop="fAmtcr"/>
-<!--       <el-table-column label="单据类型" align="center" prop="fBilltype" />-->
+      <el-table-column label="提单号" align="center" prop="fMblno" />
+      <el-table-column label="应收合计" align="center" prop="fAmtdr" />
+      <el-table-column label="应付合计" align="center" prop="fAmtcr" />
+      <!--       <el-table-column label="单据类型" align="center" prop="fBilltype" />-->
       <el-table-column label="备注" align="center" prop="fRemarks" />
       <el-table-column label="状态" align="center" prop="fBillstatus" />
       <!-- <el-table-column label="制单部门" align="center" prop="fDeptid" /> -->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -196,20 +232,22 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['finance:contrast:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['finance:contrast:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
 
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -217,55 +255,67 @@
     />
 
     <!-- 对账表 -->
-    <el-dialog :visible.sync="open" width="65%" append-to-body :close-on-click-modal="false">
-      <el-form ref="rules" :model="queryParams" :rules="ruless" label-width="68px" :inline="true" v-show="showSearch">
-
+    <el-dialog
+      :visible.sync="open"
+      width="70%"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="ruless"
+        :model="queryParams"
+        :rules="ruless"
+        label-width="68px"
+        :inline="true"
+        v-show="showSearch"
+      >
         <el-form-item label="货权方" prop="fCtrlcorpid">
-        <el-input
-          v-model="queryParams.fCtrlcorpid"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-          placeholder="请输入客户名称"
-        />
-      </el-form-item>
-
-      <el-form-item label="结算单位" label-width="78px" prop="fCorpid">
-        <el-select
-        v-model="queryParams.fCorpid"
-        placeholder="请选择结算单位"
-        filterable
-          remote
-          clearable
-          style="width: 200px"
-        @keyup.enter.native="handleQuery"
-        :remote-method="corpsRemoteMethod">
-          <el-option
-            v-for="(dict, index) in fMblnoOptions"
-            :key="index.fId"
-            :label="dict.fName"
-            :value="dict.fId"
-          ></el-option>
-        </el-select>
-      </el-form-item>
+          <el-input
+            v-model="queryParams.fCtrlcorpid"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+            placeholder="请输入客户名称"
+          />
+        </el-form-item>
 
+        <el-form-item label="结算单位" label-width="78px" prop="fCorpid">
+          <el-select
+            v-model="queryParams.fCorpid"
+            placeholder="请选择结算单位"
+            filterable
+            remote
+            clearable
+            style="width: 200px"
+            @keyup.enter.native="handleQuery"
+            :remote-method="corpsRemoteMethod"
+          >
+            <el-option
+              v-for="(dict, index) in fMblnoOptions"
+              :key="index.fId"
+              :label="dict.fName"
+              :value="dict.fId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
 
-      <!-- <el-form-item label="提单号" prop="tMblno">
+        <!-- <el-form-item label="提单号" prop="tMblno">
           <el-input v-model="TWareHouseFees.tMblno" placeholder="" :disabled="true"/>
       </el-form-item> -->
 
-      <el-form-item label="对账日期" prop="fAccbilldate">
-        <el-date-picker
-          v-model="queryParams.fAccbilldate"
-          size="small"
-          style="width: 200px"
-          value-format="yyyy-MM-dd"
-          type="date"
-          placeholder="选择账单日期">
-        </el-date-picker>
-      </el-form-item>
+        <el-form-item label="对账日期" prop="fAccbilldate">
+          <el-date-picker
+            v-model="queryParams.fAccbilldate"
+            size="small"
+            style="width: 200px"
+            value-format="yyyy-MM-dd"
+            type="date"
+            placeholder="选择账单日期"
+          >
+          </el-date-picker>
+        </el-form-item>
 
-      <!-- <el-form-item label="单据日期">
+        <!-- <el-form-item label="单据日期">
         <el-date-picker
           v-model="value4"
           size="small"
@@ -275,119 +325,169 @@
         </el-date-picker>
       </el-form-item> -->
 
-      <el-form-item label="单据编号" prop="fBillno">
-        <el-input :disabled="true"/>
-      </el-form-item>
+        <el-form-item label="系统编号" prop="fBillno">
+          <el-input
+            v-model="queryParams.fBillno"
+            placeholder=""
+            clearable
+            size="small"
+            :disabled="true"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
 
-      <el-form-item label="录入人" prop="createBy">
-        <el-input v-model="queryParams.createBy"/>
-      </el-form-item>
+        <el-form-item label="录入人" prop="createBy">
+          <el-input v-model="queryParams.createBy" />
+        </el-form-item>
 
-      <div style="width:100%">
-        <el-button type="warning" size="small" @click="innerVisible = true">对账</el-button>
-        <el-button type="primary" size="small">确认对账</el-button>
-        <el-button type="success" size="small">导出</el-button>
-        <el-button type="info" size="small">打印</el-button>
-        <el-button type="danger" size="small">删除</el-button>
-      </div>
+        <div style="width: 100%">
+          <el-button type="warning" size="small" @click="innerVisible = true"
+            >对账</el-button
+          >
+          <el-button type="primary" size="small">确认对账</el-button>
+          <el-button type="success" size="small">导出</el-button>
+          <el-button type="info" size="small">打印</el-button>
+          <el-button type="danger" size="small">删除</el-button>
+        </div>
 
-      <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
-    </el-form>
+        <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
+      </el-form>
 
-    <el-table v-loading="loading" :data="DzfeeList" @selection-change="handleSelectionChange_s" size="mini">
+      <el-table
+        v-loading="loading"
+        :data="DzfeeList"
+        @selection-change="handleSelectionChange_s"
+      >
         <el-table-column type="selection" width="55" align="center" />
         <!-- <el-table-column label="制单部门" align="center" prop="fId" /> -->
-        <el-table-column label="行号" align="center" type="index"/>
-        <!-- <el-table-column label="提单号" align="center" prop="fMblno"/> -->
-        <el-table-column label="业务日期" align="center" prop="fBsdate"/>
-        <el-table-column label="费用名称" align="center" prop="fFeeName"/>
+        <el-table-column label="行号" align="center" type="index" />
+        <el-table-column label="提单号" align="center" prop="fMblno" />
+        <el-table-column label="业务日期" align="center" prop="fBsdate" />
+        <el-table-column label="费用名称" align="center" prop="fFeeid" />
         <el-table-column label="收/付" align="center" prop="fSrcdc">
           <template slot-scope="scope">
-            <span v-if="scope.row.fSrcdc =='D'">收</span>
-            <span v-else-if="scope.row.fSrcdc =='C'">付</span>
+            <span v-if="scope.row.fSrcdc == 'D'">收</span>
+            <span v-else-if="scope.row.fSrcdc == 'C'">付</span>
           </template>
         </el-table-column>
-        <el-table-column label="金额" align="center" prop="fAmt"/>
+        <el-table-column label="金额" align="center" prop="fAmt" />
         <el-table-column label="业务类型" align="center" prop="fBilltype">
           <template slot-scope="scope">
-            <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
-          <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
-          <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
-          <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span> 
+            <span v-if="scope.row.fBilltype == 'SJRK'">入库</span>
+            <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
+            <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
+            <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span>
           </template>
         </el-table-column>
-    </el-table>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click.native.prevent="deleteRow(scope.$index, increase_s)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
 
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
 
-        <!-- 添加或修改财务数据主对话框 -->
-    <el-dialog :close-on-click-modal="false" width="65%" :title="title" :visible.sync="innerVisible" append-to-body>
-      <el-form :model="TWareHouseFees" ref="feeListRules" :rules="feeListRules" label-width="80px" :inline="true">
-        <!-- <el-form-item label="业务编号" prop="fBillno">
+      <!-- 添加或修改财务数据主对话框 -->
+      <el-dialog
+        :close-on-click-modal="false"
+        width="70%"
+        :title="title"
+        :visible.sync="innerVisible"
+        append-to-body
+      >
+        <el-form
+          :model="TWareHouseFees"
+          ref="feeListRules"
+          :rules="feeListRules"
+          label-width="80px"
+          :inline="true"
+        >
+          <!-- <el-form-item label="业务编号" prop="fBillno">
           <el-input v-model="form.fBillno" placeholder="请输入业务编号" />
         </el-form-item> -->
 
-        <el-form-item class="el-form-item__label" label="货权方" prop="fCorpid">
-          <el-select
-          v-model="TWareHouseFees.fCorpid"
-          filterable
-          remote
-          clearable
-          style="width: 200px"
-          :remote-method="corpsRemoteMethod"
-          placeholder="请输入客户名称"
+          <el-form-item
+            class="el-form-item__label"
+            label="货权方"
+            prop="fCorpid"
           >
-            <el-option
-              v-for="(dict, index) in fMblnoOptions"
-              :key="index.fId"
-              :label="dict.fName"
-              :value="dict.fId"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-
-      <el-form-item label="结算单位" prop="fToCorpid">
-        <el-select
-        v-model="TWareHouseFees.fToCorpid"
-        placeholder="请选择结算单位"
-        filterable
-          remote
-          clearable
-          style="width: 200px"
-        :remote-method="corpsRemoteMethod">
-          <el-option
-            v-for="(dict, index) in fMblnoOptions"
-            :key="index.fId"
-            :label="dict.fName"
-            :value="dict.fId"
-          ></el-option>
-        </el-select>
-      </el-form-item>
-
-        <el-form-item label="提单号" prop="fMblno">
-          <el-input v-model="TWareHouseFees.fMblno" placeholder="请模糊输入" style="width:200px"/>
-        </el-form-item>
-        <el-form-item label="收付" prop="fDc">
-          <el-col :span="8">
-            <el-select v-model="TWareHouseFees.fDc" style="width:200px">
-              <el-option label="收" value="D"/>
-              <el-option label="付" value="C"/>
+            <el-select
+              v-model="TWareHouseFees.fCorpid"
+              filterable
+              remote
+              clearable
+              style="width: 200px"
+              @keyup.enter.native="handleQuery"
+              :remote-method="corpsRemoteMethod"
+              placeholder="请输入客户名称"
+            >
+              <el-option
+                v-for="(dict, index) in fMblnoOptions"
+                :key="index.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
             </el-select>
-          </el-col>
-        </el-form-item>
-        <el-form-item label="是否对账" prop="fReconciliation">
-          <el-col :span="8">
-            <el-select v-model="TWareHouseFees.fReconciliation" style="width:200px">
-              <el-option label="是" value="1"/>
-              <el-option label="否" value="0"/>
+          </el-form-item>
+
+          <el-form-item label="结算单位" prop="fToCorpid">
+            <el-select
+              v-model="TWareHouseFees.fToCorpid"
+              placeholder="请选择结算单位"
+              filterable
+              remote
+              clearable
+              style="width: 200px"
+              @keyup.enter.native="handleQuery"
+              :remote-method="corpsRemoteMethod"
+            >
+              <el-option
+                v-for="(dict, index) in fMblnoOptions"
+                :key="index.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
             </el-select>
-          </el-col>
-        </el-form-item>
+          </el-form-item>
 
-        <el-form-item label="费用名称" prop="fFeeid">
+          <el-form-item label="提单号" prop="fMblno">
+            <el-input
+              v-model="TWareHouseFees.fMblno"
+              placeholder="请输入提单号"
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item label="收付" prop="fDc">
+            <el-col :span="8">
+              <el-select v-model="TWareHouseFees.fDc" style="width: 200px">
+                <el-option label="收" value="D" />
+                <el-option label="付" value="C" />
+              </el-select>
+            </el-col>
+          </el-form-item>
+          <el-form-item label="是否对账" prop="fReconciliation">
+            <el-col :span="8">
+              <el-select
+                v-model="TWareHouseFees.fReconciliation"
+                style="width: 200px"
+              >
+                <el-option label="是" value="1" />
+                <el-option label="否" value="0" />
+              </el-select>
+            </el-col>
+          </el-form-item>
+
+          <el-form-item label="费用名称" prop="fFeeid">
             <template>
               <el-select
                 v-model="TWareHouseFees.fFeeid"
@@ -396,74 +496,114 @@
                 remote
                 :remote-method="fWRemoteMethod"
                 placeholder="费用名称"
-                multiple>
-                <el-option v-for="item in fWbuOptions" :key="item.fId" :label="item.fName" :value="item.fId">
+                multiple
+              >
+                <el-option
+                  v-for="item in fWbuOptions"
+                  :key="item.fId"
+                  :label="item.fName"
+                  :value="item.fId"
+                >
                 </el-option>
               </el-select>
             </template>
-        </el-form-item>
+          </el-form-item>
 
-        <el-form-item label="审核日期" prop="timeExamine">
-        <el-date-picker
-          style="width:200px"
-          size="small"
-          v-model="TWareHouseFees.timeExamine"
-          type="daterange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
-          >
-        </el-date-picker>
-      </el-form-item>
+          <el-form-item label="审核日期" prop="timeExamine">
+            <el-date-picker
+              style="width: 200px"
+              size="small"
+              v-model="TWareHouseFees.timeExamine"
+              type="daterange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              value-format="yyyy-MM-dd"
+              :default-time="['00:00:00', '23:59:59']"
+            >
+            </el-date-picker>
+          </el-form-item>
 
-      <el-form-item label="对账日期" label-width="85px" prop="timeReconci">
-        <el-date-picker
-          v-model="TWareHouseFees.timeReconci"
-          size="small"
-          style="width: 200px"
-          value-format="yyyy-MM-dd"
-          type="daterange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :default-time="['00:00:00', '23:59:59']"
-        ></el-date-picker>
-      </el-form-item>
+          <el-form-item label="对账日期" label-width="85px" prop="timeReconci">
+            <el-date-picker
+              v-model="TWareHouseFees.timeReconci"
+              size="small"
+              style="width: 200px"
+              value-format="yyyy-MM-dd"
+              type="daterange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :default-time="['00:00:00', '23:59:59']"
+            ></el-date-picker>
+          </el-form-item>
 
-      <el-form-item>
-        <!-- <el-button class="btnColor" type="info" size="mini">导入</el-button> -->
-        <el-button class="btnColor" type="cyan" size="mini" @click="searchFee">搜索</el-button>
-        <el-button class="btnColor" type="info" size="mini" @click="resetQuery_s">重置</el-button>
-      </el-form-item>
+          <el-form-item>
+            <!-- <el-button class="btnColor" type="info" size="mini">导入</el-button> -->
+            <el-button
+              class="btnColor"
+              type="cyan"
+              size="mini"
+              @click="searchFee"
+              >搜索</el-button
+            >
+            <el-button
+              class="btnColor"
+              type="info"
+              size="mini"
+              @click="resetQuery_s"
+              >重置</el-button
+            >
+          </el-form-item>
 
-      <el-table v-loading="loading" :data="feeList" show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange_s">
-        <el-table-column  type="selection" width="55" align="center"/>
-        <!-- <el-table-column label="制单部门" align="center" prop="fId" /> -->
-        <el-table-column label="行号" align="center" type="index"/>
-        <el-table-column label="货权方" align="center" prop="fName"/>
-        <el-table-column label="结算单位" align="center" prop="fFeesName"/>
-        <!-- <el-table-column label="账单日期" align="center" prop="fAccbilldate"/> -->
-        <el-table-column label="提单号" align="center" prop="fMblno"/>
-        <el-table-column label="品名" align="center" prop="fProductName"/>
-        <el-table-column label="业务日期" align="center" prop="fBsdate"/>
-        <el-table-column label="业务类型" align="center" prop="fBilltype">
-          <template slot-scope="scope">
-            <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
-          <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
-          <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
-          <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span> 
-          </template>
-        </el-table-column>
-  <!--       <el-table-column label="单据类型" align="center" prop="fBilltype" />-->
-        <el-table-column label="审核日期" align="center" prop="fReviewDate" />
-        <el-table-column label="金额" align="center" prop="fAmtdr" />
-        <el-table-column label="本次金额" align="center" prop="fAmt" />
-        <el-table-column label="费用名称" align="center" prop="fFeeName" />
-        <el-table-column label="备注" align="center" prop="f_remarks" >
-          <el-input placeholder="请输入内容"></el-input>
-        </el-table-column>
-      </el-table>
+          <el-table
+            v-loading="loading"
+            :data="feeList"
+            show-summary
+            :summary-method="getSummaries"
+            @selection-change="handleSelectionChange_s"
+          >
+            <el-table-column type="selection" width="55" align="center" />
+            <!-- <el-table-column label="制单部门" align="center" prop="fId" /> -->
+            <el-table-column label="行号" align="center" type="index" />
+            <el-table-column label="货权方" align="center" prop="fName" />
+            <el-table-column label="结算单位" align="center" prop="fFeesName" />
+            <!-- <el-table-column label="账单日期" align="center" prop="fAccbilldate"/> -->
+            <el-table-column label="提单号" align="center" prop="fMblno" />
+            <el-table-column label="品名" align="center" prop="fProductName" />
+            <el-table-column label="业务日期" align="center" prop="fBsdate" />
+            <el-table-column label="业务类型" align="center" prop="fBilltype">
+              <template slot-scope="scope">
+                <span v-if="scope.row.fBilltype == 'SJRK'">入库</span>
+                <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
+                <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
+                <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span>
+              </template>
+            </el-table-column>
+            <!--       <el-table-column label="单据类型" align="center" prop="fBilltype" />-->
+            <el-table-column
+              label="审核日期"
+              align="center"
+              prop="fReviewDate"
+            />
+            <el-table-column label="金额" align="center" prop="fAmtdr" />
+            <el-table-column label="本次金额" align="center" prop="fAmt">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.fAmt"
+                  placeholder="请输入本次金额"
+                  clearable
+                  size="small"
+                  oninput="value=value.replace(/[^\d]/g,'')"
+                  @input="imgChange1(scope.row.fAmtdr, scope.row.fAmt)"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="费用名称" align="center" prop="fFeeName" />
+            <el-table-column label="备注" align="center" prop="f_remarks">
+              <el-input placeholder="请输入内容"></el-input>
+            </el-table-column>
+          </el-table>
 
-        <!-- <el-form-item label="应收合计" prop="fAmtdr">
+          <!-- <el-form-item label="应收合计" prop="fAmtdr">
           <el-input v-model="form.fAmtdr" placeholder="请输入应收合计" />
         </el-form-item>
         <el-form-item label="应付合计" prop="fAmtcr">
@@ -610,7 +750,17 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      ruless:{},
+      ruless:{
+        fCtrlcorpid: [
+          { required: true, message: '货权方不能为空', trigger: 'blur' }
+        ],
+        fCorpid: [
+          { required: true, message: '结算单位不能为空', trigger: 'blur' }
+        ],
+        fAccbilldate: [
+          { required: true, message: '对账日期不能为空', trigger: 'blur' }
+        ]
+      },
       feeListRules: {
         // fCtrlcorpid: [
         //   { required:true, message: '不能为空', trigger: 'blur'}
@@ -645,6 +795,17 @@ export default {
     // this.register()
   },
   methods: {
+    // 金额筛选
+    imgChange1(fAmtdr,fAmt){
+      if (fAmt <= fAmtdr){
+        console.log("小了!")
+        this.state_s = true
+      }else if(fAmt > fAmtdr){
+        console.log("大了!")
+        this.$message.error('本次金额不能大于原定金额');
+        this.state_s = false
+      }
+    },
     // 默认录入人
     // register() {
     //   queryUserVal().then((response)=>{
@@ -926,7 +1087,11 @@ export default {
       }).then(response => {
         this.download(response.msg);
       })
-    }
+    },
+    //清空一行
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
   }
 };
 </script>

+ 331 - 260
src/views/warehouseBusiness/inStock/index.vue

@@ -267,7 +267,7 @@
         :formatter="fTrademodeidFormat"
       /> -->
       <el-table-column label="仓库" align="center" prop="fWarehouseid" />
-      <el-table-column label="计划件数" align="center" prop="fPlannetweight" />
+      <el-table-column label="计划件数" align="center" prop="fPlanqty" />
       <el-table-column label="入库件数" align="center" prop="fQty" />
       <!--      <el-table-column label="入库毛重" align="center" prop="fGrossweight"/>-->
       <!-- <el-table-column label="货转客户名称" align="center" prop="fTocorpid" /> -->
@@ -332,9 +332,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            v-if="
-              scope.row.fBillstatus !== '6' && scope.row.fItemsStatus === '1'
-            "
+            v-if="scope.row.fBillstatus !== 6 && scope.row.fItemsStatus === 1"
             @click="handleDelete(scope.row)"
             v-hasPermi="['warehouseBusiness:warehousebills:remove']"
             >删除
@@ -385,7 +383,7 @@
                 v-model="form.fStltypeid"
                 placeholder="请选择结算方式"
                 clearable
-                :disabled="browseStatus"
+                :disabled="browseStatus || formBrowseStatus"
                 style="width: 80%"
               >
                 <el-option
@@ -469,10 +467,11 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="计划件数" prop="fPlanqty">
-             <el-input
+              <el-input
                 v-model="form.fPlanqty"
                 style="width: 80%"
                 laceholder="计划件数"
+                :disabled="browseStatus || formBrowseStatus"
               />
             </el-form-item>
           </el-col>
@@ -482,6 +481,7 @@
                 v-model="form.fPlannetweight"
                 style="width: 80%"
                 laceholder="计划毛重"
+                :disabled="browseStatus || formBrowseStatus"
               />
             </el-form-item>
           </el-col>
@@ -491,6 +491,7 @@
                 v-model="form.fPlangrossweight"
                 style="width: 80%"
                 laceholder="计划毛重"
+                :disabled="browseStatus || formBrowseStatus"
               />
             </el-form-item>
           </el-col>
@@ -515,7 +516,7 @@
                 remote
                 clearable
                 style="width: 80%"
-                :disabled="browseStatus"
+                :disabled="browseStatus || formBrowseStatus"
                 @keyup.enter.native="handleQuery"
                 :remote-method="corpsRemoteMethodd"
                 placeholder="请输入模糊查找"
@@ -723,67 +724,45 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-             <el-col :span="8">
-            <el-form-item label="质押" prop="fIfpledge">
-              <el-select
-                v-model="form.fIfpledge"
-                placeholder="请选择是否过磅"
-                clearable
-                :disabled="browseStatus"
-                style="width: 80%"
-              >
-                <el-option
-                  v-for="(dict, index) in fIfpledgeOptions"
-                  :key="index.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
+            <el-col :span="8">
+              <el-form-item label="质押" prop="fIfpledge">
+                <el-select
+                  v-model="form.fIfpledge"
+                  placeholder="请选择是否过磅"
+                  clearable
+                  :disabled="browseStatus"
+                  style="width: 80%"
+                >
+                  <el-option
+                    v-for="(dict, index) in fIfpledgeOptions"
+                    :key="index.dictValue"
+                    :label="dict.dictLabel"
+                    :value="dict.dictValue"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-col>
           </el-row>
           <el-row>
-             <el-col :span="8">
-            <el-form-item label="质押银行" prop="fBankcorpid">
-              <el-select
-                v-model="queryParams.fBankcorpid"
-                filterable
-                remote
-                clearable
-                style="width: 80%"
-                :disabled="browseStatus"
-                @keyup.enter.native="handleQuery"
-                :remote-method="corpsRemoteMethodd"
-                placeholder="请输入模糊查找"
-              >
-                <el-option
-                  v-for="(dict, index) in Pledgebank"
-                  :key="index.fId"
-                  :label="dict.fName"
-                  :value="dict.fId"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
             <el-col :span="8">
-            <el-form-item label="过磅" prop="fIfweigh">
-              <el-select
-                v-model="form.fIfweigh"
-                placeholder="请选择是否过磅"
-                clearable
-                :disabled="browseStatus"
-                style="width: 80%"
-              >
-                <el-option
-                  v-for="(dict, index) in fIfweighOptions"
-                  :key="index.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-            </el-row>
+              <el-form-item label="过磅" prop="fIfweigh">
+                <el-select
+                  v-model="form.fIfweigh"
+                  placeholder="请选择是否过磅"
+                  clearable
+                  :disabled="browseStatus"
+                  style="width: 80%"
+                >
+                  <el-option
+                    v-for="(dict, index) in fIfweighOptions"
+                    :key="index.dictValue"
+                    :label="dict.dictLabel"
+                    :value="dict.dictValue"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
         </div>
       </el-form>
 
@@ -827,16 +806,17 @@
             "
             >{{ detailsHidden ? "隐藏" : "展开" }}</el-button
           >
+          <el-button type="info" prop="打印" @click="showEditDialog_sss"
+            >作业单
+          </el-button>
+          <el-button @click="discharge">卸货 </el-button>
           <el-button type="success" prop="打印" @click="showEditDialog_ss"
             >收货单
           </el-button>
           <el-button type="warning" prop="打印" @click="showEditDialog_s"
             >入库单
           </el-button>
-          <el-button @click="discharge">卸货 </el-button>
-          <el-button type="info" prop="打印" @click="showEditDialog_sss"
-            >作业单
-          </el-button>
+
           <el-button
             :disabled="browseStatus"
             type="primary"
@@ -1172,7 +1152,7 @@
         <el-table-column
           prop="fDriverIdCa"
           header-align="center"
-          width="130px"
+          width="200px"
           align="center"
           label="*司机身份证"
         >
@@ -1959,45 +1939,50 @@
       <el-dialog
         title="计划费用导入"
         :modal="false"
-        style="height:500px;"
+        style="height: 500px"
         height="50%"
         :visible.sync="weightList"
         @close="closeDialog"
         width="70%"
       >
-       <el-form ref="planningList" :model="form" :rules="rules" label-width="120px">
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="计划件数" prop="fPlanqty">
-             <el-input
-                v-model="planningList.fPlanqty"
-                style="width: 80%"
-                laceholder="计划件数"
-                @input="changeList(form)"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="计划净重" prop="fPlannetweight">
-             <el-input
-                v-model="planningList.fPlannetweight"
-                style="width: 80%"
-                disabled
-                laceholder="计划毛重"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="计划毛重" prop="fPlangrossweight">
-             <el-input
-                v-model="planningList.fPlangrossweight"
-                style="width: 80%"
-                disabled
-                laceholder="计划毛重"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
+        <el-form
+          ref="planningList"
+          :model="form"
+          :rules="rules"
+          label-width="120px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="计划件数" prop="fPlanqty">
+                <el-input
+                  v-model="planningList.fPlanqty"
+                  style="width: 80%"
+                  laceholder="计划件数"
+                  @input="changeList(form)"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计划净重" prop="fPlannetweight">
+                <el-input
+                  v-model="planningList.fPlannetweight"
+                  style="width: 80%"
+                  disabled
+                  laceholder="计划毛重"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计划毛重" prop="fPlangrossweight">
+                <el-input
+                  v-model="planningList.fPlangrossweight"
+                  style="width: 80%"
+                  disabled
+                  laceholder="计划毛重"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="costList">导入</el-button>
@@ -2434,7 +2419,22 @@
             <td width="200">车号</td>
             <td width="200">{{ item.fTruckno }}</td>
             <td width="200">货物品名</td>
-            <td width="200" colspan="4" class="zzss">{{ item.fGoodsids }}</td>
+            <td width="200" colspan="4" class="zzss">
+              <el-select
+              v-model="item.fGoodsid"
+              filterable
+              remote
+              :remote-method="goodsRemoteMethod"
+              placeholder="请选择品名"
+            >
+              <el-option
+                v-for="(dict, index) in goodsOptions"
+                :key="index.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
+            </td>
           </tr>
           <tr>
             <td width="1400" colspan="6">&nbsp;</td>
@@ -2526,15 +2526,15 @@ export default {
       fBsdates: "",
       fCntrtype: "",
       fGoodsids: "",
-      fPlaNnumber: '',
-      fPlangNumber: '',
+      fPlaNnumber: "",
+      fPlangNumber: "",
       // fPlannetweight: "",
       fPlanvolumn: "",
       fPlanqty: "",
       fFeeUnitid: "",
       fFeeUnitids: "",
       fGrossweight: "",
-      fid: null,
+      fid: "",
       fCntqty: "",
       fNetweight: "",
       fQty: "",
@@ -2603,11 +2603,11 @@ export default {
       fTrademodeidOptions: [],
       // 计费单位(数据字典),下拉选择毛重或净重字典
       fFeetunitOptions: [
-        {dictLabel: "件数",dictValue: "1"},
-        {dictLabel: "毛重",dictValue: "2"},
-        {dictLabel: "净重",dictValue: "3"},
-        {dictLabel: "尺码",dictValue: "4"},
-        {dictLabel: "固定",dictValue: "5"},
+        { dictLabel: "件数", dictValue: "1" },
+        { dictLabel: "毛重", dictValue: "2" },
+        { dictLabel: "净重", dictValue: "3" },
+        { dictLabel: "尺码", dictValue: "4" },
+        { dictLabel: "固定", dictValue: "5" },
       ],
       // 结算方式(数据字典),下拉选择字典
       fStltypeOptions: [],
@@ -2625,11 +2625,11 @@ export default {
       fWbuOptions: [],
       // 计价单位
       jFeetunitOptions: [
-        {dictLabel: "件数",dictValue: "1"},
-        {dictLabel: "毛重",dictValue: "2"},
-        {dictLabel: "净重",dictValue: "3"},
-        {dictLabel: "尺码",dictValue: "4"},
-        {dictLabel: "固定",dictValue: "5"},
+        { dictLabel: "件数", dictValue: "1" },
+        { dictLabel: "毛重", dictValue: "2" },
+        { dictLabel: "净重", dictValue: "3" },
+        { dictLabel: "尺码", dictValue: "4" },
+        { dictLabel: "固定", dictValue: "5" },
       ],
       // 查询参数
       queryParams: {
@@ -2689,7 +2689,7 @@ export default {
       planningList: {
         fPlanqty: null,
         fPlannetweight: null,
-        fPlangrossweight: null
+        fPlangrossweight: null,
       },
       // 表单参数
       form: {
@@ -2754,8 +2754,8 @@ export default {
       this.fStltypeOptions = response.data;
     });
     this.getDicts("tax_rate").then((response) => {
-      this.fTaxrate = response.data[0].dictValue
-      console.log(this.fTaxrate)
+      this.fTaxrate = response.data[0].dictValue;
+      console.log(this.fTaxrate);
     });
     this.getDicts("data_ifweigh_status").then((response) => {
       this.fIfweighOptions = response.data;
@@ -2777,7 +2777,7 @@ export default {
   methods: {
     // 上传成功返回数据
     showFile(row) {
-      for(let list in this.relevantAttachments) {
+      for (let list in this.relevantAttachments) {
         this.$set(this.relevantAttachments[list], "fUrl", row.url);
         this.$set(this.relevantAttachments[list], "fName", row.fileName);
       }
@@ -2874,18 +2874,21 @@ export default {
         typeof this.form.fPlanqty === "undefined" ||
         this.form.fPlanqty == null ||
         this.form.fPlanqty === "";
-        if (corpidStatus || warehouseidStatus || ftrademodeids) {
+      if (corpidStatus || warehouseidStatus || ftrademodeids) {
         this.$message({
           message: "请维护计划净重,计划毛重,计划件数",
           type: "warning",
         });
         return false;
       }
-      this.planningList.fPlanqty =  Number(this.form.fPlanqty) - Number(this.fQty),
-      this.planningList.fPlannetweight = Number(this.form.fPlannetweight) - Number(this.fNetweight),
-      this.planningList.fPlangrossweight = Number(this.form.fPlangrossweight) - Number(this.fGrossweight),
-      this.fPlaNnumber = this.form.fPlannetweight/this.form.fPlanqty;
-      this.fPlangNumber = this.form.fPlangrossweight/this.form.fPlanqty;
+      (this.planningList.fPlanqty =
+        Number(this.form.fPlanqty) - Number(this.fQty)),
+        (this.planningList.fPlannetweight =
+          Number(this.form.fPlannetweight) - Number(this.fNetweight)),
+        (this.planningList.fPlangrossweight =
+          Number(this.form.fPlangrossweight) - Number(this.fGrossweight)),
+        (this.fPlaNnumber = this.form.fPlannetweight / this.form.fPlanqty);
+      this.fPlangNumber = this.form.fPlangrossweight / this.form.fPlanqty;
       this.weightList = true;
       let time = null;
     },
@@ -2945,6 +2948,13 @@ export default {
       }
     },
     showEditDialog_sss() {
+      console.log(this.Printinglist)
+      for (let li in this.Printinglist) {
+        if(!this.Printinglist[li].fId) {
+          this.$message.error("请先保存!");
+          return false;
+        }
+      }
       if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
           if (
@@ -2985,10 +2995,14 @@ export default {
             this.$message.error("请输入司机姓名");
             return false;
           }
-          if (!this.Printinglist[warehouseCr].fPackagespecs) {
+          if (!this.Printinglist[warehouseCr].fDriverTel) {
             this.$message.error("请输入司机电话");
             return false;
           }
+          if (!this.Printinglist[warehouseCr].fTruckno) {
+            this.$message.error("请输入车号");
+            return false;
+          }
         }
         this.editDialogVisible_sss = true;
         // this.addList()
@@ -3050,7 +3064,7 @@ export default {
     getList() {
       this.loading = true;
       listWarehousebills(this.queryParams).then((response) => {
-        console.log(response)
+        console.log(response);
         this.warehousebillsList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -3075,18 +3089,18 @@ export default {
     },
     // 导入计划重量
     costList() {
-      console.log(this.planningList.fPlanqty)
-      console.log(this.form.fPlanqty)
-      if( Number(this.planningList.fPlanqty) > Number(this.form.fPlanqty)) {
-        console.log(this.planningList.fPlanqty)
-      console.log(this.form.fPlanqty)
+      console.log(this.planningList.fPlanqty);
+      console.log(this.form.fPlanqty);
+      if (Number(this.planningList.fPlanqty) > Number(this.form.fPlanqty)) {
+        console.log(this.planningList.fPlanqty);
+        console.log(this.form.fPlanqty);
         this.$message({
           message: "计划费件数不能大于主表计划费件数!",
           type: "warning",
         });
         return false;
       }
-       this.dataList.push({
+      this.dataList.push({
         fBsdate: this.form.fBsdate,
         fGoodsid: null,
         fCntrtype: null,
@@ -3107,7 +3121,6 @@ export default {
         fBillstatus: 10,
       });
       this.weightList = false;
-      
     },
 
     // 导入付款信息
@@ -3132,8 +3145,7 @@ export default {
             fUnitprice: this.dialogWhgenlegList[whgen].fPrice,
             fCurrency: "RMB",
             fExrate: "1",
-            fTaxrate: this.fTaxrate
-
+            fTaxrate: this.fTaxrate,
           });
           console.log(JSON.stringify(this.warehouseDrList));
         }
@@ -3159,7 +3171,7 @@ export default {
             fUnitprice: this.dialogWhgenlegList[zhgen].fPrice,
             fCurrency: "RMB",
             fExrate: "1",
-            fTaxrate: this.fTaxrate
+            fTaxrate: this.fTaxrate,
           });
         }
         this.warehousingagreements = false;
@@ -3286,15 +3298,13 @@ export default {
       console.log(selection);
       console.log(this.form);
       this.Printinglist = selection;
+      console.log(this.Printinglist);
       this.dataListSelection = [];
       if (!selection || selection.length === 0) {
         return false;
       } else {
         for (let se in selection) {
-          if (
-            !selection[se].fBillstatus ||
-            selection[se].fBillstatus !== 40
-          ) {
+          if (!selection[se].fBillstatus || selection[se].fBillstatus !== 40) {
             this.dataListSelection.push(selection[se]);
           } else if (
             selection[se].fBillstatus &&
@@ -3304,7 +3314,7 @@ export default {
           }
         }
         if (this.dataListSelection.length > 0) {
-          console.log(selection)
+          console.log(selection);
           this.fTruckno = selection[0].fTruckno;
           this.fCntrtype = selection[0].fCntrtype;
           this.fGoodsids = selection[0].fGoodsids;
@@ -3357,20 +3367,20 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row, status) {
-      console.log(row)
+      console.log(row);
       this.browseStatus = status;
       this.reset();
       this.detailsHidden = false;
       const fId = row.fId || this.ids;
-      console.log(fId)
-      console.log(this.ids)
+      console.log(fId);
+      console.log(this.ids);
       getWarehousebills(fId).then((response) => {
         console.log(response);
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
           if (this.form.fItemsStatus !== 1) {
             this.formBrowseStatus = true;
-          }else {
+          } else {
             this.formBrowseStatus = false;
           }
         }
@@ -3455,7 +3465,7 @@ export default {
         }
         if (column.property === "fCntqty") {
           values = data.map((item) => Number(item["fCntqty"]));
-        } 
+        }
         if (
           column.property === "fPlanvolumn" ||
           column.property === "fGrossweight" ||
@@ -3521,11 +3531,13 @@ export default {
     },
     // 计划废用导入计算
     changeList(row) {
-      console.log(row)
-      console.log(this.fPlaNnumber)
-      
-     this.planningList.fPlannetweight = Number(this.planningList.fPlanqty)*Number(this.fPlaNnumber);
-     this.planningList.fPlangrossweight = Number(this.planningList.fPlanqty)*Number(this.fPlangNumber);
+      console.log(row);
+      console.log(this.fPlaNnumber);
+
+      this.planningList.fPlannetweight =
+        Number(this.planningList.fPlanqty) * Number(this.fPlaNnumber);
+      this.planningList.fPlangrossweight =
+        Number(this.planningList.fPlanqty) * Number(this.fPlangNumber);
     },
     // 数量计算
     changeContractAmt(row) {
@@ -3577,13 +3589,11 @@ export default {
       }
       if (row.fFeeUnitid === "2") {
         this.$set(row, "fQty", this.fGrossweight);
-      }else if(row.fFeeUnitid === "1") {
+      } else if (row.fFeeUnitid === "1") {
         this.$set(row, "fQty", this.fQty);
-      }
-      else if(row.fFeeUnitid === "3") {
+      } else if (row.fFeeUnitid === "3") {
         this.$set(row, "fQty", this.fNetweight);
-      }
-      else {
+      } else {
         this.$set(row, "fQty", 0);
       }
       if (row.fUnitprice) {
@@ -3608,7 +3618,7 @@ export default {
         console.log(this.dataListSelection);
         for (let warehouseCr in this.dataListSelection) {
           if (this.dataListSelection[warehouseCr].fBillstatus != 30) {
-            this.$message.error("请先卸货");
+            this.$message.error("请先打印");
             return false;
           }
           if (!this.dataListSelection[warehouseCr].fWarehouselocid) {
@@ -3631,22 +3641,22 @@ export default {
             this.$message.error("请选择入库件数");
             return false;
           }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请选择入库规格");
-            return false;
-          }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请选择入库规格");
+          //   return false;
+          // }
           if (!this.dataListSelection[warehouseCr].fDriverName) {
             this.$message.error("请输入司机姓名");
             return false;
           }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请输入司机电话");
-            return false;
-          }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请输入司机身份证");
-            return false;
-          }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请输入司机电话");
+          //   return false;
+          // }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请输入司机身份证");
+          //   return false;
+          // }
         }
         if (valid) {
           let formData = new window.FormData();
@@ -3658,13 +3668,12 @@ export default {
           );
           formData.append("whgenleg", JSON.stringify(this.relevantAttachments));
           addWhgenleg(formData).then((response) => {
-
             this.fid = response.data;
             this.formBrowseStatus = true;
             this.msgSuccess("入账成功");
             for (let li in this.dataListSelection) {
               for (let i in this.dataList) {
-                 let fQty =
+                let fQty =
                   this.dataList[i].fQty === this.dataListSelection[li].fQty;
                 let fMblno =
                   this.dataList[i].fMblno === this.dataListSelection[li].fMblno;
@@ -3707,7 +3716,6 @@ export default {
     },
     // 打印作业单
     addList() {
-      console.log("打印作业单");
       this.$refs["form"].validate((valid) => {
         if (valid) {
           let formData = new window.FormData();
@@ -3717,16 +3725,16 @@ export default {
             "warehousebillsitems",
             JSON.stringify(this.dataListSelection)
           );
-          console.log(this.dataListSelection)
+          console.log(this.dataListSelection);
           formData.append("whgenleg", JSON.stringify(this.relevantAttachments));
-          
+
           for (let li in this.dataListSelection) {
             this.dataListSelection[li].fBillstatus = 20;
             // this.dataListSelection[li].fId = 20;
           }
           console.log(this.dataListSelection);
-          console.log(this.form.fId)
-         
+          console.log(this.form.fId);
+
           addJoblist(formData).then((response) => {
             console.log(response);
             console.log(response.data.warehousebillsitems);
@@ -3758,6 +3766,7 @@ export default {
                   fNetweight &&
                   fQty
                 ) {
+                  console.log("5655665")
                   this.$set(this.dataList[i], "fBillstatus", 20);
                 }
               }
@@ -3780,7 +3789,7 @@ export default {
       );
       console.log(this.dataWithdrawList);
       updateCredit(formData).then((response) => {
-        console.log(response.data)
+        console.log(response.data);
         this.fid = response.data;
         this.formBrowseStatus = false;
         this.msgSuccess("撤销入账成功");
@@ -3820,74 +3829,143 @@ export default {
       if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
         }
-          this.$refs["form"].validate((valid) => {
-            if (valid) {
-              let formData = new window.FormData();
-              console.log(this.form);
-              formData.append("warehouseBills", JSON.stringify(this.form));
-              formData.append(
-                "warehousebillsitems",
-                JSON.stringify(this.dataListSelection)
-              );
-              formData.append(
-                "whgenleg",
-                JSON.stringify(this.relevantAttachments)
-              );
+        this.$refs["form"].validate((valid) => {
+          if (valid) {
+            let formData = new window.FormData();
+            console.log(this.form);
+            formData.append("warehouseBills", JSON.stringify(this.form));
+            formData.append(
+              "warehousebillsitems",
+              JSON.stringify(this.dataListSelection)
+            );
+            formData.append(
+              "whgenleg",
+              JSON.stringify(this.relevantAttachments)
+            );
+            for (let li in this.dataListSelection) {
+              this.dataListSelection[li].fBillstatus = 30;
+            }
+            console.log(this.dataListSelection);
+            if (!this.form.fId) {
+              this.form.fId = this.fid;
+            }
+            disChargelist(formData).then((response) => {
+              console.log(response);
+              console.log(response.data.warehousebillsitems);
               for (let li in this.dataListSelection) {
-                this.dataListSelection[li].fBillstatus = 30;
-              }
-              console.log(this.dataListSelection);
-              if (!this.form.fId) {
-            this.form.fId = this.fid;
-          }
-              disChargelist(formData).then((response) => {
-                console.log(response);
-                console.log(response.data.warehousebillsitems);
-                for (let li in this.dataListSelection) {
-                  for (let i in this.dataList) {
-                    let fQty =
-                      this.dataList[i].fQty === this.dataListSelection[li].fQty;
-                    let fBsdate =
-                      this.dataList[i].fBsdate ===
-                      this.dataListSelection[li].fBsdate;
-                    let fGoodsid =
-                      this.dataList[i].fGoodsid ===
-                      this.dataListSelection[li].fGoodsid;
-                    let fcntrtype =
-                      this.dataList[i].fcntrtype ===
-                      this.dataListSelection[li].fcntrtype;
-                    let fNetweight =
-                      this.dataList[i].fNetweight ===
-                      this.dataListSelection[li].fNetweight;
-                    let fGrossweight =
-                      this.dataList[i].fGrossweight ===
-                      this.dataListSelection[li].fGrossweight;
-                    if (
-                      fBsdate &&
-                      fGoodsid &&
-                      fcntrtype &&
-                      fGrossweight &&
-                      fNetweight &&
-                      fQty
-                    ) {
-                      this.$set(this.dataList[i], "fBillstatus", 30);
-                    }
+                for (let i in this.dataList) {
+                  let fQty =
+                    this.dataList[i].fQty === this.dataListSelection[li].fQty;
+                  let fBsdate =
+                    this.dataList[i].fBsdate ===
+                    this.dataListSelection[li].fBsdate;
+                  let fGoodsid =
+                    this.dataList[i].fGoodsid ===
+                    this.dataListSelection[li].fGoodsid;
+                  let fcntrtype =
+                    this.dataList[i].fcntrtype ===
+                    this.dataListSelection[li].fcntrtype;
+                  let fNetweight =
+                    this.dataList[i].fNetweight ===
+                    this.dataListSelection[li].fNetweight;
+                  let fGrossweight =
+                    this.dataList[i].fGrossweight ===
+                    this.dataListSelection[li].fGrossweight;
+                  if (
+                    fBsdate &&
+                    fGoodsid &&
+                    fcntrtype &&
+                    fGrossweight &&
+                    fNetweight &&
+                    fQty
+                  ) {
+                    this.$set(this.dataList[i], "fBillstatus", 30);
                   }
                 }
-                this.msgSuccess("卸货成功");
-                this.$refs.tableList.clearSelection();
-              });
-            }
-          });
-        
+              }
+              this.msgSuccess("卸货成功");
+              this.$refs.tableList.clearSelection();
+            });
+          }
+        });
       } else {
         this.$message.error("请选择需要卸货的明细!");
       }
     },
     /** 提交按钮 */
     submitForm(status) {
+          if(status === 2) {
+             this.preservation()
+          }else {
+            this.pleaseCheck()
+        }
+    },
+    // 提交保存保存成功
+    preservation() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = this.fNetweight;
+          // this.form.fPlangrossweight = this.fPlangrossweight;
+          // this.form.fPlannetweight = this.fPlannetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          // this.form.fPlanqty = this.fPlanqty;
+          this.form.fGrossweight = this.fGrossweight;
+          this.form.fQty = this.fQty;
+          if (!this.form.fId) {
+            this.form.fId = this.fid;
+          }
+        }
+      });
+       let formDatae = new window.FormData();
+          // 附件数据
+          formDatae.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(this.form);
+          // 库存明细
+          formDatae.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          console.log(this.dataList);
+          // 附件数据
+          formDatae.append(
+            "tWhgenleg",
+            JSON.stringify(this.relevantAttachments)
+          );
+          console.log(this.relevantAttachments);
+          // 费用明细付款
+          formDatae.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+           console.log(this.warehouseCrList);
+          // 收款
+          formDatae.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+          console.log(formDatae)
+      addWarehousebills(formDatae).then((response) => {
+            this.msgSuccess("保存成功");
+            console.log(response.data.warehousebillsitems)
+            this.dataList = response.data.warehousebillsitems;
+            for (let list in this.dataList) {
+              this.$set(
+                this.dataList[list],
+                "fBsdate",
+                Date.parse(this.dataList[list].fBsdate)
+              );
+            }
+            this.fid = response.data.warehouseBills.fId;
+              // this.open = true;
+            this.getList();
+            return true
+          });
+          return false
+    },
+    // 请核成功
+    pleaseCheck () {
       this.$refs["form"].validate((valid) => {
-        if (status !== 2) {
           if (this.dataList.length === 0) {
             this.$message.error("请新增库存明细!");
             return false;
@@ -3943,7 +4021,6 @@ export default {
               return false;
             }
           }
-        }
         if (valid) {
           this.form.fBillstatus = status;
           this.form.fNetweight = this.fNetweight;
@@ -3956,10 +4033,12 @@ export default {
           if (!this.form.fId) {
             this.form.fId = this.fid;
           }
-          let formData = new window.FormData();
+        }
+      
+       let formData = new window.FormData();
           // 附件数据
           formData.append("tWarehouseBills", JSON.stringify(this.form));
-          console.log(this.form)
+          console.log(this.form);
           // 库存明细
           formData.append(
             "tWarehousebillsitems",
@@ -3980,31 +4059,23 @@ export default {
             "tWarehousebillsfeesDr",
             JSON.stringify(this.warehouseDrList)
           );
-          addWarehousebills(formData).then((response) => {
+      addWarehousebills(formData).then((response) => {
             this.msgSuccess("提交成功");
-            console.log(response);
-            console.log(this.dataList);
-            if (status === 2) {
-              this.open = true;
-              // this.form = response.data.warehouseBills;
-              this.$set(this.form, "fStltypeid", this.form.fStltypeid + "");
-              this.$set(this.form, "fEta", Date.parse(this.form.fEta));
-              this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
+            this.dataList = response.data.warehousebillsitems;
+            for (let list in this.dataList) {
               this.$set(
-                this.form,
-                "createTime",
-                Date.parse(this.form.createTime)
+                this.dataList[list],
+                "fBsdate",
+                Date.parse(this.dataList[list].fBsdate)
               );
-              this.$set(this.form, "fTrademodeid", this.form.fTrademodeid + "");
-            } else {
-              this.open = false;
             }
-
+            this.fid = response.data.warehouseBills.fId;
+              this.open = false;
             this.getList();
           });
-        }
-      });
+          });
     },
+
     /** 删除按钮操作 */
     handleDelete(row) {
       const fIds = row.fId || this.ids;

+ 271 - 130
src/views/warehouseBusiness/outStock/index.vue

@@ -822,17 +822,18 @@
             "
             >{{ detailsHidden ? "隐藏" : "展开" }}</el-button
           >
-          <el-button type="primary" @click="submitForm(2)">保 存</el-button>
+          
           <!-- <el-button type="success" prop="打印" @click="showEditDialog_ss"
           >收货单
         </el-button> -->
-          <el-button type="warning" prop="打印" @click="showEditDialog_s"
-            >出库单
-          </el-button>
-          <el-button @click="discharge">卸货 </el-button>
           <el-button type="info" prop="打印" @click="showEditDialog_sss"
             >作业单
           </el-button>
+          <el-button @click="discharge">装货</el-button>
+          <el-button type="warning" prop="打印" @click="showEditDialog_s"
+            >出库单
+          </el-button>
+          <el-button type="primary" @click="submitForm(2)">保 存</el-button>
           <el-button
             style="background-color: #008000; color: #fff"
             @click="submitForm(6)"
@@ -880,7 +881,7 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fGoodsids"
+              v-model="scope.row.fGoodsid"
               filterable
               disabled
               remote
@@ -905,7 +906,7 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fWarehouselocids"
+              v-model="scope.row.fWarehouselocid"
               filterable
               remote
               disabled
@@ -935,9 +936,9 @@
               placeholder="唛头"
               :disabled="
                 browseStatus ||
-                scope.row.fBillstatus === '20' ||
-                scope.row.fBillstatus === '30' ||
-                scope.row.fBillstatus === '40'
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
               "
               show-word-limit
             />
@@ -954,7 +955,12 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fCntrtype"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="箱型"
               show-word-limit
             />
@@ -972,7 +978,12 @@
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fCntqty"
               placeholder="箱量"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -994,7 +1005,12 @@
         >
           <template slot-scope="scope">
             <el-input
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fGrossweight"
               placeholder="出库毛重"
@@ -1013,7 +1029,12 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fNetweight"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="出库净重"
               show-word-limit
             />
@@ -1031,7 +1052,12 @@
               oninput='this.value=this.value.replace(/[^\-?\d]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "")'
               @change="qtyChange(scope.row)"
               v-model="scope.row.fQty"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="出库件数"
               show-word-limit
             />
@@ -1048,7 +1074,12 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fVolumn"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="出库尺码"
               show-word-limit
             />
@@ -1065,14 +1096,19 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fPackagespecs"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="包装规格"
               show-word-limit
             />
           </template>
         </el-table-column>
 
-      <el-table-column
+      <!-- <el-table-column
           prop="fChargedate"
           header-align="center"
           align="center"
@@ -1120,7 +1156,7 @@
             >
             </el-date-picker>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column
           prop="fCntrno"
           header-align="center"
@@ -1132,7 +1168,12 @@
             <el-input
               v-model="scope.row.fCntrno"
               placeholder="箱号"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1149,7 +1190,12 @@
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fGoodsval"
               placeholder="货值"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1166,7 +1212,12 @@
               oninput="value=value.replace(/[^\d.]/g,'')"
               v-model="scope.row.fTruckno"
               placeholder="车号"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1183,7 +1234,12 @@
             <el-input
               v-model="scope.row.fDriverName"
               placeholder="司机名"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1200,7 +1256,12 @@
             <el-input
               v-model="scope.row.fDriverTel"
               placeholder="司机电话"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1217,7 +1278,12 @@
             <el-input
               v-model="scope.row.fDriverIdCa"
               placeholder="司机身份证"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1235,7 +1301,12 @@
                 v-model="scope.row.fIsPass"
                 placeholder="是否放行"
                 clearable
-                :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+                :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
                 style="width: 80%"
               >
                 <el-option
@@ -1259,7 +1330,12 @@
             <el-input
               v-model="scope.row.fSerialNumber"
               placeholder="流水号"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1275,7 +1351,12 @@
             <el-input
               v-model="scope.row.remark"
               placeholder="备注"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1292,7 +1373,7 @@
             <span v-if="scope.row.fBillstatus !== '6'">未出库</span> -->
             <span v-if="scope.row.fBillstatus === 40">已入库</span>
             <span v-if="scope.row.fBillstatus === 20">待入库</span>
-            <span v-if="scope.row.fBillstatus === 30">货中</span>
+            <span v-if="scope.row.fBillstatus === 30">货中</span>
             <span v-if="scope.row.fBillstatus === 10">计划</span>
           </template>
         </el-table-column>
@@ -1306,7 +1387,12 @@
             <el-button
               @click.native.prevent="deleteRow(scope.$index, dataList)"
               size="small"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               >移除</el-button
             >
           </template>
@@ -1911,7 +1997,7 @@
         <el-button type="warning" prop="打印" @click="showEditDialog_s"
           >出库单
         </el-button>
-        <el-button @click="discharge">货 </el-button>
+        <el-button @click="discharge">货 </el-button>
         <el-button type="info" prop="打印" @click="showEditDialog_sss"
           >作业单
         </el-button>
@@ -2569,7 +2655,22 @@
             <td width="200">车号</td>
             <td width="200">{{ item.fTruckno }}</td>
             <td width="200">货物品名</td>
-            <td width="200" colspan="4" class="zzss">{{ item.fGoodsids }}</td>
+            <td width="200" colspan="4" class="zzss">
+               <el-select
+              v-model="item.fGoodsid"
+              filterable
+              remote
+              :remote-method="goodsRemoteMethod"
+              placeholder="请选择品名"
+            >
+              <el-option
+                v-for="(dict, index) in goodsOptions"
+                :key="index.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
+            </td>
           </tr>
           <tr>
             <td width="1400" colspan="6">&nbsp;</td>
@@ -3224,6 +3325,12 @@ export default {
     },
     // 作业单打印
     showEditDialog_sss() {
+      for (let li in this.Printinglist) {
+        if(!this.Printinglist[li].fId) {
+          this.$message.error("请先保存!");
+          return false;
+        }
+      }
       if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
           if (
@@ -3526,6 +3633,7 @@ export default {
       this.detailsHidden = false;
       let data = row || this.ids;
       getWarehousebills(data.fId).then((response) => {
+        console.log(response)
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
           this.$set(this.form, "fEta", Date.parse(this.form.fEta));
@@ -3793,7 +3901,7 @@ export default {
       this.$refs["form"].validate((valid) => {
         for (let warehouseCr in this.dataListSelection) {
           if (this.dataListSelection[warehouseCr].fBillstatus != 30) {
-            this.$message.error("请先卸货");
+            this.$message.error("请先打印");
             return false;
           }
           if (!this.dataListSelection[warehouseCr].fGrossweight) {
@@ -3808,10 +3916,10 @@ export default {
             this.$message.error("请维护出库件数");
             return false;
           }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请维护包装规格");
-            return false;
-          }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请维护包装规格");
+          //   return false;
+          // }
         }
         if (valid) {
           let formData = new window.FormData();
@@ -3991,7 +4099,7 @@ export default {
         }
       });
     },
-     // 货按钮
+     // 货按钮
     discharge() {
      if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
@@ -4057,13 +4165,13 @@ export default {
               }
               // }
             }
-                this.msgSuccess("货成功");
+                this.msgSuccess("货成功");
                 this.$refs.tableList.clearSelection();
               });
             }
           });
       } else {
-        this.$message.error("请选择需要货的明细!");
+        this.$message.error("请选择需要货的明细!");
       }
     },
     // 付款信息计价单位合计
@@ -4149,57 +4257,80 @@ export default {
     },
     /** 提交按钮 */
     submitForm(status) {
+      if(status === 2) {
+             this.preservation()
+          }else {
+            this.pleaseCheck()
+        }
+    },
+     // 提交保存保存成功
+    preservation() {
       this.$refs["form"].validate((valid) => {
-        console.log(this.dataList);
-        if (status === 2) {
-          if (valid) {
-            this.form.fBillstatus = status;
-            this.form.fNetweight = this.fNetweight;
-            this.form.fPlangrossweight = this.fPlangrossweight;
-            this.form.fPlannetweight = this.fPlannetweight;
-            this.form.fPlanvolumn = this.fPlanvolumn;
-            this.form.fPlanqty = this.fPlanqty;
-            this.form.fGrossweight = this.fGrossweight;
-            this.form.fQty = this.fQty;
-            if (!this.form.fId) {
-              this.form.fId = this.fid;
-            }
-            let formData = new window.FormData();
-            // 附件数据
-            formData.append("tWarehouseBills", JSON.stringify(this.form));
-            // 库存明细
-            formData.append(
-              "tWarehousebillsitems",
-              JSON.stringify(this.dataList)
-            );
-            // 附件数据
-            formData.append(
-              "tWhgenleg",
-              JSON.stringify(this.relevantAttachments)
-            );
-            // 费用明细付款
-            formData.append(
-              "tWarehousebillsfeesCr",
-              JSON.stringify(this.warehouseCrList)
-            );
-            // 收款
-            formData.append(
-              "tWarehousebillsfeesDr",
-              JSON.stringify(this.warehouseDrList)
-            );
-            addWarehousebills(formData).then((response) => {
-              console.log(response)
-              this.msgSuccess("提交成功");
-              if (status === 2) {
-                this.open = true;
-              } else {
-                this.open = false;
-              }
-              this.getList();
-            });
+        if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = this.fNetweight;
+          this.form.fPlangrossweight = this.fPlangrossweight;
+          this.form.fPlannetweight = this.fPlannetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          this.form.fPlanqty = this.fPlanqty;
+          this.form.fGrossweight = this.fGrossweight;
+          this.form.fQty = this.fQty;
+          if (!this.form.fId) {
+            this.form.fId = this.fid;
           }
-        } else {
-          if (this.dataList.length === 0) {
+        }
+      });
+       let formDatae = new window.FormData();
+          // 附件数据
+          formDatae.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(this.form);
+          // 库存明细
+          formDatae.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          console.log(this.dataList);
+          // 附件数据
+          formDatae.append(
+            "tWhgenleg",
+            JSON.stringify(this.relevantAttachments)
+          );
+          console.log(this.relevantAttachments);
+          // 费用明细付款
+          formDatae.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+           console.log(this.warehouseCrList);
+          // 收款
+          formDatae.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+          console.log(formDatae)
+      addWarehousebills(formDatae).then((response) => {
+            this.msgSuccess("保存成功");
+            this.dataList = response.data.warehousebillsitems;
+            console.log(response.data.warehousebillsitems)
+            console.log(this.dataList)
+            // for (let list in this.dataList) {
+            //   this.$set(
+            //     this.dataList[list],
+            //     "fGoodsids",
+            //     Date.parse(this.dataList[list].fGoodsid + '')
+            //   );
+            // }
+            this.fid = response.data.warehouseBills.fId;
+              // this.open = true;
+            this.getList();
+            return true
+          });
+          return false
+    },
+    // 请核成功
+    pleaseCheck () {
+      this.$refs["form"].validate((valid) => {
+           if (this.dataList.length === 0) {
             this.$message.error("请新增库存明细!");
             return false;
           }
@@ -4258,49 +4389,59 @@ export default {
               return false;
             }
           }
-          if (valid) {
-            this.form.fBillstatus = status;
-            this.form.fNetweight = this.fNetweight;
-            this.form.fPlangrossweight = this.fPlangrossweight;
-            this.form.fPlannetweight = this.fPlannetweight;
-            this.form.fPlanvolumn = this.fPlanvolumn;
-            this.form.fPlanqty = this.fPlanqty;
-            this.form.fGrossweight = this.fGrossweight;
-            this.form.fQty = this.fQty;
-            if (!this.form.fId) {
-              this.form.fId = this.fid;
-            }
-            let formData = new window.FormData();
-            // 附件数据
-            formData.append("tWarehouseBills", JSON.stringify(this.form));
-            // 附件数据
-            formData.append(
-              "tWhgenleg",
-              JSON.stringify(this.relevantAttachments)
-            );
-            // // 费用明细付款
-            formData.append(
-              "tWarehousebillsfeesCr",
-              JSON.stringify(this.warehouseCrList)
-            );
-            // // 收款
-            formData.append(
-              "tWarehousebillsfeesDr",
-              JSON.stringify(this.warehouseDrList)
-            );
-            // // 库存明细
-            formData.append(
-              "tWarehousebillsitems",
-              JSON.stringify(this.dataList)
-            );
-            addWarehousebills(formData).then((response) => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+        if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = this.fNetweight;
+          this.form.fPlangrossweight = this.fPlangrossweight;
+          this.form.fPlannetweight = this.fPlannetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          this.form.fPlanqty = this.fPlanqty;
+          this.form.fGrossweight = this.fGrossweight;
+          this.form.fQty = this.fQty;
+          if (!this.form.fId) {
+            this.form.fId = this.fid;
           }
         }
-      });
+      
+       let formData = new window.FormData();
+          // 附件数据
+          formData.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(this.form);
+          // 库存明细
+          formData.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          // 附件数据
+          formData.append(
+            "tWhgenleg",
+            JSON.stringify(this.relevantAttachments)
+          );
+          // 费用明细付款
+          formData.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+          // 收款
+          formData.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+      addWarehousebills(formData).then((response) => {
+            this.msgSuccess("提交成功");
+            this.dataList = response.data.warehousebillsitems;
+            for (let list in this.dataList) {
+              this.$set(
+                this.dataList[list],
+                "fBsdate",
+                Date.parse(this.dataList[list].fBsdate)
+              );
+            }
+            this.fid = response.data.warehouseBills.fId;
+              this.open = false;
+            this.getList();
+          });
+          });
     },
     /** 删除按钮操作 */
     handleDelete(row) {