zuozhengqing
2023-11-24 58ac82fceff96784dd9e16872d1e2316fa2cfdec
入库明细报表修改状态进度展示
3个文件已修改
133 ■■■■■ 已修改文件
src/views/reportForm/inboundOutboundDetail/index.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/outboundDetail/index.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/inboundOutboundDetail/index.vue
@@ -23,8 +23,12 @@
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
    <!-- 编辑 -->
    <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" :add-name="this.$route.params.name" />
    <!-- 查看/编辑 -->
    <AddOverviewDialog
      v-if="editConfig.visible"
      :edit-common-config="editConfig"
      :add-name="this.$route.params.name"
    />
  </div>
</template>
@@ -226,6 +230,9 @@
        }).then((res) => {
          if (res.code === 200) {
            res.data.map((item)=>{
                if(item.status===""){
                  item.status=4
                }
                let dateObject = new Date(item.date);  
                let formattedDateString = dateObject.toISOString().split('T')[0];  
                item.date=formattedDateString
@@ -254,7 +261,7 @@
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成"
      return val === 1 ? "草稿" : val === 3 ? "就绪" : val===4?"完成":val===5?"已取消":" "
    }
  }
}
src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue
@@ -10,7 +10,7 @@
      <div slot="title" class="dialog-header">
        <span>{{ editCommonConfig.title === "查看" ? editCommonConfig.title : editCommonConfig.title + addName }}</span>
        <div class="header_btns">
          <span class="btn">
          <span class="btn" @click="btnPrint">
            <i class="el-icon-printer"></i>
            <span>打印</span>
          </span>
@@ -18,7 +18,7 @@
            <i class="el-icon-s-tools"></i>
            <span>动作</span>
          </span>
          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
          <el-button v-if="showEdit" :disabled="this.editConfig.infomation.status===5" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
        </div>
      </div>
      <!-- 内容 -->
@@ -36,6 +36,7 @@
            :showButton="showButton"
            :isValidateClick="isValidateClick"
            :isDelClick="isDelClick"
            :isCancel="isCancel"
            :list="list"
            :showCancel="showCancel"
            @delClick="delClick"
@@ -314,7 +315,8 @@
  stateCancel,
  deleteOperation,
  getListTransfer,
  getLogisticCompanyList
  getLogisticCompanyList,
  printReceipts
} from "@/api/overview/overview"
import { getCompanyList } from "@/api/common/other"
export default {
@@ -360,13 +362,6 @@
      companyOptions: [], // 公司
      memberOptions: [{ id: 1, name: "管理员" }],
      toLocationOptions: [], //  源位置 仓库位置
      list: [
        { label: "草稿", status: "todo", value: 1 },
        { label: "正在等待", status: "todo", value: 2 },
        { label: "就绪", status: "todo", value: 3 },
        { label: "完成", status: "todo", value: 4 },
        { label: "已取消", status: "todo", value: 5 }
      ],
      showButton: true,
      activeName: "first",
      productTableList: {},
@@ -375,6 +370,7 @@
      isNoProduct: true, // 添加明细行时是否有产品未选择
      showEdit: false, // 是否显示编辑按钮
      isDelClick: false, // 删除按钮是否可点击
      isCancel:false, //验证按钮是否可点击
      showFooter: false, // 是否显示取消保存
      currentState: "todo", // 当前状态
      detailTableList: {},
@@ -394,9 +390,11 @@
        logisticWeight:0,
      },
      showCancel:false, // 取消是否可以显示
      list:[],
    }
  },
  created() {
    this.setStatusList()
    this.setTableForm()
    this.setBottonView()
    this.setDetailTableForm()
@@ -409,6 +407,25 @@
    this.getLogisticCompanyList()
  },
  methods: {
    setStatusList(){
      if(this.editConfig.infomation.status===5){
        this.list=[
          { label: "草稿", status: "todo", value: 1 },
          { label: "正在等待", status: "todo", value: 2 },
          { label: "就绪", status: "todo", value: 3 },
          { label: "完成", status: "todo", value: 4 },
          { label: "已取消", status: "todo", value: 5 }
        ]
      }else{
        console.log(this.editConfig.infomation.status,"藕片")
        this.list=[
          { label: "草稿", status: "todo", value: 1 },
          { label: "正在等待", status: "todo", value: 2 },
          { label: "就绪", status: "todo", value: 3 },
          { label: "完成", status: "todo", value: 4 }
        ]
      }
    },
    // 获取公司列表
    async getCompanyList() {
      await getCompanyList().then((res) => {
@@ -474,9 +491,11 @@
        }else if(this.editConfig.infomation.status === 3){
          this.isValidateClick = true
          this.showCancel=true
        }else if(this.editConfig.infomation.status===5){
          this.isCancel=true
          this.isValidateClick=true
        }else{
          this.isValidateClick = true
        }
      } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "完成") {
        this.showButton = true
@@ -485,6 +504,7 @@
        this.showFooter = false
        this.isValidateClick = false
      } else if (this.editConfig.infomation.status === 5) {
        this.isCancel=true
        this.showButton = true
        this.showEdit = false
        this.showFooter = false
@@ -788,6 +808,19 @@
        })
      }).catch(() => {         
      });
    },
    //打印
    async btnPrint(){
      await printReceipts(this.editCommonConfig.infomation.id).then((res) => {
        console.log(res)
        if (res.code === 200) {
          this.$message.success("打印成功")
          const link = document.createElement('a');
          link.href = res.data;
          link.download = '出库单.xlsx';
          link.click();
        }
      })
    }
  }
}
@@ -804,6 +837,9 @@
    margin-left: auto;
    margin-right: 60px;
    .btn {
      cursor: pointer;
    }
    .btn:nth-of-type(2){
      cursor: no-drop;
    }
  }
