From 0600ab29100da647a5cd34c935c16f59b3e772e5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 17 三月 2025 11:14:39 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/views/business/costStatistics/index.vue |  371 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 367 insertions(+), 4 deletions(-)

diff --git a/src/views/business/costStatistics/index.vue b/src/views/business/costStatistics/index.vue
index 5796616..78d5a12 100644
--- a/src/views/business/costStatistics/index.vue
+++ b/src/views/business/costStatistics/index.vue
@@ -1,9 +1,372 @@
+<style scoped>
+.title {
+  height: 60px;
+  line-height: 60px;
+}
+
+.search {
+  background-color: #fff;
+  height: 80px;
+  display: flex;
+  align-items: center;
+}
+
+.search_thing {
+  display: flex;
+  align-items: center;
+  height: 50px;
+}
+
+.search_label {
+  width: 120px;
+  font-size: 14px;
+  text-align: right;
+}
+
+.search_input {
+  width: calc(100% - 120px);
+}
+
+>>> .custom-statistic .el-statistic .head {
+  font-size: 25px;
+}
+
+.table {
+  margin-top: 10px;
+  background-color: #fff;
+  width: calc(100% - 40px);
+  height: calc(100% - 60px - 80px - 10px - 40px);
+  padding: 20px;
+}
+
+.el-form-item {
+  margin-bottom: 16px;
+}
+
+>>> .el-table tbody tr:hover > td {
+  background-color: transparent !important;
+}
+</style>
+
 <template>
-  <div>璐圭敤缁熻</div>
+  <div class="inspection_order">
+    <div style="width: 100%; height: 100%">
+      <div>
+        <el-row class="title">
+          <el-col :span="12" style="padding-left: 20px; text-align: left"
+            >璐圭敤缁熻</el-col
+          >
+          <el-col :span="12" style="text-align: right">
+            <el-button size="small" type="primary">OA鎺ㄩ��</el-button>
+          </el-col>
+        </el-row>
+      </div>
+      <div class="search">
+        <div class="search_thing">
+          <div class="search_label">鏃堕棿鑼冨洿锛�</div>
+          <div class="search_input">
+            <el-date-picker
+              v-model="dates"
+              type="daterange"
+              range-separator="鑷�"
+              format="yyyy-MM-dd"
+              value-format="yyyy-MM-dd"
+              start-placeholder="寮�濮嬫棩鏈�"
+              end-placeholder="缁撴潫鏃ユ湡"
+              size="small"
+              @change="datesChange"
+              :key="index2"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+        <div class="search_thing" style="width: 340px">
+          <div class="search_label">濮旀墭鍗曚綅锛�</div>
+          <div class="search_input">
+            <!--            <el-input size="small" placeholder="璇疯緭鍏�" clearable-->
+            <!--               @keyup.enter.native="refreshTable()"></el-input>-->
+            <el-select
+              @focus="getCompanyOptions"
+              @change="refreshTable()"
+              clearable
+              size="small"
+              v-model="entity.company"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in companyOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.label"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="search_thing" style="padding-left: 30px">
+          <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+          <el-button size="small" type="primary" @click="refreshTable()"
+            >鏌� 璇�</el-button
+          >
+        </div>
+        <!-- <div class="search_thing" style="padding-left: 70px;">鎬讳环锛歿{total}}</div> -->
+        <div class="search_thing" style="margin-left: 50px">
+          <div style="width: 100%; text-align: right">鎬讳环锛�</div>
+          <el-statistic
+            group-separator=","
+            :precision="2"
+            :value="total"
+          ></el-statistic>
+        </div>
+
+        <div class="search_thing" style="padding-left: 70px">
+          <el-button
+            size="small"
+            type="primary"
+            @click="handleDown"
+            :loading="outLoading"
+            >瀵煎嚭</el-button
+          >
+        </div>
+      </div>
+      <div class="table">
+        <!-- <ValueTable
+          ref="ValueTable"
+          :url="$api.insOrder.costStatistics"
+          :componentData="componentData"
+          :key="upIndex"
+          @handleWeave="handleWeave"
+          :column-min-width="'140'"
+        /> -->
+        <lims-table
+          :tableData="tableData"
+          :column="column"
+          :tableLoading="tableLoading"
+          :height="'calc(100vh - 270px)'"
+          :page="page"
+          @pagination="pagination"
+        ></lims-table>
+      </div>
+    </div>
+    <el-dialog
+      title="鍦ㄧ嚎缂栧埗"
+      :visible.sync="claimVisible"
+      width="70%"
+      :modal-append-to-body="false"
+    >
+      <Word style="height: 70vh" v-if="claimVisible" ref="Word" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="claimVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="confirmClaim">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-export default {};
-</script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+  costStatistics,
+  exportCommissionFees,
+  costStatistics2,
+  selectCustomPageList,
+} from "../../../api/business/costStatistics";
 
