浏览代码

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

caojunjie 4 年之前
父节点
当前提交
a4e0af1583

+ 796 - 0
src/views/analysis/stock/index.vue

@@ -0,0 +1,796 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="testParams"
+      ref="testParams"
+      :inline="true"
+      v-show="showSearch"
+      label-width="88px"
+    >
+      <el-form-item label="货权方" prop="fCorpid">
+        <el-input
+          v-model="testParams.fCorpid"
+          placeholder="请输入货权方"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="货物名称" prop="fgoodsid">
+        <el-select v-model="testParams.fgoodsid" placeholder="请选择">
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="提单号" prop="fmblno">
+        <el-input
+          v-model="testParams.fmblno"
+          placeholder="请输入提单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="入库日期" prop="fbsdate">
+        <el-date-picker
+          clearable
+          size="small"
+          v-model="testParams.fbsdate"
+          type="date"
+          value-format="timestamp"
+          placeholder="选择入库日期"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <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>
+    <el-table
+      v-loading="loading"
+      :data="testDate"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="index" label="序号" align="center" />
+      <el-table-column label="货主" align="center" prop="hz" />
+      <el-table-column label="提单号" align="center" prop="tdh" />
+      <el-table-column label="报关单号" align="center" prop="bgdh" />
+      <el-table-column label="客户存货单号" align="center" prop="khkhdh" />
+      <el-table-column label="经营单位" align="center" prop="jydw" />
+      <el-table-column label="到港日期" align="center" prop="dgrq" />
+      <el-table-column label="入库日期" align="center" prop="rkrq" />
+      <el-table-column label="仓库" align="center" prop="ck" />
+      <el-table-column label="库位" align="center" prop="kw" />
+      <el-table-column label="货物名称" align="center" prop="hwmc" />
+      <el-table-column label="包装规格" align="center" prop="bzgg" />
+      <el-table-column label="计费单位" align="center" prop="jfdw" />
+      <el-table-column label="入库毛重" align="center" prop="rkmz" />
+      <el-table-column label="入库净重" align="center" prop="rkjz" />
+      <el-table-column label="入库尺码" align="center" prop="rucm" />
+      <el-table-column label="入库件数" align="center" prop="rkjs" />
+      <el-table-column label="出库毛重" align="center" prop="ckmz" />
+      <el-table-column label="出库净重" align="center" prop="ckjz" />
+      <el-table-column label="出库尺码" align="center" prop="ckcm" />
+      <el-table-column label="出库件数" align="center" prop="ckjs" />
+      <el-table-column label="结余毛重" align="center" prop="jymz" />
+      <el-table-column label="结余净重" align="center" prop="jyjz" />
+      <el-table-column label="结余尺码" align="center" prop="jycm" />
+      <el-table-column label="结余件数" align="center" prop="jyjs" />
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {
+  listWarehousebills,
+  getWarehousebills,
+  delWarehousebills,
+  addWarehousebills,
+  updateWarehousebills,
+  exportWarehousebills,
+} from "@/api/warehouseBusiness/warehouseInStock";
+
+import { listCorps } from "@/api/basicdata/corps";
+
+import { listWarehouse } from "@/api/basicdata/warehouse";
+
+import { listGoods } from "@/api/basicdata/goods";
+
+import { listUser, queryUserVal } from "@/api/system/user";
+
+export default {
+  name: "Warehousebills",
+  components: {},
+  data() {
+    return {
+      testDate: [
+        {
+          hz: "易车配",
+          tdh: "M098765",
+          bgdh: "6789593",
+          khkhdh: "CH098",
+          jydw: "易车配",
+          dgrq: "2020/1/1",
+          rkrq: "2020/1/4",
+          ck: "1号库",
+          kw: "K1",
+          hwmc: "棉花",
+          bzgg: "5*5",
+          jfdw: "尺码",
+          rkmz: "1000",
+          rkjz: "900",
+          rucm: "100",
+          rkjs: "5",
+          ckmz: "1312",
+          ckjz: "22",
+          ckcm: "123",
+          ckjs: "12",
+          jymz: "213",
+          jyjz: "321",
+          jycm: "321",
+          jyjs: "44",
+        },
+        {
+          hz: "中外运",
+          tdh: "Z089222",
+          bgdh: "8890879",
+          khkhdh: "CH200",
+          jydw: "中棉",
+          dgrq: "2020/1/1",
+          rkrq: "2020/1/4",
+          ck: "1号库",
+          kw: "K1",
+          hwmc: "棉花",
+          bzgg: "5*5",
+          jfdw: "尺码",
+          rkmz: "1000",
+          rkjz: "900",
+          rucm: "100",
+          rkjs: "5",
+          ckmz: "10",
+          ckjz: "10",
+          ckcm: "10",
+          ckjs: "10",
+          jymz: "10",
+          jyjz: "10",
+          jycm: "10",
+          jyjs: "10",
+        },
+      ],
+      testParams: {
+          fCorpid:"",
+          fmblno:"",
+          fbsdate:"",
+          fgoodsid: ""
+      },
+      options:[
+          {
+            value: "选项1",
+            label: "棉花",
+          },
+          {
+            value: "选项2",
+            label: "钢铁",
+          }
+        ],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      userVal: {
+        userName: null,
+        nickName: null,
+        deptId: null,
+      },
+      queryForm: {},
+      dataList: [],
+      warehouseCrList: [],
+      warehouseDrList: [],
+      browseStatus: false,
+      relevantAttachments: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 仓库主(出入库)表格数据
+      warehousebillsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 货权方(客户数据)
+      fMblnoOptions: [],
+      // 货权方(客户数据)
+      fSbuOptions: [],
+      // 操作员
+      userOptions: [],
+      // 操作员
+      goodsOptions: [],
+      // 制单部门
+      deptOptions: [],
+      // 仓库(仓库数据)
+      warehouseOptions: [],
+      // 贸易方式(数据字典),对应t_trademodels 字典
+      fTrademodeidOptions: [],
+      // 计费单位(数据字典),下拉选择毛重或净重字典
+      fFeetunitOptions: [],
+      // 结算方式(数据字典),下拉选择字典
+      fStltypeOptions: [],
+      // 是否过磅(数据字典)默认 F ,过磅T 否者F 下拉选择字典
+      fIfweighOptions: [],
+      // 是否质押(数据字典),默认 F ,质押T 否者F 下拉选择字典
+      fIfpledgeOptions: [],
+      // 是否破损(数据字典),默认F否则T字典
+      fIfdamageOptions: [],
+      // 单据类型(数据字典)SJRK字典
+      fBilltypeOptions: [],
+      // 状态(数据字典),N 入字典
+      fBillstatusOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        fBillno: null,
+        createBy: null,
+        createTime: null,
+        fCustomsdeclartion: null,
+        fOriginalbillno: null,
+        fDeptid: null,
+        fBsdeptid: null,
+        fContacts: null,
+        fTel: null,
+        fCorpid: null,
+        fTocorpid: null,
+        fStltypeid: null,
+        fBscorpno: null,
+        fWarehouseid: null,
+        fStorekeeper: null,
+        fBsdate: null,
+        fPlanqty: null,
+        fPlangrossweight: null,
+        fPlannetweight: null,
+        fPlanvolumn: null,
+        fQty: null,
+        fGrossweight: null,
+        fNetweight: null,
+        fVolumn: null,
+        fTrademodeid: null,
+        fSbu: null,
+        fFeetunit: null,
+        fMblno: null,
+        fVslvoy: null,
+        fEta: null,
+        fCustomno: null,
+        fIfweigh: null,
+        fIfpledge: null,
+        fIfdamage: null,
+        fBankcorpid: null,
+        fBilltype: null,
+        fBillstatus: null,
+        fCreateby: null,
+        fCreatetime: null,
+        fGoodsid: null,
+        fCntrtype: null,
+        fCntqty: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        fDeptid: [
+          { required: true, message: "制单部门不能为空", trigger: "blur" },
+        ],
+        fBsdeptid: [
+          { required: true, message: "业务所属部门不能为空", trigger: "blur" },
+        ],
+        fCorpid: [
+          {
+            required: true,
+            message:
+              "客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name不能为空",
+            trigger: "blur",
+          },
+        ],
+        fTocorpid: [
+          {
+            required: true,
+            message:
+              "货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效不能为空",
+            trigger: "blur",
+          },
+        ],
+        fBscorpno: [
+          {
+            required: true,
+            message:
+              "客户存货编号,格式编号客户编号+YYYY +NNNN,编号不能断号,要连续、如果删除该编号,下次新建单据,优先使用,每年从001开始不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("data_trademodes").then((response) => {
+      this.fTrademodeidOptions = response.data;
+    });
+    this.getDicts("data_unitfees").then((response) => {
+      this.fFeetunitOptions = response.data;
+    });
+    this.getDicts("data_stltype_type").then((response) => {
+      this.fStltypeOptions = response.data;
+    });
+    this.getDicts("data_ifweigh_status").then((response) => {
+      this.fIfweighOptions = response.data;
+    });
+    this.getDicts("data_ifpledge_status").then((response) => {
+      this.fIfpledgeOptions = response.data;
+    });
+    this.getDicts("data_ifdamage_status").then((response) => {
+      this.fIfdamageOptions = response.data;
+    });
+    this.getDicts("data_billtype_type").then((response) => {
+      this.fBilltypeOptions = response.data;
+    });
+    this.getDicts("sys_common_status").then((response) => {
+      this.fBillstatusOptions = response.data;
+    });
+  },
+  methods: {
+    // 添加list
+    addRelevant() {
+      console.log(JSON.stringify(this.dataList));
+      this.dataList.push({
+        fbsdate: null,
+        fgoodsid: null,
+        fcntrtype: null,
+        fCntqty: null,
+        fplangrossweight: null,
+        fplanvolumn: null,
+        fplanqty: null,
+        fgrossweight: null,
+        fqty: null,
+        fPackagespecs: null,
+        fwarehouselocid: null,
+        fBoxno: null,
+        fGoodsval: null,
+        ftruckno: null,
+        remark: null,
+      });
+    },
+    addRelevt() {
+      this.relevantAttachments.push({
+        attachName: null,
+        opUserName: null,
+        opDate: null,
+        attachId: null,
+      });
+    },
+    // 收款信息
+    addCollection() {
+      var obj = {};
+      this.warehouseDrList.push(obj);
+    },
+    addpayment() {
+      var obj = {};
+      this.warehouseCrList.push(obj);
+    },
+    queryUser() {
+      queryUserVal().then((response) => {
+        if (response.user !== null) {
+          this.userVal = response.user;
+          this.$set(this.form, "fDeptid", this.userVal.deptId);
+          this.$set(this.form, "createBy", this.userVal.userName);
+          this.$set(this.form, "createTime", Date.parse(new Date()));
+        }
+        if (response.dept !== null) {
+          this.deptOptions = [];
+          this.deptOptions.push(response.dept);
+        }
+      });
+    },
+    /** 查询仓库主(出入库)列表 */
+    getList() {
+      this.loading = true;
+      listWarehousebills(this.queryParams).then((response) => {
+        this.warehousebillsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 贸易方式(数据字典),对应t_trademodels 字典翻译
+    fTrademodeidFormat(row, column) {
+      return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
+    },
+    // 计费单位(数据字典),下拉选择毛重或净重字典翻译
+    fFeetunitFormat(row, column) {
+      return this.selectDictLabel(this.fFeetunitOptions, row.fFeetunit);
+    },
+    // 是否过磅(数据字典)默认 F ,过磅T 否者F 下拉选择字典翻译
+    fIfweighFormat(row, column) {
+      return this.selectDictLabel(this.fIfweighOptions, row.fIfweigh);
+    },
+    // 是否质押(数据字典),默认 F ,质押T 否者F 下拉选择字典翻译
+    fIfpledgeFormat(row, column) {
+      return this.selectDictLabel(this.fIfpledgeOptions, row.fIfpledge);
+    },
+    // 是否破损(数据字典),默认F否则T字典翻译
+    fIfdamageFormat(row, column) {
+      return this.selectDictLabel(this.fIfdamageOptions, row.fIfdamage);
+    },
+    // 单据类型(数据字典)SJRK字典翻译
+    fBilltypeFormat(row, column) {
+      return this.selectDictLabel(this.fBilltypeOptions, row.fBilltype);
+    },
+    // 状态(数据字典),N 入字典翻译
+    fBillstatusFormat(row, column) {
+      return this.selectDictLabel(this.fBillstatusOptions, row.fBillstatus);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        fId: null,
+        fBillno: null,
+        fCustomsdeclartion: null,
+        fOriginalbillno: null,
+        fDeptid: null,
+        fBsdeptid: null,
+        fContacts: null,
+        fTel: null,
+        fCorpid: null,
+        fTocorpid: null,
+        fStltypeid: null,
+        fBscorpno: null,
+        fWarehouseid: null,
+        fStorekeeper: null,
+        fBsdate: null,
+        fPlanqty: null,
+        fPlangrossweight: null,
+        fPlannetweight: null,
+        fPlanvolumn: null,
+        fQty: null,
+        fGrossweight: null,
+        fNetweight: null,
+        fVolumn: null,
+        fTrademodeid: null,
+        fSbu: null,
+        fFeetunit: null,
+        fMblno: null,
+        fVslvoy: null,
+        fEta: null,
+        fCustomno: null,
+        fIfweigh: null,
+        fIfpledge: null,
+        fIfdamage: null,
+        fBankcorpid: null,
+        fBilltype: null,
+        fBillstatus: null,
+        delFlag: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null,
+        fCreateby: null,
+        fCreatetime: null,
+        fGoodsid: null,
+        fCntrtype: null,
+        fCntqty: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+        this.testParams={
+          fCorpid:null,
+          fmblno:null,
+          fbsdate:null,
+          fgoodsid:null,
+      },
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.fId);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    checkType() {},
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.queryUser();
+      this.open = true;
+      this.title = "入库单";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const fId = row.fid || this.ids;
+      getWarehousebills(row.fid).then((response) => {
+        this.form = response.data.warehousebills;
+        this.$set(this.form, "fCorpid", response.data.warehousebills.fcorpid);
+        this.$set(
+          this.form,
+          "fWarehouseid",
+          response.data.warehousebills.fwarehouseid
+        );
+        this.$set(
+          this.form,
+          "fContacts",
+          response.data.warehousebills.fcontacts
+        );
+        this.$set(this.form, "fTel", response.data.warehousebills.ftel);
+        this.$set(this.form, "fMblno", response.data.warehousebills.fmblno);
+        this.$set(
+          this.form,
+          "fBsdate",
+          Date.parse(response.data.warehousebills.fbsdate)
+        );
+        this.$set(
+          this.form,
+          "fStorekeeper",
+          response.data.warehousebills.fstorekeeper
+        );
+        this.$set(this.form, "createBy", response.data.warehousebills.createBy);
+        this.$set(this.form, "fDeptid", response.data.warehousebills.fdeptid);
+        this.$set(
+          this.form,
+          "fDilldate",
+          Date.parse(response.data.warehousebills.fbilldate)
+        );
+        this.$set(this.form, "fVslvoy", response.data.warehousebills.fvslvoy);
+        this.$set(
+          this.form,
+          "fEta",
+          Date.parse(response.data.warehousebills.feta)
+        );
+        this.$set(
+          this.form,
+          "createTime",
+          Date.parse(response.data.warehousebills.createTime)
+        );
+        this.$set(
+          this.form,
+          "fTrademodeid",
+          response.data.warehousebills.ftrademodeid + ""
+        );
+        this.$set(
+          this.form,
+          "fBillingway",
+          response.data.warehousebills.fbillingway + ""
+        );
+        this.$set(
+          this.form,
+          "fFeetunit",
+          response.data.warehousebills.ffeetunit + ""
+        );
+        this.$set(
+          this.form,
+          "fBscorpno",
+          response.data.warehousebills.fbscorpno
+        );
+        this.$set(
+          this.form,
+          "fCustomno",
+          response.data.warehousebills.fcustomno
+        );
+        this.$set(
+          this.form,
+          "fStltypeid",
+          response.data.warehousebills.fstltypeid + ""
+        );
+        this.$set(
+          this.form,
+          "fIfweigh",
+          response.data.warehousebills.fifweigh + ""
+        );
+        this.$set(
+          this.form,
+          "fIfdamage",
+          response.data.warehousebills.fifdamage + ""
+        );
+        this.$set(this.form, "fSbu", response.data.warehousebills.fsbu);
+        this.$set(
+          this.form,
+          "fIfpledge",
+          response.data.warehousebills.fifpledge + ""
+        );
+        this.$set(
+          this.form,
+          "fBankcorpid",
+          response.data.warehousebills.fbankcorpid
+        );
+        this.$set(this.form, "remark", response.data.warehousebills.remark);
+        this.deptOptions = [];
+        this.deptOptions.push(response.data.dept);
+        this.fMblnoOptions = [];
+        this.fMblnoOptions.push(response.data.fCorps);
+        if (response.data.fSbu !== null) {
+          this.fSbuOptions = [];
+          this.fSbuOptions.push(response.data.fSbu);
+        }
+        if (response.data.warehouse !== null) {
+          this.warehouseOptions = [];
+          this.warehouseOptions.push(response.data.warehouse);
+        }
+        if (
+          typeof response.data.warehouseBillsItem !== "undefined" &&
+          response.data.warehouseBillsItem !== null
+        ) {
+          this.dataList = response.data.warehouseBillsItem;
+          if (response.data.goodsList !== null) {
+            this.goodsOptions = [];
+            this.goodsOptions = response.data.goodsList;
+          }
+        }
+        this.open = true;
+        this.title = "修改仓库主(出入库)";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          // let formData = new FormData()
+          // console.log(JSON.stringify(this.form));
+          // formData.append('tWarehouseBills', JSON.stringify(this.formData))
+          let formData = new window.FormData();
+          // 附件数据
+          formData.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(JSON.stringify(this.form));
+          // 附件数据
+          formData.append("tWhgenleg", null);
+          // // 费用明细付款
+          formData.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+          // // 收款
+          formData.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+          // // 库存明细
+          formData.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          // 附件数据
+          // formData.append('tWhgenleg', dataForm)
+          // // 费用明细付款
+          // formData.append('tWarehousebillsfeesCr', dataForm)
+          // // 收款
+          // formData.append('tWarehousebillsfeesDr"', dataForm)
+          // // 库存明细
+          // formData.append('tWarehousebillsitems', dataForm)
+          addWarehousebills(formData).then((response) => {
+            console.log(response);
+            this.msgSuccess("新增成功");
+            this.open = false;
+            this.getList();
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const fIds = row.fId || this.ids;
+      this.$confirm(
+        '是否确认删除仓库主(出入库)编号为"' + fIds + '"的数据项?',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(function () {
+          return delWarehousebills(fIds);
+        })
+        .then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm("是否确认导出所有仓库主(出入库)数据项?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return exportWarehousebills(queryParams);
+        })
+        .then((response) => {
+          this.download(response.msg);
+        });
+    },
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
+    /* 远程模糊查询用户 */
+    corpsRemoteMethod(name) {
+      if (name == null || name === "") {
+        return false;
+      }
+      let queryParams = { pageNum: 1, pageSize: 10, fName: name };
+      listCorps(queryParams).then((response) => {
+        this.fMblnoOptions = response.rows;
+      });
+    },
+    /* 远程模糊查询商品 */
+    goodsRemoteMethod(name) {
+      if (name == null || name === "") {
+        return false;
+      }
+      let queryParams = { pageNum: 1, pageSize: 10, fName: name };
+      listGoods(queryParams).then((response) => {
+        this.goodsOptions = response.rows;
+      });
+    },
+    /* 远程模糊查询经营单位 */
+    fSbuRemoteMethod(name) {
+      if (name == null || name === "") {
+        return false;
+      }
+      let queryParams = { pageNum: 1, pageSize: 10, fName: name };
+      listCorps(queryParams).then((response) => {
+        this.fSbuOptions = response.rows;
+      });
+    },
+    /* 远程模糊查询仓库 */
+    warehouseRemoteMethod(name) {
+      if (name == null || name === "") {
+        return false;
+      }
+      let queryParams = { pageNum: 1, pageSize: 10, fName: name };
+      listWarehouse(queryParams).then((response) => {
+        this.warehouseOptions = response.rows;
+      });
+    },
+    /* 远程模糊查询操作用户 */
+    userRemoteMethod(name) {
+      if (name == null || name === "") {
+        return false;
+      }
+      let queryParams = { pageNum: 1, pageSize: 10, userName: name };
+      listUser(queryParams).then((response) => {
+        this.userOptions = response.rows;
+      });
+    },
+  },
+};
+</script>

+ 324 - 0
src/views/warehouseBusiness/inStock/index.vue

@@ -1319,14 +1319,294 @@
         </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">
+        <el-button
+          type="danger"
+          size="mini"
+          prop="打印"
+          @click="showEditDialog_ss"
+          >收货单
+        </el-button>
+        <el-button
+          type="danger"
+          size="mini"
+          prop="打印"
+          @click="showEditDialog_s"
+          >入库单
+        </el-button>
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
+      <el-dialog
+        title="入库页面"
+        :modal= false
+        style="box-shadow: 0 1px 3px rgba(0, 0, 0, 0) !important"
+        :visible.sync="editDialogVisible_s"
+        width="70%"
+        
+      >
+        <table
+          id="print_area"
+          class="biaoge zzss"
+          border="1"
+          style="border-collapse: collapse; border: none"
+        >
+          <tr>
+            <td
+              width="100"
+              colspan="7"
+              class="zzss"
+              style=" font-size: 28px; font-weight: bold; border: none"
+            >
+              青岛大木进进仓单
+            </td>
+          </tr>
+          <tr>
+            <td
+              width="100"
+              colspan="7"
+              class="zzss"
+              style="font-size: 28px; font-weight: bold; border: none"
+            >
+              &nbsp;
+            </td>
+          </tr>
+          <tr>
+            <td width="450" colspan="2" class="zzss">货权方:某某有限公司</td>
+            <td width="450" colspan="2" class="zzss">仓库:某某3号大仓</td>
+            <td width="450" colspan="3" class="zzss">
+              地址:青岛市市北区郑州路1344号
+            </td>
+          </tr>
+          <tr>
+            <td width="200" colspan="2" class="zzss">保管方:某某有限公司</td>
+            <td width="200" colspan="2" class="zzss">联系人:张三</td>
+            <td width="200" colspan="3" class="zzss">
+              电话:0532-561651561-546
+            </td>
+          </tr>
+          <tr>
+            <td width="100" border="1">提单号</td>
+            <td width="100">品名</td>
+            <td width="100">箱型</td>
+            <td width="100">品牌</td>
+            <td width="100">件数</td>
+            <td width="100">重量</td>
+            <td width="100">包装规格</td>
+          </tr>
+          <tr>
+            <td width="100">56165654555</td>
+            <td width="100">某某商品</td>
+            <td width="100">20GP</td>
+            <td width="100">某某</td>
+            <td width="100">包</td>
+            <td width="100">吨</td>
+            <td width="100">50kg</td>
+          </tr>
+          <tr>
+            <td width="100">序号</td>
+            <td width="100">入货日期</td>
+            <td width="100">箱量(20GP)</td>
+            <td width="100">重量</td>
+            <td width="100">件数</td>
+            <td width="100">入库重量</td>
+            <td width="100">入库件数</td>
+          </tr>
+          <tr>
+            <td width="100">1</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">2</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">3</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">4</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">5</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">6</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">7</td>
+            <td width="100">2020-11-20</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100" colspan="2">合计:</td>
+            <td width="100">10</td>
+            <td width="100">100</td>
+            <td width="100">10000</td>
+            <td width="100">20</td>
+            <td width="100">3000</td>
+          </tr>
+          <tr>
+            <td width="100">备注:</td>
+            <td width="100" colspan="6"></td>
+          </tr>
+          <tr>
+            <td width="100" colspan="7" class="zzss">
+              本进仓单经仓管员签字并经保管方盖章后即专项作为货物所有人的货权证明,本单据不得转让。
+            </td>
+          </tr>
+          <tr style="border: none">
+            <td width="100" colspan="2" class="zzss" style="border: none">
+              开单员:
+            </td>
+            <td width="100" colspan="3" class="zzss" style="border: none"></td>
+            <td width="100" colspan="2" class="zzss" style="border: none">
+              仓管员:张三
+            </td>
+          </tr>
+          <tr style="border: none">
+            <td width="100" colspan="2" class="zzss" style="border: none">
+              开单时间:
+            </td>
+            <td width="100" colspan="3" class="zzss" style="border: none"></td>
+            <td width="100" colspan="2" class="zzss" style="border: none">
+              (盖章)
+            </td>
+          </tr>
+        </table>
+        <button @click="printSomething">打印</button>
+      </el-dialog>
+      <el-dialog
+        title="收货单打印"
+        style="box-shadow: 0 1px 3px rgba(0, 0, 0, 0) !important"
+        :visible.sync="editDialogVisible_ss"
+        width="70%"
+        :modal= false
+      >
+        <table
+          id="print_area"
+          class="biaoge zzss"
+          border="1"
+          style="border-collapse: collapse; border: none"
+        >
+          <tr>
+            <td
+              width="1400"
+              colspan="6"
+              class="zzss"
+              style="font-size: 28px; font-weight: bold; border: none"
+            >
+              大木国际物流(青岛)有限公司收货单
+            </td>
+          </tr>
+          <tr>
+            <td
+              width="900"
+              colspan="4"
+              class="zzss"
+              style="font-size: 28px; font-weight: bold"
+            >
+              &nbsp;
+            </td>
+            <td
+              width="500"
+              colspan="2"
+              style="padding-bottom: 0px; font-weight: bold; border: none"
+              class="zzss"
+            >
+              出库日期:2020-11-20
+            </td>
+          </tr>
+          <tr>
+            <td width="200">车号</td>
+            <td width="200">苏HFN751</td>
+            <td width="200">货物品名</td>
+            <td width="200" colspan="4" class="zzss">某某商品名</td>
+          </tr>
+          <tr>
+            <td width="1400" colspan="6">&nbsp;</td>
+          </tr>
+          <tr>
+            <td>备注:</td>
+            <td colspan="5"></td>
+          </tr>
+          <tr>
+            <td>收费</td>
+            <td>装箱费</td>
+            <td>100元</td>
+            <td colspan="4">办单费:5元,过磅费自理</td>
+          </tr>
+          <tr>
+            <td>司机签字:</td>
+            <td></td>
+            <td>电话</td>
+            <td>15896154516</td>
+            <td colspan="2" rowspan="2">
+              确认货物数量无误,包装于货物完好!<br />出库盖好篷布,如有违背责任自负<br />装卸工是否收小费
+            </td>
+          </tr>
+          <tr>
+            <td>制表:</td>
+            <td>张三</td>
+            <td>机械/人工:</td>
+            <td></td>
+          </tr>
+          <tr>
+            <td colspan="6" class="zzss">&nbsp;</td>
+          </tr>
+          <tr>
+            <td width="280" class="zzss"></td>
+            <td width="280" class="zzss"></td>
+            <td width="280" class="zzss"></td>
+            <td width="280" class="zzss"></td>
+            <td width="290" class="zzss">地址:淮河东路96号</td>
+            <td width="290" class="zzss">电话:18685818919</td>
+          </tr>
+        </table>
+        <button @click="printSomething">打印</button>
+      </el-dialog>
     </el-dialog>
   </div>
 </template>
 
 <script>
+import print from 'print-js'
   import {
     listWarehousebills,
     getWarehousebills,
@@ -1359,6 +1639,10 @@
           deptId: null
         },
         queryForm: {},
+        // 添加用户对话框
+      editDialogVisible_s: false,
+      editDialogVisible_ss: false,
+      editDialogClosed_ss: false,
         dataList: [],
         warehouseCrList: [],
         warehouseDrList: [],
@@ -1518,6 +1802,17 @@
       });
     },
     methods: {
+        printSomething() {
+      // 此处的style即为打印时的样式
+      const style =
+        "@media print { .print-div{ padding:8px;background-color:#cccccc;line-height:12px } .red{ color:#f00} .green{color:green} td{text-align: center}}";
+      print({
+        printable: "print_area",
+        type: "html",
+        style: style, // 亦可使用引入的外部css;
+        scanStyles: false,
+      });
+    },
       // 添加list
       addRelevant() {
         console.log(JSON.stringify(this.dataList))
@@ -1539,6 +1834,14 @@
           remark: null
         });
       },
+      // 收货单打印界面
+    showEditDialog_s() {
+      console.log("@@@@");
+      this.editDialogVisible_s = true;
+    },
+    showEditDialog_ss() {
+      this.editDialogVisible_ss = true;
+    },
       // 收款信息
       addCollection() {
         var obj = {};
@@ -1849,3 +2152,24 @@
     },
   };
 </script>
+<style lang="scss">
+.juzhong > th {
+  text-align: center;
+}
+.biaoge > tr > td {
+  height: 30px;
+  text-align: center;
+  border-right: 1px solid #dfe6ec !important;
+  order-bottom: 1px solid #dfe6ec !important;
+  border-bottom: 1px solid #dfe6ec !important;
+}
+.el-table thead th {
+  background: #1890ff;
+  color: #fff;
+}
+
+.upload-demo {
+  margin-left: 50px;
+}
+
+</style>

+ 124 - 32
src/views/warehouseBusiness/outStock/index.vue

@@ -434,7 +434,8 @@ RK CK DB HZ
           </el-col>
           <el-col :span="8">
             <el-form-item label="联系人" prop="fContacts">
-              <el-select
+              <el-input v-model="form.fContacts" placeholder="请输入电话"/>
+              <!--<el-select
                 v-model="form.fContacts"
                 filterable
                 remote
@@ -446,7 +447,7 @@ RK CK DB HZ
                   :label="dict.nickName"
                   :value="dict.userName"
                 ></el-option>
-              </el-select>
+              </el-select>-->
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -690,7 +691,7 @@ RK CK DB HZ
         <el-table-column label="序号" type="index" width="80">
         </el-table-column>
         <el-table-column
-          prop="fbsdate"
+          prop="fBsdate"
           header-align="center"
           align="center"
           label="入库日期"
@@ -707,7 +708,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fgoodsid"
+          prop="fGoodsid"
           header-align="center"
           align="center"
           label="品名"
@@ -729,7 +730,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fcntrtype"
+          prop="fCntrtype"
           header-align="center"
           align="center"
           label="箱型"
@@ -759,7 +760,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fplangrossweight"
+          prop="fPlangrossweight"
           header-align="center"
           align="center"
           label="计划毛重"
@@ -774,7 +775,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fplannetweight"
+          prop="fPlannetweight"
           header-align="center"
           align="center"
           label="计划净重"
@@ -782,14 +783,14 @@ RK CK DB HZ
           <template slot-scope="scope">
             <el-input
               oninput="value=value.replace(/[^\d.]/g,'')"
-              v-model="scope.row.fplannetweight"
+              v-model="scope.row.fPlannetweight"
               placeholder="计划净重"
               show-word-limit
             />
           </template>
         </el-table-column>
         <el-table-column
-          prop="fplanvolumn"
+          prop="fPlanvolumn"
           header-align="center"
           align="center"
           label="计划尺码"
@@ -804,7 +805,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fplanqty"
+          prop="fPlanqty"
           header-align="center"
           align="center"
           label="计划件数"
@@ -819,7 +820,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fgrossweight"
+          prop="fGrossweight"
           header-align="center"
           align="center"
           label="入库毛重"
@@ -834,7 +835,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fnetweight"
+          prop="fNetweight"
           header-align="center"
           align="center"
           label="入库净重"
@@ -849,7 +850,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fqty"
+          prop="fQty"
           header-align="center"
           align="center"
           label="入库件数"
@@ -879,7 +880,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="fwarehouselocid"
+          prop="fWarehouselocid"
           header-align="center"
           align="center"
           label="库区"
@@ -923,7 +924,7 @@ RK CK DB HZ
           </template>
         </el-table-column>
         <el-table-column
-          prop="ftruckno"
+          prop="fTruckno"
           header-align="center"
           align="center"
           label="车号"
@@ -1610,6 +1611,9 @@ export default {
     this.getDicts("data_unitfees").then((response) => {
       this.fFeetunitOptions = response.data;
     });
+    this.getDicts("data_stltype_type").then((response) => {
+      this.fStltypeOptions = response.data;
+    });
     this.getDicts("data_ifweigh_status").then((response) => {
       this.fIfweighOptions = response.data;
     });
@@ -1738,18 +1742,103 @@ export default {
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
+    queryUser() {
+      queryUserVal().then((response) => {
+        if (response.user !== null) {
+          this.userVal = response.user
+          this.$set(this.form, 'fDeptid', this.userVal.deptId)
+          this.$set(this.form, 'createBy', this.userVal.userName)
+          this.$set(this.form, 'createTime', Date.parse(new Date()))
+        }
+        if (response.dept !== null) {
+          this.deptOptions = []
+          this.deptOptions.push(response.dept)
+        }
+      });
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
+      this.queryUser()
       this.open = true;
-      this.title = "添加仓库主(出入库)";
+      this.title = "入库单";
+    },
+    // 添加list
+    addRelevant() {
+      console.log(JSON.stringify(this.dataList))
+      this.dataList.push({
+        fbsdate: null,
+        fgoodsid: null,
+        fcntrtype: null,
+        fCntqty: null,
+        fplangrossweight: null,
+        fplanvolumn: null,
+        fplanqty: null,
+        fgrossweight: null,
+        fqty: null,
+        fPackagespecs: null,
+        fwarehouselocid: null,
+        fBoxno: null,
+        fGoodsval: null,
+        ftruckno: null,
+        remark: null
+      });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const fId = row.fId || this.ids;
-      getWarehousebills(fId).then((response) => {
-        this.form = response.data;
+      const fId = row.fid || this.ids;
+      getWarehousebills(row.fid).then((response) => {
+        this.form = response.data.warehousebills;
+        this.$set(this.form, 'fCorpid', response.data.warehousebills.fcorpid)
+        this.$set(this.form, 'fWarehouseid', response.data.warehousebills.fwarehouseid)
+        this.$set(this.form, 'fContacts', response.data.warehousebills.fcontacts)
+        this.$set(this.form, 'fTel', response.data.warehousebills.ftel)
+        this.$set(this.form, 'fMblno', response.data.warehousebills.fmblno)
+        this.$set(this.form, 'fBsdate', Date.parse(response.data.warehousebills.fbsdate))
+        this.$set(this.form, 'fStorekeeper', response.data.warehousebills.fstorekeeper)
+        this.$set(this.form, 'createBy', response.data.warehousebills.createBy)
+        this.$set(this.form, 'fDeptid', response.data.warehousebills.fdeptid)
+        this.$set(this.form, 'fDilldate', Date.parse(response.data.warehousebills.fbilldate))
+        this.$set(this.form, 'fVslvoy', response.data.warehousebills.fvslvoy)
+        this.$set(this.form, 'fEta', Date.parse(response.data.warehousebills.feta))
+        this.$set(this.form, 'createTime', Date.parse(response.data.warehousebills.createTime))
+        this.$set(this.form, 'fTrademodeid', response.data.warehousebills.ftrademodeid + '')
+        this.$set(this.form, 'fBillingway', response.data.warehousebills.fbillingway + '')
+        this.$set(this.form, 'fFeetunit', response.data.warehousebills.ffeetunit + '')
+        this.$set(this.form, 'fBscorpno', response.data.warehousebills.fbscorpno)
+        this.$set(this.form, 'fCustomno', response.data.warehousebills.fcustomno)
+        this.$set(this.form, 'fStltypeid', response.data.warehousebills.fstltypeid + '')
+        this.$set(this.form, 'fIfweigh', response.data.warehousebills.fifweigh + '')
+        this.$set(this.form, 'fIfdamage', response.data.warehousebills.fifdamage + '')
+        this.$set(this.form, 'fSbu', response.data.warehousebills.fsbu)
+        this.$set(this.form, 'fIfpledge', response.data.warehousebills.fifpledge + '')
+        this.$set(this.form, 'fBankcorpid', response.data.warehousebills.fbankcorpid)
+        this.$set(this.form, 'remark', response.data.warehousebills.remark)
+        this.deptOptions = []
+        this.deptOptions.push(response.data.dept)
+        this.fMblnoOptions = []
+        this.fMblnoOptions.push(response.data.fCorps)
+        if (response.data.fSbu !== null) {
+          this.fSbuOptions = []
+          this.fSbuOptions.push(response.data.fSbu)
+        }
+        if (response.data.warehouse !== null) {
+          this.warehouseOptions = []
+          this.warehouseOptions.push(response.data.warehouse)
+        }
+        if (typeof response.data.warehouseBillsItem !== 'undefined' && response.data.warehouseBillsItem !== null) {
+          this.dataList = response.data.warehouseBillsItem
+          for (let item in this.dataList) {
+            this.$set(this.dataList[item], 'fBsdate', Date.parse(this.dataList[item].fBsdate))
+          }
+          console.log(JSON.stringify(this.dataList))
+
+          if (response.data.goodsList !== null) {
+            this.goodsOptions = []
+            this.goodsOptions = response.data.goodsList
+          }
+        }
         this.open = true;
         this.title = "修改仓库主(出入库)";
       });
@@ -1758,19 +1847,22 @@ export default {
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          if (this.form.fId != null) {
-            updateWarehousebills(this.form).then((response) => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addWarehousebills(this.form).then((response) => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+          let formData = new window.FormData();
+          // 附件数据
+          formData.append("tWarehouseBills", JSON.stringify(this.form));
+          // 附件数据
+          formData.append("tWhgenleg", null);
+          // 费用明细付款
+          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();
+          });
         }
       });
     },