src/views/reportForm/outboundDetail/index.vue
@@ -1,23 +1,13 @@
<template>
  <div class="rightContent">
    <div class="top">
      <SearchCommonView
        :add-title="'新建'"
        :showAdd="false"
        :placeholder="'请根据单号、产品、业务类型进行搜索'"
        :amount-view="false"
        @addCommonClick="addBtnClick"
        @searchClick="getList"
      />
      <SearchCommonView :add-title="'新建'" :showAdd="false" :placeholder="'请根据单号、产品、业务类型进行搜索'" :amount-view="false"
        @addCommonClick="addBtnClick" @searchClick="getList" />
    </div>
    <div class="list-view">
      <div class="table">
        <TableCommonView
          ref="tableListRef"
          :table-list="tableList"
          @selTableCol="selTableCol"
          @tableRowClick="tableRowClick"
        ></TableCommonView>
        <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol"
          @tableRowClick="tableRowClick"></TableCommonView>
      </div>
      <div class="btn-pager">
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
@@ -57,7 +47,7 @@
        infomation: {}
      },
      params: {},
      baseOperationTypeList:getDataByType("baseOperationTypeTwo"),
      baseOperationTypeList: getDataByType("baseOperationTypeTwo"),
    }
  },
  created() {
@@ -72,7 +62,6 @@
      sessionStorage.setItem("paramsList", JSON.stringify(params))
    }
    this.params = params
    console.log(this.params,'====111')
    this.getData()
  },
  // 页面销毁之前
@@ -185,7 +174,7 @@
      this.showcol = val
      this.tableList.tableColumn = this.setTableColumn(val)
    },
    getBaseOperationTypeList(val){
    getBaseOperationTypeList(val) {
      let string = "--"
      if (val) {
        for (let i in this.baseOperationTypeList) {
@@ -200,18 +189,18 @@
    async getData() {
      if (this.params.name === "报表") {
        await getHistory({
          keyWord:this.params.keyWord,
          produceId:this.params.produceId,
          unit:this.params.unit,
          productName:this.params.productName,
          keyWord: this.params.keyWord,
          produceId: this.params.produceId,
          unit: this.params.unit,
          productName: this.params.productName,
          page: this.pagerOptions.currPage,
          pageSize: this.pagerOptions.pageSize
        }).then((res) => {
          if (res.code === 200) {
            res.data.map((item)=>{
                let dateObject = new Date(item.date);
                let formattedDateString = dateObject.toISOString().split('T')[0];
                item.date=formattedDateString
            res.data.map((item) => {
              let dateObject = new Date(item.date);
              let formattedDateString = dateObject.toISOString().split('T')[0];
              item.date = formattedDateString
            })
            this.tableList.tableInfomation = res.data
            this.pagerOptions.totalCount = res.total
@@ -219,18 +208,21 @@
        })
      } else {
        await getHistory({
          keyWord:this.params.keyWord,
          baseOperationType:2,
          keyWord: this.params.keyWord,
          baseOperationType: 2,
          page: this.pagerOptions.currPage,
          pageSize: this.pagerOptions.pageSize
        }).then((res) => {
          if (res.code === 200) {
            res.data.map((item)=>{
                let dateObject = new Date(item.date);
                let formattedDateString = dateObject.toISOString().split('T')[0];
                item.date=formattedDateString
            res.data.map((item) => {
              if(item.status===""){
                item.status=4
              }
              let dateObject = new Date(item.date);
              let formattedDateString = dateObject.toISOString().split('T')[0];
              item.date = formattedDateString
            })
            this.tableList.tableInfomation = res.data?res.data:[]
            this.tableList.tableInfomation = res.data ? res.data : []
            this.pagerOptions.totalCount = res.total
          }
        })
@@ -238,12 +230,12 @@
    },
    // 搜索
    getList(val) {
      this.params.keyWord=val;
      this.params.keyWord = val;
      this.getData()
    },
    // 行点击
    tableRowClick(row) {
      console.log(row,"看看row")
      console.log(row, "看看row")
      this.editConfig.visible = true
      this.editConfig.title = "查看"
      this.editConfig.infomation = { ...row }
@@ -255,7 +247,7 @@
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成"
      return val === 1 ? "草稿" : val === 3 ? "就绪" : val === 4 ? "完成" : val === 5 ? "已取消":""
    }
  }
}