123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item label="品牌" prop="brand">
- <el-select v-model="queryParams.brand" placeholder="请输入品牌" clearable size="small"
- @keyup.enter.native="handleQuery">
- <el-option v-for="(item, index) in searchOption[0]" :value="item" :key="index">{{ item }}</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="机组功率(kw)" prop="unitPowerKw">
- <el-select v-model="queryParams.unitPowerKw" placeholder="请输入机组功率(kw)" clearable size="small"
- @keyup.enter.native="handleQuery">
- <el-option v-for="(item, index) in searchOption[1]" :value="item" :key="index">{{ item }}</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="机组功率(kva)" prop="unitPowerKva">
- <el-select v-model="queryParams.unitPowerKva" placeholder="请输入机组功率(kva)" clearable size="small"
- @keyup.enter.native="handleQuery">
- <el-option v-for="(item, index) in searchOption[2]" :value="item" :key="index">{{ item }}</el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
- v-hasPermi="['price:info:add']">新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
- v-hasPermi="['price:info:edit']">修改</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
- v-hasPermi="['price:info:remove']">删除</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button type="warning" icon="el-icon-top" size="mini" @click="handleExport"
- v-hasPermi="['price:info:export']">导出</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-upload v-hasPermi="['price:info:import']" :show-file-list="false" class="upload-demo" with-credentials :headers="{
- 'Authorization': 'Bearer ' + token
- }" action="http://xxgl.zzxcx.net/xxgl-admin/price/info/import" :on-success="handleSuccess" multiple
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
- :file-list="fileList">
- <el-button type="warning" icon="el-icon-bottom" size="mini" v-hasPermi="['price:info:export']">导入</el-button>
- </el-upload>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table fit :row-style="{ height: '35px' }" v-loading="loading" :data="infoList"
- @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="品牌" align="center" prop="brand" />
- <el-table-column width="180px" label="机组型号" align="center" prop="unitModel" />
- <el-table-column label="机组功率(kw)" align="center" prop="unitPowerKw" />
- <el-table-column label="机组功率(kva)" align="center" prop="unitPowerKva" />
- <el-table-column label="频率(Hz)" align="center" prop="rate" />
- <el-table-column width="180px" label="柴油机型号" align="center" prop="dieselEngineModel" />
- <el-table-column label="转速" align="center" prop="speed" />
- <el-table-column label="动力价格" align="center" prop="powerPrice" />
- <el-table-column width="180px" label="发电机型号" align="center" prop="generatorModel" />
- <el-table-column label="发电机价格" align="center" prop="generatorPrice" />
- <el-table-column label="静音机壳价格" align="center" prop="mutePrice" />
- <el-table-column label="开架价格" align="center" prop="openPrice" />
- <el-table-column label="ATS型号" align="center" prop="atsModel" />
- <el-table-column label="ATS价格" align="center" prop="atsPrice" />
- <el-table-column label="电瓶型号" align="center" prop="batteryModel" />
- <el-table-column label="电瓶价格" align="center" prop="batteryPrice" />
- <el-table-column label="控制器铭贝" align="center" prop="controllerMinbei" />
- <el-table-column label="控制器价格" align="center" prop="controllerPrice" />
- <el-table-column label="合计含税成本(静音)" align="center" prop="totalCostMute" />
- <el-table-column label="合计含税成本(开架)" align="center" prop="totalCostOpen" />
- <el-table-column label="静音尺寸" align="center" prop="muteLong" />
- <el-table-column label="静音尺寸" align="center" prop="muteWidth" />
- <el-table-column label="静音尺寸" align="center" prop="muteHigh" />
- <el-table-column label="开架尺寸" align="center" prop="openLong" />
- <el-table-column label="开架尺寸" align="center" prop="openWidth" />
- <el-table-column label="开架尺寸" align="center" prop="openHigh" />
- <el-table-column label="CKD尺寸" align="center" prop="ckdLong" />
- <el-table-column label="CKD尺寸" align="center" prop="ckdWidth" />
- <el-table-column label="CKD尺寸" align="center" prop="ckdHigh" />
- <el-table-column fixed="right" width="180px" label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
- v-hasPermi="['price:info:edit']">修改</el-button>
- <el-button @click="() => {
- $router.push('/gallery?id=' + scope.row.id)
-
- }" size="mini" type="text" icon="el-icon-picture-outline" >图片</el-button>
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
- v-hasPermi="['price:info:remove']">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
- @pagination="getList" />
- <!-- 添加或修改报价对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-form-item label="品牌" prop="brand">
- <el-input v-model="form.brand" placeholder="请输入品牌" />
- </el-form-item>
- <el-form-item label="机组型号" prop="unitModel">
- <el-input v-model="form.unitModel" placeholder="请输入机组型号" />
- </el-form-item>
- <el-form-item label="机组功率(kw)" prop="unitPowerKw">
- <el-input v-model="form.unitPowerKw" placeholder="请输入机组功率(kw)" />
- </el-form-item>
- <el-form-item label="机组功率(kva)" prop="unitPowerKva">
- <el-input v-model="form.unitPowerKva" placeholder="请输入机组功率(kva)" />
- </el-form-item>
- <el-form-item label="频率(Hz)" prop="rate">
- <el-input v-model="form.rate" placeholder="请输入频率(Hz)" />
- </el-form-item>
- <el-form-item label="柴油机型号" prop="dieselEngineModel">
- <el-input v-model="form.dieselEngineModel" placeholder="请输入柴油机型号" />
- </el-form-item>
- <el-form-item label="转速" prop="speed">
- <el-input v-model="form.speed" placeholder="请输入转速" />
- </el-form-item>
- <el-form-item label="动力价格" prop="powerPrice">
- <el-input v-model="form.powerPrice" placeholder="请输入动力价格" />
- </el-form-item>
- <el-form-item label="发电机型号" prop="generatorModel">
- <el-input v-model="form.generatorModel" placeholder="请输入发电机型号" />
- </el-form-item>
- <el-form-item label="发电机价格" prop="generatorPrice">
- <el-input v-model="form.generatorPrice" placeholder="请输入发电机价格" />
- </el-form-item>
- <el-form-item label="静音机壳价格" prop="mutePrice">
- <el-input v-model="form.mutePrice" placeholder="请输入静音机壳价格" />
- </el-form-item>
- <el-form-item label="开架价格" prop="openPrice">
- <el-input v-model="form.openPrice" placeholder="请输入开架价格" />
- </el-form-item>
- <el-form-item label="ATS型号" prop="atsModel">
- <el-input v-model="form.atsModel" placeholder="请输入ATS型号" />
- </el-form-item>
- <el-form-item label="ATS价格" prop="atsPrice">
- <el-input v-model="form.atsPrice" placeholder="请输入ATS价格" />
- </el-form-item>
- <el-form-item label="电瓶型号" prop="batteryModel">
- <el-input v-model="form.batteryModel" placeholder="请输入电瓶型号" />
- </el-form-item>
- <el-form-item label="电瓶价格" prop="batteryPrice">
- <el-input v-model="form.batteryPrice" placeholder="请输入电瓶价格" />
- </el-form-item>
- <el-form-item label="控制器铭贝" prop="controllerMinbei">
- <el-input v-model="form.controllerMinbei" placeholder="请输入控制器铭贝" />
- </el-form-item>
- <el-form-item label="控制器价格" prop="controllerPrice">
- <el-input v-model="form.controllerPrice" placeholder="请输入控制器价格" />
- </el-form-item>
- <el-form-item label="合计含税成本(静音)" prop="totalCostMute">
- <el-input v-model="form.totalCostMute" placeholder="请输入合计含税成本(静音)" />
- </el-form-item>
- <el-form-item label="合计含税成本(开架)" prop="totalCostOpen">
- <el-input v-model="form.totalCostOpen" placeholder="请输入合计含税成本(开架)" />
- </el-form-item>
- <el-form-item label="静音尺寸" prop="muteLong">
- <el-input v-model="form.muteLong" placeholder="请输入静音尺寸" />
- </el-form-item>
- <el-form-item label="静音尺寸" prop="muteWidth">
- <el-input v-model="form.muteWidth" placeholder="请输入静音尺寸" />
- </el-form-item>
- <el-form-item label="静音尺寸" prop="muteHigh">
- <el-input v-model="form.muteHigh" placeholder="请输入静音尺寸" />
- </el-form-item>
- <el-form-item label="开架尺寸" prop="openLong">
- <el-input v-model="form.openLong" placeholder="请输入开架尺寸" />
- </el-form-item>
- <el-form-item label="开架尺寸" prop="openWidth">
- <el-input v-model="form.openWidth" placeholder="请输入开架尺寸" />
- </el-form-item>
- <el-form-item label="开架尺寸" prop="openHigh">
- <el-input v-model="form.openHigh" placeholder="请输入开架尺寸" />
- </el-form-item>
- <el-form-item label="CKD尺寸" prop="ckdLong">
- <el-input v-model="form.ckdLong" placeholder="请输入CKD尺寸" />
- </el-form-item>
- <el-form-item label="CKD尺寸" prop="ckdWidth">
- <el-input v-model="form.ckdWidth" placeholder="请输入CKD尺寸" />
- </el-form-item>
- <el-form-item label="CKD尺寸" prop="ckdHigh">
- <el-input v-model="form.ckdHigh" placeholder="请输入CKD尺寸" />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, getFieldName } from "@/api/price/manage";
- import { getToken } from '@/utils/auth'
- export default {
- name: "Info",
- data() {
- return {
- token: getToken(),
- fileList: [],
- //搜索下拉选项
- searchOption: [[], [], []],
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 报价表格数据
- infoList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- brand: null,
- unitModel: null,
- unitPowerKw: null,
- unitPowerKva: null,
- rate: null,
- dieselEngineModel: null,
- speed: null,
- powerPrice: null,
- generatorModel: null,
- generatorPrice: null,
- mutePrice: null,
- openPrice: null,
- atsModel: null,
- atsPrice: null,
- batteryModel: null,
- batteryPrice: null,
- controllerMinbei: null,
- controllerPrice: null,
- totalCostMute: null,
- totalCostOpen: null,
- muteLong: null,
- muteWidth: null,
- muteHigh: null,
- openLong: null,
- openWidth: null,
- openHigh: null,
- ckdLong: null,
- ckdWidth: null,
- ckdHigh: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- }
- };
- },
- created() {
- this.getList();
- this.getSearchOption()
- },
- methods: {
- handleSuccess() {
- this.msgSuccess("上传成功");
- this.getList()
- },
- push(url) {
- this.router.push(url)
- },
- getSearchOption() {
- getFieldName('brand').then(response => {
- this.$set(this.searchOption, 0, response.data);
- })
- getFieldName('unit_power_kw').then(response => {
- this.$set(this.searchOption, 1, response.data);
- })
- getFieldName('unit_power_kva').then(response => {
- this.$set(this.searchOption, 2, response.data);
- })
- },
- /** 查询报价列表 */
- getList() {
- this.loading = true;
- listInfo(this.queryParams).then(response => {
- this.infoList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- brand: null,
- unitModel: null,
- unitPowerKw: null,
- unitPowerKva: null,
- rate: null,
- dieselEngineModel: null,
- speed: null,
- powerPrice: null,
- generatorModel: null,
- generatorPrice: null,
- mutePrice: null,
- openPrice: null,
- atsModel: null,
- atsPrice: null,
- batteryModel: null,
- batteryPrice: null,
- controllerMinbei: null,
- controllerPrice: null,
- totalCostMute: null,
- totalCostOpen: null,
- muteLong: null,
- muteWidth: null,
- muteHigh: null,
- openLong: null,
- openWidth: null,
- openHigh: null,
- ckdLong: null,
- ckdWidth: null,
- ckdHigh: null,
- createTime: null,
- updateTime: null
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length !== 1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = "添加报价";
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const id = row.id || this.ids
- getInfo(id).then(response => {
- this.form = response.data;
- this.open = true;
- this.title = "修改报价";
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.id != null) {
- updateInfo(this.form).then(response => {
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addInfo(this.form).then(response => {
- this.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$confirm('是否确认删除这' + this.ids.length + '数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function () {
- return delInfo(ids);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm('是否确认导出所有报价数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function () {
- return exportInfo(queryParams);
- }).then(response => {
- this.download(response.data);
- })
- }
- }
- };
- </script>
|