-<style></style>
+export default {
+  components: {
+    limsTable,
+  },
+  data() {
+    return {
+      tableData: [],
+      column: [
+        {
+          label: "涓嬪崟鏃堕棿",
+          prop: "createTime",
+        },
+        {
+          label: "濮旀墭缂栧彿",
+          prop: "entrustCode",
+        },
+        {
+          label: "鏍峰搧鍚嶇О",
+          prop: "sample",
+        },
+        {
+          label: "瑙勬牸鍨嬪彿",
+          prop: "model",
+        },
+        {
+          label: "鏍峰搧鏁伴噺",
+          prop: "num",
+        },
+        {
+          label: "鎬讳环",
+          prop: "price",
+        },
+        {
+          label: "璇曢獙椤圭洰",
+          prop: "inspectionItem",
+        },
+        {
+          label: "濮旀墭鍗曚綅",
+          prop: "company",
+        },
+        {
+          label: "濮旀墭浜�",
+          prop: "name",
+        },
+      ],
+      tableLoading: false,
+      page: {
+        current: 1,
+        size: 20,
+        total: 0,
+      },
+      entity: {
+        company: null,
+        dates: null,
+      },
+      entityCopy: {},
+      upIndex: 0,
+      claimVisible: false,
+      dates: [],
+      index2: 0,
+      total: 0,
+      companyOptions: [], // 濮旀墭鍗曚綅鏋氫妇鍊�
+      outLoading: false,
+    };
+  },
+  mounted() {
+    this.getDates();
+    this.refreshTable();
+    this.entityCopy = this.HaveJson(this.entity);
+  },
+  methods: {
+    getData() {
+      this.tableLoading = true;
+      let params = { ...this.page, ...this.entity };
+      costStatistics(params).then((res) => {
+        this.tableData = res.data.records;
+        this.page.total = res.data.total;
+        this.tableLoading = false;
+      });
+    },
+    pagination({ cutPage, size }) {
+      this.page.current = cutPage;
+      this.page.size = size;
+      this.refreshTable();
+    },
+
+    handleDown() {
+      let data = {
+        company: this.entity.company ? this.entity.company : '',
+        startTime: this.dates[0],
+        endTime: this.dates[1],
+      };
+      this.outLoading = true;
+      exportCommissionFees(data).then((res) => {
+        const blod = new Blob([res], { type: "application/octet-stream" });
+        const url = URL.createObjectURL(blod);
+        const link = document.createElement("a");
+        link.href = url;
+        link.download = "濮旀墭璐圭敤缁熻.xlsx";
+        document.body.appendChild(link);
+        link.click();
+        this.$nextTick(() => {
+          this.$message.success("瀵煎嚭鎴愬姛");
+          this.outLoading = false;
+        });
+      });
+    },
+    getTotal() {
+      costStatistics2(this.entity).then((res) => {
+        this.total = res.data.total;
+      });
+    },
+    getDates() {
+      //褰撳墠鏈堢涓�澶�
+      var y = new Date().getFullYear(); //鑾峰彇骞翠唤
+      var m = new Date().getMonth() + 1; //鑾峰彇鏈堜唤
+      var d = "01";
+      m = m < 10 ? "0" + m : m; //鏈堜唤琛� 0
+      let startDate = [y, m, d].join("-");
+      //褰撳墠鏈堟渶鍚庝竴澶�
+      var y = new Date().getFullYear(); //鑾峰彇骞翠唤
+      var m = new Date().getMonth() + 1; //鑾峰彇鏈堜唤
+      var d = new Date(y, m, 0).getDate(); //鑾峰彇褰撴湀鏈�鍚庝竴鏃�
+      m = m < 10 ? "0" + m : m; //鏈堜唤琛� 0
+      d = d < 10 ? "0" + d : d; //鏃ユ暟琛� 0
+      let endDate = [y, m, d].join("-");
+      this.dates = [startDate, endDate];
+      this.index2++;
+      this.entity.dates = `["${startDate}","${endDate}"]`;
+    },
+    getCompanyOptions() {
+      selectCustomPageList({ ...this.page, ...this.entity })
+        .then((res) => {
+          const list = res.data.records;
+          this.companyOptions = [];
+          list.map((item) => {
+            const obj = Object.assign({
+              value: item.id,
+              label: item.company,
+            });
+            this.companyOptions.push(obj);
+          });
+        })
+        .catch((e) => {
+          this.$message.error("鏌ヨ澶辫触");
+        });
+    },
+    refreshTable() {
+      this.entity.dates = JSON.stringify(this.dates);
+      this.getData();
+      this.getTotal();
+    },
+    refresh() {
+      this.entity = this.HaveJson(this.entityCopy);
+      this.getDates();
+      this.getTotal();
+      this.$nextTick(() => {
+        this.getData();
+      });
+    },
+    handleWeave() {
+      this.claimVisible = true;
+    },
+    // 鏉冮檺鍒嗛厤
+    getPower(radio) {
+      let power = JSON.parse(sessionStorage.getItem("power"));
+      let up = false;
+      let del = false;
+      let add = false;
+      for (var i = 0; i < power.length; i++) {
+        if (power[i].menuMethod == "upInsOrder") {
+          up = true;
+        }
+        if (power[i].menuMethod == "addInsOrder") {
+          add = true;
+        }
+      }
+      if (!up) {
+        this.componentData.do.splice(4, 1);
+      }
+    },
+    handleClose() {
+      this.upLoad = false;
+    },
+    confirmClaim() {
+      console.log(11111111111, this.$refs.Word.getValue());
+    },
+    datesChange(val) {
+      if (val == null) {
+        return;
+      }
+      this.componentData.entity.dates = JSON.stringify(val);
+      this.$refs["ValueTable"].selectList();
+      this.getTotal();
+    },
+  },
+};
+</script>

--
Gitblit v1.9.3