123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851 |
- <template>
- <div class="porder pagePadding">
- <ex-table
- v-loading="loading"
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
- :table="table"
- :data="tableData"
- :columns="columns"
- :page="pageInfo"
- :size="size"
- @page-curr-change="handlePageChange"
- @page-size-change="handleSizeChange"
- @screen-reset="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- @screen-submit="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <template #table-header="{ selection }">
- <div style="width: 100%">
- <el-row style="padding: 0 0 10px 80px">
- <el-col :span="8" style="width: 470px">
- <el-select
- v-model="code"
- multiple
- filterable
- remote
- :multiple-limit="1"
- reserve-keyword
- :size="searchSize"
- style="width: 100%"
- placeholder="供应商名称"
- :remote-method="remoteMethod"
- :loading="selectLoading"
- @change="selectChange"
- >
- <el-option
- v-for="item in activeOptions"
- :key="item.code"
- :label="item.name + '--------' + item.contector"
- :value="item.code"
- />
- </el-select>
- </el-col>
- <el-col
- :span="3"
- style="width: 140px; float: right"
- v-if="powers.some((item) => item == '041')"
- >
- <el-button
- :size="searchSize"
- type="primary"
- class="fr"
- @click="setBilling(selection)"
- >
- 批量设置回票信息</el-button
- ></el-col
- >
- <el-col
- :span="3"
- style="width: 140px; float: right"
- v-if="powers.some((item) => item == '042')"
- >
- <el-button
- :size="searchSize"
- type="primary"
- style="float: right"
- @click="examBilling(selection)"
- >
- 批量审核回票信息
- </el-button>
- </el-col>
- </el-row>
- <el-row style="padding: 0 0 10px 0">
- <el-col :span="8" style="width: 120px">
- <el-select
- v-model="parmValue.send_status"
- clearable
- :size="searchSize"
- placeholder="发货状态"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in send_status_list"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="8" style="width: 130px; padding-left: 10px">
- <el-select
- v-model="parmValue.payinfo"
- clearable
- :size="searchSize"
- placeholder="付款状态"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in pay_status_list"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="8" style="width: 130px; padding-left: 10px">
- <el-select
- v-model="parmValue.invinfo"
- clearable
- :size="searchSize"
- placeholder="回票状态"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in inv_status_list"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="8" style="width: 130px; padding-left: 10px">
- <el-select
- v-model="parmValue.th_status"
- clearable
- :size="searchSize"
- placeholder="退货状态"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in th_status_list"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="8" style="width: 160px; padding: 0 0 0 10px">
- <el-select
- v-model="parmValue.inv_status"
- clearable
- :size="searchSize"
- placeholder="回票信息状态"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col
- :span="3"
- style="width: 140px; float: right"
- v-if="powers.some((item) => item == '050')"
- >
- <el-button
- :size="searchSize"
- type="primary"
- style="float: right"
- @click="statusConfirm(selection)"
- >
- 批量设置采购单无需对账状态
- </el-button>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :span="5" style="width: 390px">
- <el-input
- clearable
- style="width: 100%"
- :size="searchSize"
- placeholder="关键字"
- v-model="input"
- >
- <el-select
- v-model="selectK"
- slot="prepend"
- style="width: 125px"
- placeholder="请选择"
- >
- <el-option
- v-for="item in selectKlist"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- ></el-option>
- </el-select>
- <el-button
- slot="append"
- icon="el-icon-search"
- @click.native="searchList"
- ></el-button>
- </el-input>
- </el-col>
- <el-col :span="3" style="width: 84px; float: right">
- <el-button
- type="primary"
- icon="el-icon-download"
- class="fr"
- v-if="powers.some((item) => item == '051')"
- @click="batchExport(selection)"
- :size="searchSize"
- style="margin-left: 10px"
- >导出</el-button
- >
- </el-col>
- <el-col :span="3" style="width: 66px; float: right">
- <el-button
- :size="searchSize"
- type="primary"
- class="fr"
- style="margin-left: 10px"
- @click="searchList"
- >
- 刷新
- </el-button>
- </el-col>
- <el-col :span="3" style="width: 66px; float: right">
- <el-button
- type="warning"
- class="fr"
- :size="searchSize"
- @click="restSearch"
- >
- 重置
- </el-button>
- </el-col>
- </el-row>
- </div>
- </template>
- <template #expand="{ scope }">
- <el-form
- label-position="left"
- size="mini"
- inline
- label-width="70px"
- class="demo-table-expand"
- >
- <el-row>
- <el-col :span="4">
- <el-form-item size="mini" label="商品编号">
- <span>{{ scope.row.goodNo }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item size="mini" label="商品名称">
- <span>{{ scope.row.goodName }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item size="mini" label="商品描述">
- <span>{{ scope.row.goodDesc }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="单位">
- <span>{{ scope.row.goodUnit }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="数量">
- <span>{{ scope.row.orderNum }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="含有工差">
- <span>{{ scope.row.isDiff }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="工期">
- <span>{{ scope.row.workDay }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="成本合计">
- <span>{{ scope.row.pay_price }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="税率">
- <span>{{ scope.row.taxPoint }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="成本裸价">
- <span>{{ scope.row.nakedPrice }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="加标费">
- <span>{{ scope.row.markPrice }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="包装费">
- <span>{{ scope.row.packPrice }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="证书费">
- <span>{{ scope.row.certPrice }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="开模费">
- <span>{{ scope.row.openPrice }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="物流费">
- <span>{{ scope.row.postPrice }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="工差">
- <span>{{ scope.row.diff_fee }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="商品类型">
- <span>{{ scope.row.goodType }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="商品品牌">
- <span>{{ scope.row.goodBank }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="商品型号">
- <span>{{ scope.row.goodModel }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="商品材质">
- <span>{{ scope.row.goodMaterial }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="商品颜色">
- <span>{{ scope.row.goodColor }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="金属种类">
- <span>{{ scope.row.goodCat }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="金属重量">
- <span>{{ scope.row.weight }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item size="mini" label="金属价格">
- <span>{{ scope.row.price }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </template>
- <template #inv_status="{ scope }">
- <el-tag
- size="mini"
- :type="
- scope.row.inv_status == '3'
- ? 'danger'
- : scope.row.inv_status == '2'
- ? 'success'
- : 'warning'
- "
- v-text="
- (options.find((item) => item.value == scope.row.inv_status) || {})
- .label || '--'
- "
- ></el-tag>
- </template>
- <template #th_info="{ scope }">
- <el-tag
- size="mini"
- :type="scope.row.th_info == '1' ? 'success' : 'danger'"
- v-text="
- (
- th_status_list.find((item) => item.value == scope.row.th_info) ||
- {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- <template #send_info="{ scope }">
- <el-tag
- size="mini"
- :type="
- scope.row.send_info == '3'
- ? 'success'
- : scope.row.send_info == '2'
- ? 'warning'
- : 'danger'
- "
- v-text="
- (
- send_status_list.find(
- (item) => item.value == scope.row.send_info
- ) || {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- <template #payinfo="{ scope }">
- <el-tag
- size="mini"
- :type="
- scope.row.payinfo == '3'
- ? 'success'
- : scope.row.payinfo == '2'
- ? 'warning'
- : 'danger'
- "
- v-text="
- (
- pay_status_list.find((item) => item.value == scope.row.payinfo) ||
- {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- <template #invinfo="{ scope }">
- <el-tag
- size="mini"
- :type="
- scope.row.invinfo == '3'
- ? 'success'
- : scope.row.invinfo == '2'
- ? 'warning'
- : 'danger'
- "
- v-text="
- (
- inv_status_list.find((item) => item.value == scope.row.invinfo) ||
- {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- </ex-table>
- <no-auth v-else></no-auth>
- <!-- 设置回票信息 -->
- <set-edit
- :tableData="selection"
- :show-model="showModel1"
- @refresh="searchList"
- @cancel="showModel1 = false"
- />
- <!-- 审核回票信息 -->
- <exam-edit
- :tableData="selection"
- :show-model="showModel2"
- @refresh="searchList"
- @cancel="showModel2 = false"
- />
- </div>
- </template>
- <script>
- import asyncRequest from "@/apis/service/purchase/porder";
- import ExTable from "@/components/ExTableNew.vue";
- import mixinPage from "@/mixins/elPaginationHandle";
- import { switchingTime, formatJson } from "@/utils/publicMethods";
- import resToken from "@/mixins/resToken";
- import setEdit from "./setEdit";
- import { mapGetters } from "vuex";
- import examEdit from "./examEdit";
- import {
- columns,
- selectKlist,
- options,
- th_status_list,
- send_status_list,
- pay_status_list,
- inv_status_list,
- tHeader,
- filterVal,
- } from "./tableVariable";
- export default {
- name: "porder",
- components: {
- ExTable,
- setEdit,
- examEdit,
- },
- mixins: [mixinPage, resToken],
- computed: {
- //组件SIZE设置
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
- powers() {
- let tran =
- this.$store.getters.btnList.find(
- (item) => item.menu_route == "porder"
- ) || {};
- if (tran && tran.action && tran.action.length > 0) {
- return tran.action;
- } else {
- return [];
- }
- },
- },
- data() {
- return {
- selectK: "1",
- input: "",
- //输入框搜索类型
- selectKlist: selectKlist,
- code: [],
- showModel1: false,
- showModel2: false,
- selectLoading: false,
- activeOptions: [],
- selection: [],
- //回票状态
- options: options,
- //退货状态
- th_status_list: th_status_list,
- //发货状态
- send_status_list: send_status_list,
- //付款状态
- pay_status_list: pay_status_list,
- //回票状态
- inv_status_list: inv_status_list,
- // 状态
- statusOptions: [
- { id: "0", label: "禁用" },
- { id: "1", label: "启用" },
- ],
- pickerOptions: {
- // disabledDate是一个函数,参数是当前选中的日期值,这个函数需要返回一个Boolean值,
- disabledDate(time) {
- let date = new Date().valueOf();
- const one = 1000 * 60 * 60 * 24;
- date = parseInt(date / one) * one;
- return time.getTime() <= date;
- },
- },
- loading: false,
- modelId: 0,
- parmValue: {
- name: "", // 账户
- code: "", // code
- sequenceNo: "",
- inv_company: "",
- inv_status: "",
- send_status: "",
- payinfo: "",
- invinfo: "",
- goodNo: "",
- th_status: "",
- page: 1, // 页码
- size: 15, // 每页显示条数
- },
- formValue: {
- name: "", // 账户
- page: 1, // 页码
- size: 100, // 每页显示条数
- },
- // 表格 - 数据
- tableData: [],
- // 表格 - 参数
- table: {
- stripe: true,
- border: true,
- _defaultHeader_: ["setcol"],
- },
- // 表格 - 分页
- pageInfo: {
- size: 15,
- curr: 1,
- total: 0,
- },
- // 表格 - 列参数
- columns: columns,
- };
- },
- mounted() {
- this.searchList();
- },
- methods: {
- async restSearch() {
- this.selectK = "1";
- this.input = "";
- this.code = [];
- this.parmValue.code = this.code.join(",");
- this.parmValue.sequenceNo = "";
- this.parmValue.page = 1;
- this.pageInfo.curr = 1;
- this.parmValue.inv_company = "";
- this.parmValue.inv_status = "";
- this.parmValue.goodNo = "";
- this.parmValue.send_status = "";
- this.parmValue.owner = "";
- await this.searchList();
- },
- async statusConfirm(selection) {
- if (selection && selection.length === 0) {
- this.$message.error("请选择采购单!");
- return;
- }
- await this.$confirm(`确定要将选中的采购单改为无需对账状态?`, {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- this.loading = true;
- let id = "";
- selection.forEach((v1, i1) => {
- id += i1 === 0 ? v1.id : "," + v1.id;
- });
- const model = {
- id: id,
- };
- const res = await asyncRequest.paymentunpay(model);
- if (res && res.code === 0) {
- this.loading = false;
- this.$notify.success({
- title: "无需对账状态修改成功!",
- message: "",
- });
- await this.searchList();
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- })
- .catch(() => {
- console.log("取消");
- });
- },
- async searchList() {
- this.loading = true;
- this.parmValue.sequenceNo = this.selectK === "1" ? this.input : "";
- this.parmValue.inv_company = this.selectK === "2" ? this.input : "";
- this.parmValue.owner = this.selectK === "3" ? this.input : "";
- this.parmValue.goodNo = this.selectK === "4" ? this.input : "";
- const res = await asyncRequest.list(this.parmValue);
- if (res && res.code === 0 && res.data) {
- this.tableData = res.data.list;
- this.pageInfo.total = Number(res.data.count);
- this.formatGoodList();
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.tableData = [];
- this.pageInfo.total = 0;
- }
- this.loading = false;
- },
- async selectChange() {
- console.log(this.code);
- this.parmValue.code = this.code.join(",");
- this.formValue.page = 1;
- this.pageInfo.curr = 1;
- await this.searchList();
- },
- setBilling(selection) {
- this.selection = [];
- if (selection && selection.length === 0) {
- this.$message.error("请选择采购单");
- return;
- }
- this.selection = selection;
- this.showModel1 = true;
- this.showModel2 = false;
- console.log(selection);
- },
- examBilling(selection) {
- if (selection && selection.length === 0) {
- this.$message.error("请选择采购单");
- return;
- }
- let isok = true;
- selection.forEach((v1) => {
- if (v1.inv_status !== "1") {
- isok = false;
- }
- });
- if (!isok) {
- this.$message.error("只有待审核的采购单才能进行审核操作!");
- return;
- }
- this.selection = selection;
- console.log(selection);
- this.showModel1 = false;
- this.showModel2 = true;
- },
- formatGoodList() {
- this.tableData.map((v1) => {
- v1.purchasePrice = this.setNum(v1.purchasePrice);
- v1.totalPrice = this.setNum(v1.totalPrice);
- v1.pay_fee = this.setNum(v1.pay_fee);
- v1.wait_fee = this.setNum(v1.wait_fee);
- v1.price = this.setNum(v1.price);
- v1.nakedPrice = this.setNum(v1.nakedPrice);
- v1.markPrice = this.setNum(v1.markPrice);
- v1.packPrice = this.setNum(v1.packPrice);
- v1.certPrice = this.setNum(v1.certPrice);
- v1.openPrice = this.setNum(v1.openPrice);
- v1.craftPrice = this.setNum(v1.craftPrice);
- v1.postPrice = this.setNum(v1.postPrice);
- v1.weight = this.setNum(v1.weight);
- v1.diff_fee = this.setNum(v1.diff_fee);
- v1.price = this.setNum(v1.price);
- v1.inv_open_fee = this.setNum(v1.inv_open_fee);
- v1.inv_wait_fee = this.setNum(v1.inv_wait_fee);
- return v1;
- });
- },
- setNum(s) {
- return s ? parseFloat(s + "").toFixed(2) : "-";
- },
- async remoteMethod(query) {
- this.selectLoading = true;
- if (query !== "") {
- this.activeOptions = [];
- this.formValue.name = query;
- const res = await asyncRequest.supplierlist(this.formValue);
- if (res && res.code === 0 && res.data && res.data.list) {
- this.activeOptions = res.data.list;
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- } else {
- this.activeOptions = [];
- }
- this.selectLoading = false;
- },
- setlable(list, type) {
- return (list.find((item) => item.value == type) || {}).label || "";
- },
- /**
- * 批量导出
- * @param {Array} selection 当前选择项
- */
- batchExport(selection) {
- if (!this.loading) {
- if (selection.length == 0) {
- this.$message.warning("请至少选择一条数据!");
- return;
- }
- this.loading = true;
- let data = [].concat(...selection);
- let list = [];
- data.forEach((v1) => {
- let model = Object.assign({}, v1);
- model.send_info = this.setlable(this.send_status_list, v1.send_info);
- model.th_info = this.setlable(this.th_status_list, v1.th_info);
- model.payinfo = this.setlable(this.pay_status_list, v1.payinfo);
- model.invinfo = this.setlable(this.inv_status_list, v1.invinfo);
- model.inv_status = this.setlable(this.options, v1.inv_status);
- list.push(model);
- });
- const xlsName = `采购单导出`;
- import("@/vendor/Export2Excel").then((excel) => {
- const data = formatJson(filterVal, list);
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: `${xlsName}`,
- });
- this.$message.success("采购单导出成功!");
- setTimeout(() => {
- this.loading = false;
- }, 500);
- });
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .porder {
- background: rgba(242, 242, 242, 1);
- min-height: 100%;
- width: 100%;
- height: 100%;
- // background-color: $bg;
- overflow: hidden;
- // position: absolute;
- z-index: 2;
- background: #fff;
- .change {
- .title {
- border-width: 0px;
- width: 100%;
- height: 100px;
- // display: flex;
- font-weight: 400;
- font-style: normal;
- font-size: 22px;
- text-align: left;
- padding: 0;
- padding: 60px 0 0 100px;
- width: 100%;
- box-sizing: border-box;
- }
- }
- }
- </style>
|