123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511 |
- <template>
- <!-- 采购订单出库 -->
- <div style="display: flex">
- <el-card style="width: 18%; margin-right: 18px; border-radius: 6px">
- <el-tabs v-model="activeNametree" type="card" @tab-click="tabClick" stretch>
- <!-- <el-tab-pane label="按分类" name="grp"></el-tab-pane> -->
- <el-tab-pane label="按机构" name="org"></el-tab-pane>
- </el-tabs>
- <el-tree
- :data="data"
- :props="defaultProps"
- node-key="spdId"
- @node-click="handleNodeClick"
- default-expand-all="true"
- style="margin-top: 10px"
- >
- <span class="custom-tree-node" slot-scope="{ node, data }">
- <div>{{ node.label }}</div>
- <div class="redTit">{{ data.wcknum }}</div>
- </span>
- </el-tree>
- </el-card>
- <div class="right-common-box">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="待出库" name="first">
- <el-form :model="listQuery" ref="queryForm" :inline="true">
- <el-form-item label="采购单号" prop="id">
- <el-input v-model="listQuery.id" placeholder="请输入采购单号"></el-input>
- </el-form-item>
- <el-form-item label="客户名称" prop="branchName">
- <el-input
- v-model="listQuery.branchName"
- placeholder="请输入客户名称"
- ></el-input>
- </el-form-item>
- <el-form-item label="来源部门" prop="deptName">
- <el-input
- v-model="listQuery.deptName"
- placeholder="请输入来源部门"
- ></el-input>
- </el-form-item>
- <el-form-item label="采购时间" prop="docmkDate">
- <el-date-picker
- v-model="listQuery.docmkDate"
- type="daterange"
- range-separator="至"
- :editable="false"
- value-format="yyyy-MM-dd"
- start-placeholder="开始时间"
- end-placeholder="结束时间"
- style="width: 230px"
- />
- </el-form-item>
- <!-- <el-form-item label="当前状态" prop="stas">
- <el-select
- v-model="listQuery.stas"
- placeholder="请选择"
- clearable
- >
- <el-option
- v-for="item in stasOptions"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item>
- <el-button type="primary" @click="getOutboundData('search')"
- >查询
- </el-button>
- <el-button @click="reset">重置</el-button>
- </el-form-item>
- </el-form>
- <el-table
- v-loading="listLoading"
- element-loading-text="加载中"
- :data="list"
- fit
- stripe
- border
- height="500px"
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column fixed type="index" label="序号" width="60" />
- <el-table-column label="订单编号" prop="id" />
- <el-table-column label="订单种类" prop="detlCnt" />
- <el-table-column label="订单总数量" prop="qtySum" />
- <el-table-column label="剩余出库量" prop="delvCnt" />
- <el-table-column label="订单总金额" prop="purcAmt" width="100px" />
- <el-table-column label="客户名称" prop="branchName" />
- <el-table-column label="来源部门" prop="deptName" />
- <el-table-column label="采购类型" prop="purcType" width="100">
- <template #default="{ row }">
- <span v-if="row.purcType == '2'">{{ row.oprn }}</span>
- <span v-if="row.purcType == '1'">普通采购</span>
- </template>
- </el-table-column>
- <el-table-column label="采购时间" prop="docmkDate" width="140" />
- <el-table-column label="状态" prop="stas">
- <!-- <template #default="{ row }">
- <span v-if="row.stas == 'A'">未受理</span>
- <span v-if="row.stas == 'B'">未出库</span>
- <span v-if="row.stas == 'R'">被驳回</span>
- <span v-if="row.stas == 'C'">已出库</span>
- <span v-if="row.stas == 'D'">部分出库</span>
- <span v-if="row.stas == 'Y'">已入库</span>
- <span v-if="row.stas == 'P'">部分入库</span>
- </template> -->
- </el-table-column>
- <el-table-column label="操作" width="100" fixed="right">
- <template slot-scope="scope">
- <el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--分页-->
- <yl-pagination
- v-show="total > 0"
- :total="total"
- :page.sync="listQuery.current"
- :limit.sync="listQuery.size"
- @pagination="getOutboundData"
- />
- </el-tab-pane>
- <el-tab-pane label="已出库" name="second">
- <el-form :model="listQueryC" ref="queryFormC" :inline="true">
- <el-form-item label="出库单号" prop="delvOrdId">
- <el-input
- v-model="listQueryC.delvOrdId"
- placeholder="请输入出库单号"
- ></el-input>
- </el-form-item>
- <el-form-item label="关联采购单" prop="purcOrdId">
- <el-input
- v-model="listQueryC.purcOrdId"
- placeholder="请输入关联采购单"
- ></el-input>
- </el-form-item>
- <el-form-item label="客户名称" prop="branchName">
- <el-input
- v-model="listQueryC.branchName"
- placeholder="请输入客户名称"
- ></el-input>
- </el-form-item>
- <el-form-item label="来源部门" prop="deptName">
- <el-input
- v-model="listQueryC.deptName"
- placeholder="请输入来源部门"
- ></el-input>
- </el-form-item>
- <el-form-item label="出库时间" prop="docmkDate">
- <el-date-picker
- v-model="listQueryC.docmkDate"
- type="daterange"
- range-separator="至"
- :editable="false"
- value-format="yyyy-MM-dd"
- start-placeholder="开始时间"
- end-placeholder="结束时间"
- style="width: 230px"
- />
- </el-form-item>
- <!-- <el-form-item label="当前状态" prop="purcOrdStas">
- <el-select
- v-model="listQuery.purcOrdStas"
- placeholder="请选择"
- clearable
- >
- <el-option
- v-for="item in stasOptions"
- :key="item.value"
- :label="item.lable"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item>
- <el-button type="primary" @click="getOutboundDataC('search')"
- >查询
- </el-button>
- <el-button @click="resetC">重置</el-button>
- </el-form-item>
- </el-form>
- <el-table
- v-loading="listLoading"
- element-loading-text="加载中"
- :data="listC"
- fit
- stripe
- border
- height="500px"
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column fixed type="index" label="序号" width="60" />
- <el-table-column label="出库单号" prop="delvOrdId" />
- <el-table-column label="关联采购单" prop="purcOrdId" />
- <el-table-column label="采购品种数" prop="detlCnt" />
- <el-table-column label="采购总数量" prop="qtySum" />
- <el-table-column label="本次出库量" prop="bcckl" />
- <el-table-column label="客户验收数量" prop="shppCnt" width="100px" />
- <el-table-column label="剩余出库量" prop="toDelvCnt" width="100px" />
- <el-table-column label="客户名称" prop="branchName" />
- <el-table-column label="来源部门" prop="deptName" />
- <el-table-column label="采购类型" prop="purcType" width="100">
- <template #default="{ row }">
- <span v-if="row.purcType == '2'">{{ row.oprn }}</span>
- <span v-if="row.purcType == '1'">普通采购</span>
- </template>
- </el-table-column>
- <el-table-column label="出库员" prop="docmker" />
- <el-table-column label="出库时间" prop="docmkDate" width="140" />
- <el-table-column label="状态" prop="delvOrdStas" width="100">
- <template #default="{ row }">
- <span v-if="row.delvOrdStas == 'A'">未受理</span>
- <span v-if="row.delvOrdStas == 'B'">已受理</span>
- <span v-if="row.delvOrdStas == 'R'">被驳回</span>
- <span v-if="row.delvOrdStas == 'C'">已出库</span>
- <span v-if="row.delvOrdStas == 'D'">部分出库</span>
- <span v-if="row.delvOrdStas == 'Y'">已入库</span>
- <span v-if="row.delvOrdStas == 'P'">部分入库</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="100" fixed="right">
- <template slot-scope="scope">
- <el-button type="text" @click="handleDetailC(scope.row)">详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--分页-->
- <yl-pagination
- v-show="totalC > 0"
- :total="totalC"
- :page.sync="listQueryC.current"
- :limit.sync="listQueryC.size"
- @pagination="getOutboundDataC"
- />
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </template>
- <script>
- import ylPagination from "@/components/yl-pagination";
- import {
- getMcsOrdDck,
- getSplerMcsDelvOrdPage,
- selectSpdList,
- } from "@/api/orderManage-sup/index";
- export default {
- components: {
- ylPagination,
- },
- data() {
- return {
- activeNametree: "org",
- data: [],
- spdId: null,
- defaultProps: {
- children: "children",
- label: "spdName",
- },
- activeName: "first",
- listQuery: {
- current: 1,
- size: 10,
- id: "",
- branchName: "",
- docmkDateStart: "",
- docmkDateEnd: "",
- docmkDate: [],
- stas: "",
- spdId: "",
- },
- listQueryC: {
- current: 1,
- size: 10,
- purcOrdId: "",
- branchName: "",
- docmkDate: "",
- delvOrdId: "",
- docmkDateEnd: "",
- branchName: "",
- },
- stasOptions: [
- // {value: 'A', lable: "未受理"},
- { value: "B", lable: "未出库" },
- // {value: 'R', lable: "被驳回"},
- { value: "C", lable: "已出库" },
- { value: "D", lable: "部分出库" },
- // {value: 'Y', lable: "已入库"},
- // {value: 'P', lable: "部分入库"}
- ],
- listLoading: false,
- list: [],
- listC: [],
- total: 0,
- totalC: 0,
- routespdId:"",
- };
- },
- mounted() {
- this.getData();
- if (this.$route.query.spdId && this.$route.query.activeName == "first") {
- this.listQuery.spdId = this.$route.query.spdId;
- getMcsOrdDck(this.listQuery)
- .then((res) => {
- this.list = res.data.records;
- this.total = res.data.total;
- this.listLoading = false;
- })
- .catch((err) => {
- this.listLoading = false;
- });
- }
- if (this.$route.query.spdId && this.$route.query.activeName == "second") {
- this.activeName = "second";
- this.listQueryC.spdId = this.$route.query.spdId;
- getSplerMcsDelvOrdPage(this.listQueryC)
- .then((res) => {
- this.listC = res.data.records;
- this.totalC = res.data.total;
- this.listLoading = false;
- })
- .catch((err) => {
- this.listLoading = false;
- });
- }
- },
- methods: {
- tabClick(tab) {
- if (tab.label == "按机构") {
- this.defaultProps.label = "spdName";
- }
- // else if(tab.label == "按分类"){
- // // this.getData4();
- // // this.defaultProps.label = 'orgGrpName'
- // // this.listQuery.type = 'grp';
- // }
- },
- handleClick(tab) {
- console.log(tab.name, "name");
- if (tab.name == "first") {
- this.getOutboundData();
- } else {
- this.getOutboundDataC();
- }
- },
- // 获取医院列表
- getData(type) {
- this.data = [];
- selectSpdList()
- .then((res) => {
- this.listQuery.spdId = res.data[0].spdId;
- this.listQueryC.spdId = res.data[0].spdId;
- this.data = res.data;
- console.log(this.data, "dadad");
- })
- .catch((err) => {});
- },
- getOutboundData(type) {
- if (type == "search") {
- this.listQuery.current = 1;
- }
- this.listLoading = true;
- this.listQuery.spdId = this.spdId;
- this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
- this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
- getMcsOrdDck(this.listQuery)
- .then((res) => {
- this.list = res.data.records;
- this.total = res.data.total;
- this.listLoading = false;
- })
- .catch((err) => {
- this.listLoading = false;
- });
- },
- // 点击获取耗材列表
- handleNodeClick(data) {
- console.log(data, "data");
- this.listLoading = true;
- this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
- this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
- this.spdId = data.spdId;
- this.listQuery.spdId = this.spdId;
- getMcsOrdDck(this.listQuery)
- .then((res) => {
- this.list = res.data.records;
- this.total = res.data.total;
- this.listLoading = false;
- console.log(res, "医院目录");
- })
- .catch((err) => {
- this.listLoading = false;
- });
- },
- reset() {
- this.$refs.queryForm.resetFields();
- this.getOutboundData();
- },
- // 详情
- handleDetail(row) {
- if (this.spdId) {
- this.routespdId = this.spdId;
- } else {
- this.routespdId = this.$route.query.spdId;
- }
- this.$router.push({
- name: "deliveryDetail",
- query: {
- deptName: row.deptName,
- deptId: row.deptId,
- id: row.id,
- detlCnt: row.detlCnt,
- qtySum: row.qtySum,
- purcAmt: row.purcAmt,
- docmker: row.docmker,
- docmkDate: row.docmkDate,
- stas: row.stas,
- branchName: row.branchName,
- spdId: this.routespdId,
- activeName: this.activeName,
- oprn: row.oprn,
- oprtRoom: row.oprtRoom,
- oprtTime: row.oprtTime,
- atddr: row.atddr,
- purcType: row.purcType,
- },
- });
- },
- getOutboundDataC(type) {
- if (type == "search") {
- this.listQueryC.current = 1;
- }
- this.listLoading = true;
- this.listQueryC.spdId = this.spdId;
- this.listQueryC.docmkDateStart = this.listQueryC.docmkDate[0];
- this.listQueryC.docmkDateEnd = this.listQueryC.docmkDate[1];
- getSplerMcsDelvOrdPage(this.listQueryC)
- .then((res) => {
- this.listC = res.data.records;
- this.totalC = res.data.total;
- this.listLoading = false;
- })
- .catch((err) => {
- this.listLoading = false;
- });
- },
- resetC() {
- this.$refs.queryFormC.resetFields();
- this.getOutboundDataC();
- },
- // 详情
- handleDetailC(row) {
- if (this.spdId) {
- this.routespdId = this.spdId;
- } else {
- this.routespdId = this.$route.query.spdId;
- }
- this.$router.push({
- name: "alreadyDetail",
- query: {
- delvOrdId: row.delvOrdId,
- purcOrdId: row.purcOrdId,
- detlCnt: row.detlCnt,
- docmker: row.docmker,
- deptName: row.deptName,
- docmkDate: row.docmkDate,
- delvOrdStas: row.delvOrdStas,
- branchName: row.branchName,
- qtySum: row.qtySum,
- spdId: this.routespdId,
- activeName: this.activeName,
- purcAmt: row.purcAmt,
- oprn: row.oprn,
- oprtRoom: row.oprtRoom,
- oprtTime: row.oprtTime,
- atddr: row.atddr,
- purcType: row.purcType,
- },
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .custom-tree-node {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .custom-tree-node ::v-deep .redTit {
- min-width: 30px;
- background-color: #f56c6c;
- min-height: 1px;
- border-radius: 10px;
- text-align: center;
- margin-left: 10px;
- padding: 1px;
- color: #fff;
- }
- </style>
|