| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431 |
- <template>
- <div id="businessLevel">
- <search-box-new
- ref="searchBox"
- :formData="formData"
- :formList="formList"
- @search="search"
- @init="init"
- >
- <template slot="slotSearch">
- <el-input
- placeholder="输入订单编号/业务员/业务号/所属客户"
- v-model="formData['keyword']"
- clearable
- style="width: 360px"
- >
- </el-input>
- </template>
- </search-box-new>
- <div id="tableList">
- <div class="headerNavTool">
- <div class="leftIndexText">
- {{ navText.title }}
- <strong>{{ navText.index }}</strong>
- {{ navText.ch }}
- <span style="color: #999; font-size: 14px; margin-left: 10px"
- ><i class="el-icon-warning-outline"></i>
- 点击数据,左右键盘可滑动数据表。</span
- >
- </div>
- <div class="rightBtnBox">
- <slot name="customize"></slot>
- <el-button
- type="primary"
- :loading="billPrintLoading"
- @click="handleBillPrint"
- >账单打印</el-button
- >
- <el-button type="primary" @click="openRecordUpdateDialog"
- >记录更新</el-button
- >
- <el-popover
- popper-class="slotPopper"
- placement="bottom-end"
- trigger="click"
- >
- <div class="popoverDis">
- <div class="checkboxHeader">
- <el-checkbox
- :indeterminate="isIndeterminate"
- v-model="checkAll"
- @change="handleCheckAllChange"
- >列展示</el-checkbox
- >
- <div class="initbtns" @click="initVue">重置</div>
- </div>
- <div
- style="height: 1px; width: 100%; background-color: #eaeefb"
- ></div>
- <el-checkbox-group
- class="checkboxGroup"
- v-model="checkedCities"
- @change="handleCheckedCitiesChange"
- >
- <div
- class="checkboxchild"
- v-for="(item, index) in cities"
- :key="index"
- >
- <el-checkbox
- :label="item"
- @change="checkboxChange(item, $event)"
- >{{ item }}</el-checkbox
- >
- <div class="icon-right">
- <i class="el-icon-upload2" @click="upMove(item, index)"></i>
- <i
- class="el-icon-download"
- @click="downMove(item, index)"
- ></i>
- </div>
- </div>
- </el-checkbox-group>
- </div>
- <el-button
- v-if="navText.custom !== false"
- style="margin-left: 10px"
- slot="reference"
- >自定义列</el-button
- >
- </el-popover>
- </div>
- </div>
- <el-table
- ref="tableRef"
- :row-key="(row) => row.orderSn"
- :data="tableData"
- show-summary
- :summary-method="getSummaries"
- style="width: 100%"
- :cell-style="timeStyle"
- v-loading="loading"
- :header-cell-style="{
- 'background-color': '#eee',
- color: '#333',
- fontSize: '14px',
- }"
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
- @expand-change="openContentShow"
- >
- <el-table-column type="expand">
- <template slot="header">
- <div
- class="headShow"
- :class="[headShow ? 'el-icon-minus' : 'el-icon-plus']"
- @click="openHeadShow"
- ></div>
- </template>
- <template slot-scope="scope">
- <div style="display: flex">
- <div style="width: 50px; background: #eeeeee"></div>
- <!-- 子列表 -->
- <el-table
- v-loading="scope.row.subLoading"
- :data="scope.row.subTableList"
- :header-cell-style="{
- 'background-color': '#eee',
- color: '#333',
- fontSize: '14px',
- }"
- >
- <af-table-column
- v-for="(subItem, subIndex) in subTableSet"
- :width="subItem.width"
- :label="subItem.label"
- :align="subItem.dontCenter ? 'left' : 'center'"
- header-align="center"
- :prop="subItem.prop"
- :key="subIndex"
- >
- <template slot-scope="subScope">
- <div v-if="subItem.edit">
- <div v-if="subScope.row.isEdit[subIndex]">
- <el-date-picker
- v-model="subScope.row[subItem.prop]"
- type="date"
- placeholder="请选择日期"
- value-format="timestamp"
- style="width: 99%"
- >
- </el-date-picker>
- </div>
- <div v-else style="padding: 8px">
- {{
- subScope.row[subItem.prop]
- ? $methodsTools.onlyForma(
- subScope.row[subItem.prop] / 1000,
- false
- )
- : "-"
- }}
- </div>
- <div style="margin-top: 2px">
- <div v-if="subScope.row.isEdit[subIndex]">
- <sapn
- class="inputBtn"
- @click="
- editNumber(
- subIndex,
- subScope.row,
- 'confirm',
- scope.row
- )
- "
- >确定</sapn
- >
- <sapn
- class="inputBtn"
- @click="
- editNumber(subIndex, subScope.row, 'cancel')
- "
- >取消</sapn
- >
- </div>
- <sapn
- v-else
- class="inputBtn editInputBtn"
- @click="editNumber(subIndex, subScope.row, 'edit')"
- >
- 修改
- </sapn>
- </div>
- </div>
- <div v-else-if="subItem.label === '性别'">
- {{
- subScope.row[subItem.prop] == 1
- ? "男"
- : subScope.row[subItem.prop] == 2
- ? "女"
- : "未知"
- }}
- </div>
- <div v-else-if="subItem.label === '状态'">
- <div>
- {{
- subScope.row[subItem.prop] == 2 ? "已退款" : "正常"
- }}
- </div>
- <!-- 状态为已退款显示 -->
- <div
- style="white-space: nowrap"
- v-if="
- subScope.row.refundStatus == 2 &&
- subScope.row.refundTime
- "
- >
- ({{
- $methodsTools.onlyForma(subScope.row.refundTime)
- }})
- </div>
- </div>
- <div v-else-if="subItem.label === '成交单价'">
- ¥{{ subScope.row[subItem.prop] }}
- </div>
- <div v-else>
- <div>
- {{
- subScope.row[subItem.prop] == undefined ||
- subScope.row[subItem.prop] == null
- ? "-"
- : subScope.row[subItem.prop]
- }}
- </div>
- <span
- v-if="subItem.label === '题库记录'"
- class="inputBtn editInputBtn"
- @click="openQuestionBankDialog(subScope.row)"
- >
- 更新
- </span>
- </div>
- </template>
- </af-table-column>
- <el-table-column style="width: 100%"> </el-table-column>
- </el-table>
- </div>
- <div style="margin: 0 0 15px 0">
- <pagination
- :total="scope.row.subTotal"
- :pageSize="scope.row.subPageSize"
- :currentPage="scope.row.subPageNum"
- @handleSizeChange="subHandleSizeChange($event, scope.row)"
- @handleCurrentChange="subHandleCurrentChange($event, scope.row)"
- />
- </div>
- </template>
- </el-table-column>
- <!-- 主列表 -->
- <el-table-column
- type="index"
- label="序号"
- width="70"
- align="center"
- header-align="center"
- >
- </el-table-column>
- <af-table-column
- v-for="(item, columnIndex) in compTableSet(tableSet)"
- :label="item.label"
- :align="item.dontCenter ? 'left' : 'center'"
- :prop="item.prop"
- :key="columnIndex"
- :width="item.inputType ? '160' : ''"
- style="white-space: nowrap"
- >
- <template slot-scope="scope">
- <div v-if="item.edit">
- <div v-if="scope.row.isEdit[columnIndex]">
- <!-- 月份编辑 -->
- <el-input
- v-if="
- item.inputType === 'number' && item.label.includes('月')
- "
- :type="item.inputType"
- placeholder="请输入"
- v-model="scope.row.proceedsJson[item.prop]"
- style="width: 99%"
- >
- <div slot="prefix" style="margin-top: 6px">¥</div>
- </el-input>
- <!-- 日期编辑 -->
- <el-date-picker
- v-else-if="item.inputType === 'date'"
- v-model="scope.row[item.prop]"
- :type="item.inputType"
- placeholder="请选择日期"
- value-format="timestamp"
- style="width: 99%"
- >
- </el-date-picker>
- <!-- 其他编辑 -->
- <el-input
- v-else
- :type="item.inputType"
- placeholder="请输入"
- v-model="scope.row[item.prop]"
- style="width: 99%"
- >
- <div
- v-if="item.label == '成本支付'"
- slot="prefix"
- style="margin-top: 6px"
- >
- ¥
- </div>
- </el-input>
- </div>
- <div v-else style="padding: 8px">
- {{ getEditValueName(item, scope) }}
- </div>
- <div style="margin-top: 2px; white-space: nowrap">
- <div v-if="scope.row.isEdit[columnIndex]">
- <sapn
- class="inputBtn"
- @click="editNumber(columnIndex, scope.row, 'confirm', null)"
- >确定</sapn
- >
- <sapn
- class="inputBtn"
- @click="editNumber(columnIndex, scope.row, 'cancel')"
- >取消</sapn
- >
- </div>
- <sapn
- v-else
- class="inputBtn editInputBtn"
- @click="editNumber(columnIndex, scope.row, 'edit')"
- >
- 修改
- </sapn>
- </div>
- </div>
- <div v-else-if="item.label === '收款记录'">
- <sapn
- class="inputBtn"
- @click="openEarnRecordDialog(scope.row, 'check')"
- >
- 查看
- </sapn>
- <div>
- <sapn
- class="inputBtn editInputBtn"
- @click="openEarnRecordDialog(scope.row, 'edit')"
- >
- 修改
- </sapn>
- </div>
- </div>
- <div v-else>
- <template v-if="item.list">
- <div v-for="(content, i) in item.list" :key="i">
- <div>
- {{ content.name }} :
- {{
- item.label == "订单时间"
- ? $methodsTools.onlyForma(scope.row[content.key])
- : scope.row[content.key]
- }}
- </div>
- </div>
- </template>
- <div v-else>
- {{ getEditValueName(item, scope) }}
- </div>
- </div>
- </template>
- </af-table-column>
- </el-table>
- </div>
- <pagination
- :total="total"
- :pageSize="formData.pageSize"
- :currentPage="formData.pageNum"
- @handleSizeChange="handleSizeChange"
- @handleCurrentChange="handleCurrentChange"
- />
- <!-- 收款记录弹窗 -->
- <earnRecordDialog ref="earnRecordDialog" @refresh="search()" />
- <!-- 题库记录弹窗 -->
- <questionBankDialog ref="questionBankDialog" />
- <!-- 记录更新弹窗 -->
- <recordUpdateDialog ref="recordUpdateDialog" />
- </div>
- </template>
-
- <script>
- import searchBoxNew from "@/components/searchBoxNew";
- import pagination from "@/components/pagination";
- import earnRecordDialog from "./earnRecordDialog.vue";
- import questionBankDialog from "./questionBankDialog.vue";
- import recordUpdateDialog from "./recordUpdateDialog.vue";
- import * as baseUrls from "@/utils/request.js";
- import { exportFn } from "@/utils/index.js";
- export default {
- components: {
- searchBoxNew,
- pagination,
- earnRecordDialog,
- questionBankDialog,
- recordUpdateDialog,
- },
- data() {
- return {
- disabledBtn: false,
- headShow: false, // 展开全部行
- loading: false, //当前表单加载是否加载动画
- billPrintLoading: false, // 账单打印加载动画
- navText: {
- title: "2024年祥粤订单销售、收款、回证登记明细表",
- index: 0,
- ch: "条",
- custom: true,
- },
- //搜索
- formList: [
- {
- prop: "orderOrg",
- placeholder: "订单来源",
- scope: "select",
- noClear: false,
- options: [
- {
- label: "旧云学堂",
- value: "旧云学堂",
- },
- {
- label: "业务系统",
- value: "业务系统",
- },
- {
- label: "C端云学堂线下",
- value: "C端云学堂线下",
- },
- {
- label: "C端云学堂线上",
- value: "C端云学堂线上",
- },
- ],
- },
- {
- prop: "educationTypeId",
- placeholder: "教育类型",
- scope: "educationType",
- },
- {
- prop: "businessId",
- placeholder: "业务层次",
- scope: "businessLevel",
- edu: "educationTypeId",
- },
- {
- prop: "creditStatus",
- placeholder: "账款状态",
- scope: "select",
- noClear: false,
- options: [
- {
- label: "已结清",
- value: 1,
- },
- {
- label: "未结清",
- value: 0,
- },
- ],
- },
- {
- prop1: "startTime",
- prop2: "endTime",
- placeholder1: "申请时间开始",
- placeholder2: "申请时间结束",
- scope: "moreDataPicker",
- },
- {
- prop1: "checkStartTime",
- prop2: "checkEndTime",
- placeholder1: "通过时间开始",
- placeholder2: "通过时间结束",
- scope: "moreDataPicker",
- },
- {
- prop: "userName",
- placeholder: "输入学员姓名",
- },
- {
- prop: "userCard",
- placeholder: "输入身份证号",
- },
- {
- scope: "slot",
- slotName: "slotSearch",
- },
- ],
- formData: {
- pageSize: 10,
- pageNum: 1,
- },
- // 表单
- tableSet: [
- {
- label: "来源/编号",
- prop: "orderOrgAndorderSn",
- hidden: true,
- dontCenter: "left",
- list: [
- {
- name: "订单来源",
- key: "orderOrg",
- },
- {
- name: "订单编号",
- key: "orderSn",
- },
- ],
- },
- {
- label: "订单时间",
- prop: "orderTimeAndcheckTime",
- hidden: true,
- dontCenter: "left",
- list: [
- {
- name: "申请时间",
- key: "orderTime",
- },
- {
- name: "通过时间",
- key: "checkTime",
- },
- ],
- },
- {
- label: "业务信息",
- prop: "createUsernameAndcreateNo",
- hidden: true,
- dontCenter: "left",
- list: [
- {
- name: "业务员",
- key: "createUsername",
- },
- {
- name: "业务号",
- key: "createNo",
- },
- ],
- },
- {
- label: "订单所属",
- prop: "tenantNameAndpurchaseOrg",
- hidden: true,
- dontCenter: "left",
- list: [
- {
- name: "所属机构",
- key: "tenantName",
- },
- {
- name: "所属客户",
- key: "purchaseOrg",
- },
- ],
- },
- {
- label: "业务类型",
- prop: "businessAndType",
- hidden: true,
- dontCenter: "left",
- list: [
- {
- name: "业务简称",
- key: "businessAbbreviation",
- },
- {
- name: "教育类型",
- key: "eduName",
- },
- {
- name: "业务层次",
- key: "businessName",
- },
- ],
- },
- // {
- // label: "成交单价",
- // prop: "educationName",
- // hidden: true,
- // },
- {
- label: "成交数量",
- prop: "concludeNum",
- hidden: true,
- },
- {
- label: "成交总价",
- prop: "priceTotal",
- hidden: true,
- },
- {
- label: "1月",
- prop: "one",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "2月",
- prop: "two",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "3月",
- prop: "three",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "4月",
- prop: "four",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "5月",
- prop: "five",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "6月",
- prop: "six",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "7月",
- prop: "seven",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "8月",
- prop: "eight",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "9月",
- prop: "nine",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "10月",
- prop: "ten",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "11月",
- prop: "eleven",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "12月",
- prop: "twelve",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "12月以后",
- prop: "other",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "已退金额",
- prop: "refunded",
- hidden: true,
- },
- {
- label: "实际账款",
- prop: "practical",
- hidden: true,
- },
- {
- label: "已收金额",
- prop: "received",
- hidden: true,
- },
- {
- label: "未收金额",
- prop: "uncollected",
- hidden: true,
- },
- {
- label: "收款记录",
- prop: "proceedsRecord",
- hidden: true,
- },
- {
- label: "发票申请日期",
- prop: "invoiceApplyTime",
- hidden: true,
- },
- {
- label: "发票类型",
- prop: "invoiceType",
- hidden: true,
- },
- {
- label: "积分",
- prop: "integral",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- {
- label: "日期",
- prop: "proceedsDate",
- hidden: true,
- edit: true,
- inputType: "date",
- },
- {
- label: "收入核对日期",
- prop: "proceedsCheckDate",
- hidden: true,
- edit: true,
- inputType: "date",
- },
- {
- label: "变化",
- prop: "proceedsChange",
- hidden: true,
- edit: true,
- inputType: "text",
- },
- {
- label: "成本支付",
- prop: "cost",
- hidden: true,
- edit: true,
- inputType: "number",
- },
- ],
- // 子列表
- subTableSet: [
- {
- label: "姓名",
- prop: "userName",
- width: "100",
- },
- {
- label: "性别",
- prop: "sex",
- width: "100",
- },
- {
- label: "身份证号",
- prop: "userCard",
- width: "230",
- },
- {
- label: "商品名称",
- prop: "goodsName",
- width: "360",
- },
- {
- label: "年份",
- prop: "goodsYear",
- width: "100",
- },
- {
- label: "专业",
- prop: "majorName",
- width: "200",
- },
- {
- label: "成交单价",
- prop: "goodsPrice",
- width: "200",
- },
- {
- label: "完单日期",
- prop: "finishTime",
- edit: true,
- inputType: "date",
- width: "160",
- },
- {
- label: "回证/公示日期",
- prop: "publicityTime",
- edit: true,
- inputType: "date",
- width: "160",
- },
- {
- label: "领证日期",
- prop: "acquireTime",
- edit: true,
- inputType: "date",
- width: "160",
- },
- {
- label: "补考次数",
- prop: "applyNum",
- width: "100",
- },
- {
- label: "题库记录",
- prop: "questionRecord",
- width: "100",
- },
- {
- label: "状态",
- prop: "refundStatus",
- width: "200",
- },
- ],
- checkedCities: [], //自定义列 选中数组
- cities: [], //自定义列 总数组
- isIndeterminate: false, // 用于全选操作
- tableData: [], //表单数据
- total: 0, //一共多少条
- };
- },
- computed: {
- // 用于自定义列
- compTableSet: function () {
- return function (options) {
- var arrays = options.filter((item) => {
- return item.hidden;
- });
- return arrays;
- };
- },
- //可编辑区域的 显示的value值
- getEditValueName: function () {
- return function (item, scope) {
- let value = scope.row[item.prop];
- if (item.inputType === "date") {
- return this.$methodsTools.onlyForma(value / 1000, false) || "-";
- }
- if (
- (scope.row.proceedsJson &&
- scope.row.proceedsJson[item.prop] != undefined) ||
- scope.row.proceedsJson[item.prop] != null
- ) {
- return "¥" + scope.row.proceedsJson[item.prop] || "-";
- }
- if (["成交数量", "变化", "积分", "发票类型"].includes(item.label)) {
- return value == undefined || value == null ? "-" : value;
- }
- if (item.label == "发票申请日期" && value) {
- return this.$methodsTools.onlyForma(value, false) || "-";
- }
- return value == undefined || value == null ? "-" : "¥" + value;
- };
- },
- },
- created() {},
- mounted() {
- this.inittableSet = JSON.stringify(this.tableSet);
- this.initTR();
- this.search();
- },
- activated() {
- this.search();
- },
- methods: {
- editNumber(columnIndex, row, type, saveRow) {
- console.log(row);
- switch (type) {
- case "edit":
- this.$set(row.isEdit, columnIndex, true);
- break;
- case "cancel":
- this.$set(row.isEdit, columnIndex, false);
- break;
- case "confirm":
- this.$set(row.isEdit, columnIndex, false);
- this.handleListEdit(columnIndex, row, saveRow);
- break;
- default:
- break;
- }
- },
- //列表修改操作
- handleListEdit(columnIndex, row, saveRow) {
- const data = JSON.parse(JSON.stringify(row));
- let propName;
- //saveRow有值为子列表修改
- if (saveRow) {
- propName = this.subTableSet[columnIndex].prop;
- } else {
- propName = this.tableSet[columnIndex].prop;
- // 月份提交(为空时默认为0)
- Object.keys(data.proceedsJson).forEach((key) => {
- if (
- data.proceedsJson[key] == "" ||
- data.proceedsJson[key] == null ||
- data.proceedsJson[key] == undefined
- ) {
- data.proceedsJson[key] = 0;
- }
- });
- }
- data[propName] = row[propName];
- // 日期时间进行提交时需要(/1000)操作
- [
- "proceedsDate",
- "proceedsCheckDate",
- "finishTime",
- "publicityTime",
- "acquireTime",
- ].forEach((timeKey) => {
- data[timeKey] = this.$methodsTools.time10to13(row[timeKey], 1);
- });
- delete data.isEdit;
- delete data.subTableList;
- console.log(data, "------data-----");
- const _request = saveRow ? "editSubOrderDetail" : "editOrderDetail";
- this.$api[_request](data)
- .then((res) => {
- if (saveRow) {
- this.getSubTableList(saveRow);
- } else {
- this.search();
- }
- this.$message.success("操作成功");
- })
- .catch(() => {
- this.$message.error("操作失败");
- });
- },
- // 打开收款记录弹窗
- openEarnRecordDialog(row, type) {
- this.$refs.earnRecordDialog.openBoxs(row, type);
- },
- // 打开题库记录弹窗
- openQuestionBankDialog(row) {
- this.$refs.questionBankDialog.openBoxs(row);
- },
- // 打开更新记录弹窗
- openRecordUpdateDialog() {
- this.$refs.recordUpdateDialog.openBoxs();
- },
- // 账单打印
- handleBillPrint() {
- const data = JSON.parse(JSON.stringify(this.formData));
- ["startTime", "endTime", "checkStartTime", "checkEndTime"].forEach(
- (key) => {
- data[key] = data[key] ? data[key] / 1000 : "";
- }
- );
- delete data.pageNum;
- delete data.pageSize;
- this.billPrintLoading = true;
- this.$api
- .billPrint(data)
- .then((res) => {
- exportFn(res.msg, "账单明细");
- // this.$download.name(res.msg);
- this.$message.success("操作成功");
- })
- .finally(() => {
- this.billPrintLoading = false;
- });
- },
- // 头部全部展开/收起
- openHeadShow() {
- this.headShow = !this.headShow;
- this.tableData.forEach((item) => {
- this.$refs.tableRef.toggleRowExpansion(item, this.headShow);
- });
- },
- // 点击展开
- openContentShow(row, expandedRows) {
- console.log(row.orderSn, "---点击展开row.id----");
- console.log(expandedRows, "---expandedRows----");
- const matchingItem = expandedRows.find(
- (item) => item.orderSn === row.orderSn
- );
- if (matchingItem) {
- this.getSubTableList(matchingItem);
- }
- },
- // 获取子表格数据
- getSubTableList(row) {
- this.$set(row, "subLoading", true);
- var data = {
- pageSize: row.subPageSize,
- pageNum: row.subPageNum,
- orderSn: row.orderSn,
- orderBase: row.orderBase,
- orderFrom: row.orderFrom,
- };
- this.$api
- .subOrderDetailList(data)
- .then((res) => {
- row.subTableList = res.rows;
- row.subTableList.forEach((i) => {
- i.finishTime = this.$methodsTools.time10to13(i.finishTime, 2);
- i.publicityTime = this.$methodsTools.time10to13(i.publicityTime, 2);
- i.acquireTime = this.$methodsTools.time10to13(i.acquireTime, 2);
- this.$set(i, "isEdit", Array(this.subTableSet.length).fill(false));
- });
- row.subTotal = res.total;
- })
- .finally(() => {
- this.$set(row, "subLoading", false);
- });
- },
- search(v) {
- this.loading = true;
- if (v === 2) {
- this.formData = {
- pageSize: 10,
- pageNum: 1,
- };
- }
- var data = JSON.parse(JSON.stringify(this.formData));
- this.$api
- .orderDetailList(data)
- .then((res) => {
- this.tableData = res.rows;
- this.tableData.forEach((item) => {
- // 子列表分页参数
- item.subTotal = 0;
- item.subPageNum = 1;
- item.subPageSize = 10;
- item.proceedsDate = this.$methodsTools.time10to13(
- item.proceedsDate,
- 2
- );
- item.proceedsCheckDate = this.$methodsTools.time10to13(
- item.proceedsCheckDate,
- 2
- );
- this.$set(item, "isEdit", Array(this.tableSet.length).fill(false));
- this.$set(item, "subTableList", []);
- this.$set(item, "proceedsJson", item.proceedsJsonMap || {});
- this.$nextTick(() => {
- this.$refs.tableRef.toggleRowExpansion(item, false);
- });
- });
- this.total = res.total;
- this.navText.index = res.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- init() {
- this.search(2);
- this.headShow = false;
- },
- // 合计
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 1) {
- sums[index] = "合计";
- return;
- }
- // 以下不进行合计
- const noSummariesList = [
- "发票申请日期",
- "日期",
- "收入核对日期",
- "变化",
- "收款记录",
- "发票类型",
- ];
- const values = data
- .filter((item) => !noSummariesList.includes(column.label)) //过滤不进行合计的列
- .map((item) => {
- if (
- !isNaN(Number(item[column.property])) ||
- (column.label &&
- column.label.includes("月") &&
- item.proceedsJson[column.property])
- ) {
- return Number(
- column.label.includes("月")
- ? item.proceedsJson[column.property]
- : item[column.property]
- );
- }
- return NaN; // 如果不是数字,返回NaN以便在reduce中排除
- });
- // console.log(values, "---values-----");
- if (!values.every((value) => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- sums[index] =
- column.property === "integral" || column.property === "concludeNum"
- ? sums[index].toFixed(0)
- : "¥" + sums[index].toFixed(2);
- } else {
- sums[index] = " ";
- }
- });
- return sums;
- },
- //初始化
- initTR() {
- this.cities = [];
- this.checkedCities = [];
- this.checkAll = true;
- this.isIndeterminate = false;
- this.tableSet.forEach((item, index) => {
- this.cities.push(item.label);
- if (item.hidden) {
- this.checkedCities.push(item.label);
- }
- });
- this.tableSet = [];
- this.$nextTick(() => {
- this.tableSet = JSON.parse(this.inittableSet);
- });
- if (this.checkedCities.length === 0) {
- this.isIndeterminate = false;
- } else if (this.checkedCities.length === this.cities.length) {
- this.isIndeterminate = false;
- this.checkAll = true;
- } else {
- this.isIndeterminate = true;
- this.checkAll = false;
- }
- },
- //自定义列全选按钮触发
- handleCheckAllChange(val) {
- this.checkedCities = val ? this.cities : [];
- this.isIndeterminate = false;
- if (val) {
- this.tableSet = [];
- this.$nextTick(() => {
- this.tableSet = JSON.parse(this.inittableSet);
- });
- } else {
- this.tableSet.forEach((item, index) => {
- item.hidden = false;
- });
- }
- },
- // 勾选自定义列子选项
- handleCheckedCitiesChange(value) {
- var copyTable = JSON.parse(JSON.stringify(this.tableSet));
- let checkedCount = value.length;
- this.checkAll = checkedCount === this.cities.length;
- this.isIndeterminate =
- checkedCount > 0 && checkedCount < this.cities.length;
- this.tableSet = [];
- this.$nextTick(() => {
- this.tableSet = copyTable;
- });
- },
- checkboxChange(v, e) {
- var copyTable = JSON.parse(JSON.stringify(this.tableSet));
- copyTable.forEach((item) => {
- if (item.label === v) {
- item.hidden = e;
- }
- });
- this.tableSet = [];
- this.$nextTick(() => {
- this.tableSet = copyTable;
- });
- },
- //自定义列重置
- initVue() {
- // this.$emit("initTableset");
- this.tableSet = JSON.parse(this.inittableSet);
- this.initTR();
- },
- // 下移
- downMove(option, index) {
- if (index !== this.tableSet.length - 1) {
- this.tableSet[index] = this.tableSet.splice(
- index + 1,
- 1,
- this.tableSet[index]
- )[0];
- this.cities[index] = this.cities.splice(
- index + 1,
- 1,
- this.cities[index]
- )[0];
- } else {
- this.tableSet.unshift(this.tableSet.splice(index, 1)[0]);
- this.cities.unshift(this.cities.splice(index, 1)[0]);
- }
- var copyTable = JSON.parse(JSON.stringify(this.tableSet));
- this.tableSet = [];
- this.$nextTick(() => {
- this.tableSet = copyTable;
- });
- },
- // 上移
- upMove(option, index) {
- if (index != 0) {
- this.tableSet[index] = this.tableSet.splice(
- index - 1,
- 1,
- this.tableSet[index]
- )[0];
- this.cities[index] = this.cities.splice(
- index - 1,
- 1,
- this.cities[index]
- )[0];
- } else {
- this.tableSet.push(this.tableSet.shift());
- this.cities.push(this.cities.shift());
- }
- var copyTable = JSON.parse(JSON.stringify(this.tableSet));
- this.tableSet = [];
- this.$nextTick(() => {
- this.tableSet = copyTable;
- });
- },
- close() {
- this.dialogVisible = false;
- },
- handleSizeChange(v) {
- this.formData.pageSize = v;
- this.formData.pageNum = 1;
- this.search();
- },
- handleCurrentChange(v) {
- this.formData.pageNum = v;
- this.search();
- },
- subHandleSizeChange(e, row) {
- row.subPageSize = e;
- row.subPageNum = 1;
- this.getSubTableList(row);
- },
- subHandleCurrentChange(e, row) {
- row.subPageNum = e;
- this.getSubTableList(row);
- },
- },
- };
- </script>
-
- <style lang="less" scoped>
- .slotPopper {
- padding: 0px !important;
- }
- #tableList {
- padding: 16px 16px 16px;
- border-radius: 8px;
- box-shadow: 0 0 9px 1px rgba(28, 41, 90, 0.1);
- background: #ffffff;
- .headerNavTool {
- height: 72px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: -16px;
- .rightBtnBox {
- display: flex;
- align-items: center;
- }
- }
- // 去除input增减箭头
- /deep/ input::-webkit-inner-spin-button {
- -webkit-appearance: none !important;
- }
- /deep/ input.el-input__inner {
- text-align: center;
- }
- /deep/ .el-table {
- display: flex;
- flex-direction: column;
- }
- // order默认值为0,只需将表体order置为1即可移到最后,这样合计行就上移到表体上方
- /deep/ .el-table__body-wrapper {
- order: 1;
- }
- .inputBtn {
- margin: 5px 0;
- border: 1px solid #1890ff;
- // background: #f1eff8;
- color: #1890ff;
- border-radius: 10px;
- padding: 0 5px;
- cursor: pointer;
- margin: 5px 5px 0;
- font-size: 12px !important;
- white-space: nowrap;
- &:hover {
- background: #1890ff;
- color: white;
- border: 1px solid #1890ff;
- }
- }
- .editInputBtn {
- background: white;
- border: 1px solid #aaaaaa;
- color: #aaaaaa;
- }
- /deep/ .el-table__expand-icon {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- /deep/ .el-table__expand-icon .el-icon-arrow-right:before {
- content: "\e6d9";
- border: 1px solid #8b8a8a;
- border-radius: 15px;
- }
- /deep/.el-table__expand-icon--expanded .el-icon-arrow-right:before {
- content: "\e6d8";
- }
- .headShow {
- border: 1px solid #8b8a8a;
- border-radius: 15px;
- cursor: pointer;
- color: #8b8a8a;
- }
- }
- /deep/ td.el-table__cell.el-table__expanded-cell {
- padding: 0;
- }
- /deep/.el-button {
- border-radius: 8px;
- }
- .popoverDis {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- font-size: 14px;
- padding: 10px 0;
- overflow-y: auto;
- height: 450px;
- width: 180px;
- .checkboxHeader {
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-left: 13px;
- padding-right: 15px;
- width: 100%;
- .initbtns {
- color: #47a6ff;
- cursor: pointer;
- }
- }
- .checkboxGroup {
- display: flex;
- flex-direction: column;
- width: 100%;
- .checkboxchild {
- width: 100%;
- justify-content: space-between;
- height: 40px;
- display: flex;
- align-items: center;
- padding: 0px 15px 0px 13px;
- transition: all 0.4s;
- &:hover {
- background-color: #ecf5ff;
- }
- &:hover .icon-right {
- display: flex;
- }
- .icon-right {
- display: flex;
- align-items: center;
- width: 30px;
- height: 30px;
- color: #666;
- font-size: 14px;
- display: none;
- i {
- cursor: pointer;
- margin: 0px 3px;
- &:hover {
- color: #47a6ff;
- }
- }
- }
- }
- }
- }
- </style>
-
-
|