From 8319f67b9bec1d19c06eaa4216f0f34c67e3afb1 Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期日, 10 九月 2023 10:08:25 +0800 Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/zhangshi_app_web --- ruoyi-ui/src/views/travel/index.vue | 797 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 621 insertions(+), 176 deletions(-) diff --git a/ruoyi-ui/src/views/travel/index.vue b/ruoyi-ui/src/views/travel/index.vue index 8dd1d80..75d4464 100644 --- a/ruoyi-ui/src/views/travel/index.vue +++ b/ruoyi-ui/src/views/travel/index.vue @@ -2,7 +2,7 @@ <div class="app-container" style="opacity: 1;"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <h1 style="font-size:21px">瀹岀編鏃呴��</h1> - <el-form-item label="鏃堕棿" prop="startTime"> + <el-form-item label="鏃堕棿" prop="startTime" > <el-date-picker v-model="dateRange" style="width: 240px;" @@ -52,122 +52,187 @@ v-hasPermi="['system:role:remove']" >鍒犻櫎</el-button> </el-col> - <el-col :span="1.5"> - <el-button - type="warning" - plain - icon="el-icon-download" - size="mini" - @click="handleExport" - v-hasPermi="['family:note:export']" - >瀵煎嚭</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="warning" - plain - icon="el-icon-download" - size="mini" - @click="handleExportTemplate" - v-hasPermi="['family:note:export']" - >瀵煎叆妯℃澘涓嬭浇</el-button> - </el-col> - <el-col :span="1.2"> - <el-upload - action="" - class="upload-demo" - :show-file-list="false" - :http-request="handleEnport" - > - <el-button size="mini" type="primary" - plain - icon="el-icon-plus" >瀵煎叆</el-button> - </el-upload> - </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <!-- 搴忓彿銆佸熀閲�/鍙拌处銆佹椂闂淬�佹敹鍏�/鏀嚭銆佺敤閫斻�佷娇鐢ㄤ汉銆佺幇閲�/鑷姩鎵e垝銆佷綑棰濄�佺數瀛愭枃浠躲�佸娉� 鎿嶄綔--> <!-- 杩欓噷鏈変釜familyList鏁扮粍 鏄湪data()涓畾涔夌殑 --> - <el-table v-loading="loading" :data="travelpriceList" @selection-change="handleSelectionChange" @row-click="handleShow" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> - <el-table-column type="selection" width="55" align="center" /> - <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="40"/> - <el-table-column label="鏃呮父鍚嶇О" prop="tableName" sortable width="100" /> - <el-table-column label="鏍囬" prop="title" sortable width="100" /> - <el-table-column label="鍘诲悜" prop="destination" sortable width="50" /> + <el-table v-loading="loading" :data="travelpriceList" @row-click="getRowId" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> + <el-table-column type="expand" :cell-class-name="expandRowClassName"> + <template slot-scope="props"> + <div > + <el-table :header-row-class-name="tableHeaderRowClassName" v-loading="loading" :data="travelBase[props.row.id]" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;" :row-class-name="tableRowClassName1" > + <el-table-column label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="50px"/> + + <el-table-column label="鏃堕棿" prop="happenTime" sortable width="100" align="center" > + <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '鈥斺�斺�斺��'}}</template> + </el-table-column> + + <el-table-column label="鍦扮偣" prop="address" sortable width="100" /> + <el-table-column label="浜虹墿" prop="people" sortable width="100" /> + + <el-table-column label="鏍囬" prop="title" sortable width="100" /> + <!-- <el-table-column label="鏃呮湡" prop="travelPeriod" sortable width="100" /> --> + <el-table-column label="鎸佽瘉鏃呮父" prop="certificate" sortable width="100" /> + <el-table-column label="鎬昏垂鐢�" prop="totalPrice" sortable width="100" /> + <el-table-column label="鍏垂/鑷垂" prop="self" sortable width="100" > + <template slot-scope="scope">{{scope.row.self==0?'鍏垂':'鑷垂'}}</template> + </el-table-column> + <el-table-column label="椁愯垂" prop="eat" sortable width="70px" /> + <el-table-column label="浣忓" prop="stay" sortable width="70px" /> + <el-table-column label="浜ら��" prop="traffic" sortable width="70px" /> + <el-table-column label="闂ㄧエ" prop="entrance" sortable width="70px" /> + <el-table-column label="璐墿" prop="shopping" sortable width="70px" /> + <el-table-column label="鐢靛瓙鏂囦欢" prop="url" width="160" > + <template slot-scope="scope" > + <img + class="el-upload-list__item-thumbnail" + src="../../assets/images/deviceLis.png" + alt="" + style="width: 35px; height: 35px;" + fit="cover" + v-if="scope.row.url !== null" + > + <img + class="el-upload-list__item-thumbnail" + src="../../assets/images/deviceA.png" + alt="" + style="width: 35px; height: 35px;" + fit="cover" + v-if="scope.row.url === null" + > + </template> + </el-table-column> + <el-table-column label="澶囨敞" prop="remark" sortable width="100" /> + + + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope" v-if="scope.row.roleId !== 1"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate1(scope.row)" + v-hasPermi="['familymodel:economy:info']" + >淇敼</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['system:role:remove']" + >鍒犻櫎</el-button> + <el-button size="mini" type="text" icon="el-icon-d-arrow-right" @click="handleCheck1(scope.row)">鏌ョ湅璇︽儏</el-button> + + </template> + </el-table-column> + </el-table> + </div> + + + </template> + </el-table-column> + <!-- <el-table-column type="selection" width="55" align="center" /> --> + <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60px"/> <el-table-column label="璧�" prop="startTime" sortable width="100" align="center"> <template slot-scope="scope">{{scope.row.startTime? scope.row.startTime: '鈥斺�斺�斺��'}}</template> </el-table-column> <el-table-column label="姝�" prop="endTime" sortable width="100" align="center"> <template slot-scope="scope">{{scope.row.endTime? scope.row.endTime: '鈥斺�斺�斺��'}}</template> </el-table-column> - <el-table-column label="鎬诲ぉ鏁�" prop="totalDay" sortable width="100" /> - + <el-table-column label="鎬诲ぉ鏁�" prop="totalDay" sortable width="85px" /> + <el-table-column label="鏃呮父鍚嶇О" prop="tableName" sortable width="100" /> + <el-table-column label="鏍囬" prop="title" sortable width="130px" /> + <el-table-column label="鍘诲悜" prop="destination" sortable width="70px" /> <el-table-column label="鏃呮父鎬ц川" prop="property" sortable width="100" /> <el-table-column label="鏃呮父鏂瑰紡" prop="type" sortable width="100" /> <el-table-column label="鎬婚噾棰�" prop="totalCost" sortable width="100" /> - <el-table-column label="椁愯垂" prop="eat" sortable width="100" /> - <el-table-column label="浣忓" prop="stay" sortable width="100" /> - <el-table-column label="浜ら��" prop="traffic" sortable width="100" /> - <el-table-column label="闂ㄧエ" prop="entrance" sortable width="100" /> - <el-table-column label="璐墿" prop="shopping" sortable width="80" /> + <el-table-column label="椁愯垂" prop="eat" sortable width="70px" /> + <el-table-column label="浣忓" prop="stay" sortable width="70px" /> + <el-table-column label="浜ら��" prop="traffic" sortable width="70px" /> + <el-table-column label="闂ㄧエ" prop="entrance" sortable width="70px" /> + <el-table-column label="璐墿" prop="shopping" sortable width="70px" /> - <el-table-column label="鎿嶄綔" align="center" sortable width="200" > + <el-table-column fixed label="鎿嶄綔" align="center" sortable width="180" > <template slot-scope="scope" v-if="scope.row.roleId !== 1"> - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" - v-hasPermi="['familymodel:economy:info']" + v-hasPermi="['person:travel:edit']" >淇敼</el-button> <el-button size="mini" type="text" - class="button_delete" + icon="el-icon-circle-plus" + @click="handleAdd1(scope.row)" + + v-hasPermi="['person:travel:edit']" + >鏂板</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']" - > <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn></el-button> - <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['familymodel:economy:info']"> + > 鍒犻櫎</el-button> + <!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['familymodel:economy:info']"> <el-button size="mini" type="text" icon="el-icon-d-arrow-right" @click="handleCheck(scope.row)">鏌ョ湅璇︽儏</el-button> - </el-dropdown> - <el-button class="button" size="mini" type="text" @click="handleShow" v-hasPermi="['system:role:add']"> - <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn> </el-button> + </el-dropdown> --> + <!-- <el-button class="button" size="mini" type="text" @click="handleShow" v-hasPermi="['system:role:add']"> + <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn> </el-button> --> + </template> + </el-table-column> </el-table> + <div style="background-color: #FEF7FC;"> + <el-dialog :title="title" :visible.sync="openDataScope" width="1300px" append-to-body > + <div style="background-color: #FEF7FC;"> + <el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" > + <el-table-column type="selection" width="50" align="center" /> + <el-table-column label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80px"/> + <el-table-column label="鏃堕棿" prop="happenTime" sortable width="150" align="center"> + <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '鈥斺�斺�斺��'}}</template> + </el-table-column> + <el-table-column label="鍐呭" prop="content" sortable :show-overflow-tooltip="true" width="100px" /> + <el-table-column label="鎬婚噾棰�" prop="totalCost" sortable :show-overflow-tooltip="true" width="100px" /> + <el-table-column label="椁愯垂" prop="eat" sortable :show-overflow-tooltip="true" width="100px" /> + <el-table-column label="浣忓" prop="stay" sortable :show-overflow-tooltip="true" width="100px" /> + <el-table-column label="浜ら��" prop="traffic" sortable :show-overflow-tooltip="true" width="100px" /> + <el-table-column label="闂ㄧエ" prop="entrance" sortable :show-overflow-tooltip="true" width="100px" /> + <el-table-column label="璐墿" prop="shopping" sortable :show-overflow-tooltip="true" width="100px" /> - <el-dialog :title="title" :visible.sync="openDataScope" width="1500px" append-to-body > - <div style="background-color: #FEF7FC;"> - <el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" > - <el-table-column type="selection" width="50" align="center" /> - <el-table-column label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="150"/> - <el-table-column label="鏃堕棿" prop="happenTime" sortable width="150" align="center"> - <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '鈥斺�斺�斺��'}}</template> - </el-table-column> - <el-table-column label="鍐呭" prop="content" sortable :show-overflow-tooltip="true" width="160" /> - <el-table-column label="鎬婚噾棰�" prop="totalCost" sortable :show-overflow-tooltip="true" width="160" /> - <el-table-column label="椁愯垂" prop="eat" sortable :show-overflow-tooltip="true" width="160" /> - <el-table-column label="浣忓" prop="stay" sortable :show-overflow-tooltip="true" width="160" /> - <el-table-column label="浜ら��" prop="traffic" sortable :show-overflow-tooltip="true" width="150" /> - <el-table-column label="闂ㄧエ" prop="entrance" sortable :show-overflow-tooltip="true" width="150" /> - <el-table-column label="璐墿" prop="shopping" sortable :show-overflow-tooltip="true" width="150" /> + <el-table-column label="鎿嶄綔" align="center" sortable class-name="small-padding fixed-width"> + <template slot-scope="scope" v-if="scope.row.roleId !== 1"> - </el-table> - <pagination - v-show="total>0" - :total="total" - :page.sync="queryParams.pageNum" - :limit.sync="queryParams.pageSize" - @pagination="getList" - style="background: #FEF7FC;" - /> - </div> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate1(scope.row)" + v-hasPermi="['familymodel:economy:info']" + >淇敼</el-button> - </el-dialog> + </template> + </el-table-column> + </el-table> + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + style="background: #FEF7FC;" + /> + </div> + + </el-dialog> + </div> <pagination v-show="total>0" :total="total" @@ -179,12 +244,59 @@ <!-- 娣诲姞鎴栦慨鏀硅祫浜т俊鎭厤缃璇濇 --> - <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> - <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px"> - <el-form-item label="鍙拌处" prop="type"> - <el-input v-model="formDat.type" placeholder="璇疯緭鍏ュ唴瀹�" clearable :style="{width: '100%'}" ></el-input> + <el-dialog :title="title" :visible.sync="dialog1Visible" width="800px" append-to-body> + <el-form ref="elForm2" :model="formDat4" :rules="rules2" size="medium" label-width="100px"> + + <el-form-item label="鏍囬" prop="title"> + <el-input v-model="formDat4.title" placeholder="璇疯緭鍏ユ爣棰�" clearable :style="{width: '80%'}" > + </el-input> + </el-form-item> + <el-form-item label="璧峰鏃堕棿" prop="startTime"> + <el-input type="date" v-model="formDat4.startTime" placeholder="璇烽�夋嫨璧峰鏃堕棿" style="width: 80%;"></el-input> + </el-form-item> + <el-form-item label="缁撴潫鏃堕棿" prop="endTime"> + <el-input type="date" v-model="formDat4.endTime" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" style="width: 80%;"></el-input> + </el-form-item> + <el-form-item label="鍘诲悜" prop="destination"> + <el-select v-model="formDat4.destination" placeholder="璇烽�夋嫨鍘诲悜" clearable :style="{width: '80%'}" > + <el-option label="鍥藉唴" value="鍥藉唴"></el-option> + <el-option label="鍥藉" value="鍥藉"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃呮父鍚嶇О" prop="tableName"> + <el-input v-model="formDat4.tableName" placeholder="璇疯緭鍏ユ梾娓稿悕绉�" clearable :style="{width: '80%'}" > + </el-input> + </el-form-item> + <el-form-item label="鏃呮父鎬ц川" prop="property"> + <el-select v-model="formDat4.property" placeholder="璇烽�夋嫨鎬ц川" clearable :style="{width: '80%'}" > + <el-option label="鑷垂" value="鑷垂"></el-option> + <el-option label="鍏垂" value="鍏垂"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鏃呮父鏂瑰紡" prop="type"> + <el-select v-model="formDat4.type" placeholder="璇烽�夋嫨鏃呮父鏂瑰紡" clearable :style="{width: '80%'}" > + <el-option label="鑷┚娓�" value="鑷┚娓�"></el-option> + <el-option label="璺熷洟娓�" value="璺熷洟娓�"></el-option> + <el-option label="鑷姪娓�" value="鑷姪娓�"></el-option> + </el-select> </el-form-item> + </el-form> + <h4 class="form-header"> </h4> + + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitDataScope">纭� 瀹�</el-button> + <el-button @click="cancelData">鍙� 娑�</el-button> + </div> + </el-dialog> + + <el-dialog title="娣诲姞姣忔棩琛岀▼鍐呭" :visible.sync="centerDialogVisible" width="60%" center append-to-body> + <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px"> + <h4 class="form-header">琛岀▼鍐呭 </h4> + <el-form-item label="鏍囬" prop="title"> + <el-input v-model="formDat.title" placeholder="璇疯緭鍏ユ爣棰�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> <el-form-item label="鏃堕棿" prop="happenTime"> <el-input v-model='formDat.happenTime' @@ -192,31 +304,41 @@ placeholder='閫夋嫨鏃ユ湡' ></el-input> </el-form-item> - <el-form-item label="鏀跺叆/鏀嚭" prop="price"> - <el-select v-model="formDat.price" placeholder="璇烽�夋嫨鏀跺叆/鏀嚭" clearable :style="{width: '100%'}" > + <el-form-item label="鍦扮偣" prop="address"> + <el-input v-model="formDat.address" placeholder="璇疯緭鍏ュ湴鐐�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="浜虹墿" prop="people"> + <el-input v-model="formDat.people" placeholder="璇疯緭鍏ヤ汉鐗�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="鏃呮湡" prop="travelPeriod"> + <el-input v-model="formDat.travelPeriod" placeholder="璇疯緭鍏ユ梾鏈�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="鎸佽瘉鏃呮父" prop="certificate"> + <el-select v-model="formDat.certificate" placeholder="璇烽�夋嫨璇佷欢" clearable :style="{width: '80%'}" > + <el-option label="灞呮皯韬唤璇�" value="灞呮皯韬唤璇�"></el-option> + <el-option label="涓存椂韬唤璇�" value="涓存椂韬唤璇�"></el-option> + <el-option label="鎴峰彛鏈�" value="鎴峰彛鏈�"></el-option> + <el-option label="鎶ょ収" value="鎶ょ収"></el-option> + <el-option label="瀛︾敓璇�" value="瀛︾敓璇�"></el-option> + </el-select> + </el-form-item> + <!-- <el-form-item label="璐圭敤" prop="totalPrice"> + <el-input v-model="formDat.totalPrice" placeholder="璇疯緭鍏ユ�诲叡璐圭敤" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> --> + <el-form-item label="鍏垂/鑷垂" prop="self"> + <el-select v-model="formDat.self" placeholder="璇烽�夋嫨鑷垂/鍏垂" clearable :style="{width: '100%'}" > <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value" ></el-option> </el-select> </el-form-item> - <el-form-item label="閲戦" prop="balance"> - <el-input v-model="formDat.balance" placeholder="璇疯緭鍏ヤ綑棰�" clearable :style="{width: '100%'}" > - </el-input> - </el-form-item> - <el-form-item label="鐢ㄩ��" prop="useFor"> - <el-input v-model="formDat.useFor" placeholder="璇疯緭鍏ョ敤閫�" clearable :style="{width: '100%'}" > - </el-input> - </el-form-item> - <el-form-item label="浣跨敤浜�" prop="usePeople"> - <el-input v-model="formDat.usePeople" placeholder="璇疯緭鍏ヤ娇鐢ㄤ汉" clearable :style="{width: '100%'}" > - </el-input> - </el-form-item> - <el-form-item label="鏀粯鏂瑰紡" prop="kind"> - <el-input v-model="formDat.kind" placeholder="璇疯緭鍏ユ敮浠樻柟寮�" clearable :style="{width: '100%'}" > - </el-input> - </el-form-item> <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="formDat.remark" placeholder="璇疯緭鍏ュ娉�" clearable :style="{width: '100%'}" ></el-input> </el-form-item> + <h4 class="form-header">鐩稿叧鍥剧墖 </h4> <el-upload @@ -275,14 +397,41 @@ </el-upload> </el-form> + <el-form ref="elForm1" :model="formDat1" :rules="rules1" size="medium" label-width="100px"> + <h4 class="form-header">璐圭敤鏄庣粏 </h4> + <el-form-item label="鍐呭" prop="content"> + <el-input v-model="formDat1.content" placeholder="璇疯緭鍏ュ唴瀹�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="浣忓璐圭敤" prop="stay"> + <el-input v-model="formDat1.stay" placeholder="璇疯緭鍏ヤ綇瀹胯垂鐢�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="浜ら�氳垂鐢�" prop="traffic"> + <el-input v-model="formDat1.traffic" placeholder="璇疯緭鍏ヤ氦閫氳垂鐢�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="椁愯垂" prop="eat"> + <el-input v-model="formDat1.eat" placeholder="璇疯緭鍏ラ璐圭敤" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="璐墿璐圭敤" prop="shopping"> + <el-input v-model="formDat1.shopping" placeholder="璇疯緭鍏ヨ喘鐗╄垂鐢�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + <el-form-item label="闂ㄧエ璐圭敤" prop="entrance"> + <el-input v-model="formDat1.entrance" placeholder="璇疯緭鍏ラ棬绁ㄨ垂鐢�" clearable :style="{width: '100%'}" > + </el-input> + </el-form-item> + + </el-form> <h4 class="form-header"> </h4> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitDataScope">纭� 瀹�</el-button> - <el-button @click="cancelData">鍙� 娑�</el-button> + <el-button type="primary" @click="submitDataScope1">纭� 瀹�</el-button> + <el-button @click="centerDialogVisible = false">鍙� 娑�</el-button> </div> </el-dialog> - </div> </template> @@ -294,7 +443,7 @@ //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁� --鎺ュソ浜� -import {listTravelPrice,enload,getTravelPriceInfo,delTravelPrice, addTravelPrice, uploadPic} from "@/api/travel/index"; +import {listTravelPrice,enload,listTravelBase,delTravelPrice, addTravelPrice, uploadPic,updateTravelPrice,addTravelBase} from "@/api/travel/index"; export default { name: "Role", @@ -305,7 +454,6 @@ disabled: false, loading: true, formData:[], - detailList:[], // 閫変腑鏁扮粍 ids: [], // 闈炲崟涓鐢� @@ -316,12 +464,19 @@ showSearch: true, // 鎬绘潯鏁� total: 0, - // 瀹跺ぇ浜嬭琛ㄦ牸鏁版嵁 + // travelpriceList: [], + travelBase:[], + baseData:[], + detailList:[], // 寮瑰嚭灞傛爣棰� title: "", + title1:"", // 鏄惁鏄剧ず寮瑰嚭灞� open: false, + centerDialogVisible: false, + dialog1Visible: false, + dialog2Visible: false, // 鏄惁鏄剧ず寮瑰嚭灞傦紙鏁版嵁鏉冮檺锛� openDataScope: false, menuExpand: false, @@ -340,13 +495,37 @@ dsb:true, btn:false, formDat: { - type: undefined, - createTime: undefined, - useFor: undefined, - usePeople: undefined, - kind:undefined, + people: undefined, + address: undefined, + happenTime: undefined, + title: undefined, + travelPeriod:undefined, + certificate: undefined, + totalPrice: undefined, + self: undefined, remark: undefined, url: undefined, + }, + formDat1: { + eat: undefined, + stay: undefined, + traffic: undefined, + entrance: undefined, + shopping:undefined, + content: undefined, + }, + formDat2: { + id: undefined, + detailList: undefined, + }, + formDat4: { + type: undefined, + startTime: undefined, + title: undefined, + endTime: undefined, + property:undefined, + tableName: undefined, + destination: undefined, detailList:undefined, }, // 鑿滃崟鍒楄〃 @@ -369,53 +548,131 @@ children: "children", label: "label" }, - // 琛ㄥ崟鏍¢獙 + //琛ㄥ崟鏍¢獙 rules: { - usePeople: [{ + people: [{ required: true, - message: '璇疯緭鍏ヤ娇鐢ㄤ汉', + message: '璇疯緭鍏ヤ汉鐗�', trigger: 'blur' }], - useFor: [{ + address: [{ required: true, - message: '璇疯緭鍏ョ敤閫�', + message: '璇疯緭鍏ュ湴鐐�', trigger: 'blur' }], - type: [{ + title: [{ required: true, - message: '璇疯緭鍏ュ彴璐﹀唴瀹�', + message: '璇疯緭鍏ユ爣棰�', trigger: 'blur' }], - balance: [{ + travelPeriod: [{ required: true, - message: '璇疯緭鍏ラ噾棰�', + message: '璇疯緭鍏ユ梾鏈�', trigger: 'blur' }], - kind: [{ - // required: true, - message: '璇疯緭鍏ユ敮浠樻柟寮�', + certificate: [{ + required: true, + message: '璇疯緭鍏ヨ瘉浠�', trigger: 'blur' }], - createTime: [{ + happenTime: [{ required: true, message: '璇烽�夋嫨鏃ユ湡閫夋嫨', trigger: 'change' }], - price: [{ + totalPrice: [{ required: true, - message: '璇烽�夋嫨浜嬮」鍐呭', + message: '璇烽�夋嫨璐圭敤', + trigger: 'blur' + }], + self: [{ + required: true, + message: '璇烽�夋嫨鍏垂/鑷垂', + trigger: 'change' + }], + + }, + rules1: { + stay: [{ + required: true, + message: '璇疯緭鍏ヤ汉鐗�', + trigger: 'blur' + }], + + content: [{ + required: true, + message: '璇疯緭鍏ュ湴鐐�', + trigger: 'blur' + }], + traffic: [{ + required: true, + message: '璇疯緭鍏ユ爣棰�', + trigger: 'blur' + }], + entrance: [{ + required: true, + message: '璇疯緭鍏ユ梾鏈�', + trigger: 'blur' + }], + eat: [{ + required: true, + message: '璇疯緭鍏ヨ瘉浠�', + trigger: 'blur' + }], + shopping: [{ + required: true, + message: '璇烽�夋嫨鏃ユ湡閫夋嫨', + trigger: 'change' + }], + + }, + rules2: { + type: [{ + required: true, + message: '璇疯緭鍏ユ梾娓告柟寮�', + trigger: 'blur' + }], + property: [{ + required: true, + message: '璇疯緭鍏ユ梾娓告�ц川', + trigger: 'change' + }], + destination: [{ + required: true, + message: '璇烽�夋嫨鍘诲悜', + trigger: 'change' + }], + tableName: [{ + required: true, + message: '璇疯緭鍏ユ梾娓稿悕绉�', + trigger: 'blur' + }], + startTime: [{ + required: true, + message: '璇烽�夋嫨鏃ユ湡', + trigger: 'change' + }], + endTime: [{ + required: true, + message: '璇烽�夋嫨鏃ユ湡', + trigger: 'change' + }], + title: [{ + required: true, + message: '璇烽�夋嫨鏍囬', trigger: 'blur' }], }, + typeOptions: [ { - value: '鏀跺叆', - label: '鏀跺叆', + value: '0', + label: '鑷垂', }, { - value: '鏀嚭', - label: '鏀嚭', + value: '1', + label: '鍏垂', }], typeOptions1: [ { @@ -431,27 +688,20 @@ }, created() { this.getList(); - }, methods: { - - //鍩洪噾/鍙拌处鐨勯�夋嫨 - getSrc1(type) { - if (type === 0) { - return '鍩洪噾' - }else { - return '鍙拌处' - } + //灞曞紑琛� + expandRowClassName({ row, rowIndex }) { + // 杩斿洖瀵瑰簲琛岀殑鏍峰紡閰嶇疆瀵硅薄 + return { + 'expand-row': true, // 娣诲姞鑷畾涔夋牱寮忕被鍚� + 'expand-row-height': '40px' // 璁剧疆灞曞紑琛岀殑楂樺害 + }; }, - - getSrc2(kind) { - if (kind == 0) { - return '鐜伴噾' - }else { - return '鑷姩鎵e垝' - } + //棣栬鏍峰紡 + tableHeaderRowClassName() { + return 'custom-header-row'; }, - // 鍙栨秷鎸夐挳 cancelData() { this.open = false; @@ -466,7 +716,14 @@ return "statistics-warning-row"; } }, - + //闅旇鍙樿壊 + tableRowClassName1({ row, rowIndex }) { + if (rowIndex % 2 == 0) { + return "statistics-warning-row3"; + } else { + return "statistics-warning-row2"; + } + }, /** 鏌ヨ瑙掕壊鍒楄〃 */ //鍒楄〃鏄剧ず瀹跺ぇ浜嬭 @@ -478,16 +735,67 @@ // console.log(this.queryParams) // listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => { - listTravelPrice(this.queryParams).then(response => { + listTravelPrice(this.queryParams).then(async response => { // alert(123) // console.log(response.data) this.travelpriceList = response.data.data; - console.log(this.travelpriceList[0]) + // const targetId = row.id + // const detailList = filteredData.detailList; + // console.log("detailList" ); + // console.log(detailList); + // resolve(detailList); + // console.log(this.detailList) + // console.log(this.travelpriceList); this.total = response.data.total; + + for (let item of this.travelpriceList) { + this.queryParams.fid = item.id + this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0] + this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1] + const baseResponse = await listTravelBase(this.queryParams); + const baseData = baseResponse.data.data; + this.$set(this.travelBase, item.id, baseData); + // debugger + this.total = response.data.total; + + for(let item1 of item.detailList){ + console.log(item1); + + const targetDate = item1.happenTime; // 瑕佹煡鎵剧殑鐩爣鏃ユ湡 + // console.log("targetDate" + targetDate); + const keys = Object.keys(baseData); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const baseItem = baseData[key]; + // console.log("baseItem" + baseItem); + if (baseItem.happenTime === targetDate) { + // 鎵惧埌浜嗙鍚堟潯浠剁殑鏁版嵁 + const baseItem = baseData[key]; + delete item1.id; + const mergedItem = { ...baseItem, ...item1 }; + + this.$set(baseData, key, mergedItem); + // console.log(baseData); + + break; + + } + + } + + } + + + } + + // console.log("鎵撳嵃瀹屾瘯"); + this.loading = false; } ); + }, + handleRemove(file) { for(let i = 0; i < this.fileListOther.length; i++) { @@ -504,6 +812,7 @@ getRowId(row) { return row.id + }, // 鍙栨秷鎸夐挳锛堟暟鎹潈闄愶級 cancelDataScope() { @@ -555,20 +864,134 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.reset(); - this.open = true; - this.title = "娣诲姞瀹跺涵鏀舵敮鍙拌处"; + this.dialog1Visible = true; + this.dialog2Visible = false; + this.title = "娣诲姞鏃呮父鍐呭"; + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd1(row) { + const id = row.id + this.row = row; + this.reset(); + this.centerDialogVisible = true; + this.title1 = "娣诲姞姣忔棩琛岀▼鍐呭"; + }, + /** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */ + submitDataScope1: async function() { + const id = this.row.id + + this.formDat2.detailList = []; + console.log("璋冭瘯"); + // console.log(this.formDat2.detailList); + // await this.getList().then(detailList => { + // this.formDat2.detailList = detailList; + // console.log(this.formDat2.detailList); + // }); + + // async function getData() { + + // listTravelPrice(this.queryParams).then(async response => { + + // this.travelpriceList = response.data.data; + + // const filteredData = this.travelpriceList.filter(item => item.id === id); + // this.total = response.data.total; + // console.log( filteredData[0].detailList); + + + // // this.formDat2.detailList =filteredData[0].detailList + // this.formDat2.detailList = filteredData[0].detailList; + // // console.log(this.formDat2.detailList ); + // // console.log(this.formDat2.detailList); + // return this.formDat2 + // }).catch(error => { + // console.error("璇锋眰閿欒:", error); + // }); + // } + + async function getData() { + try { + const response = await listTravelPrice(this.queryParams); + this.travelpriceList = response.data.data; + + const filteredData = this.travelpriceList.filter(item => item.id === id); + console.log(filteredData[0].detailList); + this.total = response.data.total; + + return filteredData[0].detailList; + } catch (error) { + console.error("璇锋眰閿欒:", error); + } + } + this.formDat2.detailList = await getData(); // 璋冪敤async鍑芥暟鏉ヨ幏鍙栨暟鎹苟璧嬪�肩粰detailList + + console.log(" this.formDat2.detailList"); + console.log( this.formDat2.detailList); + + + let ul = this.fileList.map(function (elem){ + return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") + }).join(",") + let uls = this.fileListOther.map(function (elem){ + return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") + }).join(",") + this.formDat.url = ul+","+uls + // const fid = this.$route.params && this.$route.params.id; + // this.formDat.feeId = this.$route.params && this.$route.params.id; + this.formDat.feeId = id; + this.formDat1.happenTime = this.formDat.happenTime; + this.formDat2.detailList.push(this.formDat1); + this.formDat2.id = id; + const stay = parseFloat(this.formDat1.stay); + const traffic = parseFloat(this.formDat1.traffic); + const eat = parseFloat(this.formDat1.eat); + const shopping = parseFloat(this.formDat1.shopping); + const entrance = parseFloat(this.formDat1.entrance); + + const totalPrice = stay + traffic + eat + shopping + entrance; + console.log("鎬昏垂鐢�"); + console.log(totalPrice); + this.formDat.totalPrice=totalPrice; + + console.log(this.formDat2) + console.log(this.formDat); + + this.$refs["elForm"].validate(valid => { + if (valid) { + + addTravelBase(this.formDat).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.centerDialogVisible = false; + this.getList(); + }); + + } + }); + this.$refs["elForm1"].validate(valid => { + if (valid) { + + + updateTravelPrice(this.formDat2).then(response => { + // this.$modal.msgSuccess("璐圭敤鏂板鎴愬姛"); + this.centerDialogVisible = false; + }); + + } + }); + }, // 寮圭獥 handleShow(row){ const id = row.id; + this.openDataScope = true // this.getList() //alert(123) this.detailList = row.detailList // alert(row.index) - this.title = "灞曠ず璇︽儏"; - + this.title = "姣忔棩璐圭敤璇︽儏"; + this.getList1() }, /** 鏌ョ湅璇︾粏淇℃伅 */ @@ -578,18 +1001,29 @@ // alert(row.fee_id) this.$router.push("/self/travel/Info/" + id); }, + handleCheck1(row){ + const id = row.id; + this.$router.push("/self/travel/travelInfo/" + id); + }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { - const id = row.id; - // let jd = true - // this.$router.push({ - // path:"/self/travel/edit/" + id, - // query:{ - // detail:jd - // } - // }); + const id = row.id; + // console.log(id); this.$router.push("/self/travel/edit/" + id); + + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate1(row) { + const id = row.id; + let jd = true + + this.$router.push({ + path:"/self/travel/travelInfo/" + id, + query:{ + detail:jd + } + }); }, @@ -600,21 +1034,22 @@ /** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */ submitDataScope: function() { - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { + this.formDat4.detailList = []; + this.$refs["elForm2"].validate(valid => { if (valid) { - - addEconomy(this.formDat).then(response => { + console.log(this.formDat4); + addTravelPrice(this.formDat4).then(response => { this.$modal.msgSuccess("鏂板鎴愬姛"); - this.open = false; + + this.dialog1Visible = false; this.getList(); }); + // 娓呯┖formDat瀵硅薄鐨勬暟鎹� + Object.keys(this.formDat4).forEach(key => { + this.formDat4[key] = ''; + }); + this.handleRemove(this.fileList[0]); + this.handleRemoveFile(this.fileListOther[0]); } }); }, @@ -702,7 +1137,13 @@ } .el-table__row.statistics-warning-row1 { background: #FFEFF2; +} +.el-table__row.statistics-warning-row2 { + background: #EBFFF2; +} +.el-table__row.statistics-warning-row3 { + background: #f8f8dc; } .button { background: center no-repeat url('../../assets/images/寮圭獥 1.png') ; @@ -713,4 +1154,8 @@ /* margin-left: 66vw; */ } +.custom-header-row { + background-color: #EBAFB4 /* 鏇存敼涓轰綘鎯宠鐨勮儗鏅鑹� */ + /* color: #FFF; 鏇存敼涓轰綘鎯宠鐨勬枃瀛楅鑹� */ +} </style> -- Gitblit v1.9.1