Commit b4062645 authored by lvzhuangzhuang's avatar lvzhuangzhuang

Merge remote-tracking branch 'origin/master'

parents 882f8729 3a7793ef
...@@ -93,27 +93,11 @@ public class ActSuppliesConvertController extends BaseController{ ...@@ -93,27 +93,11 @@ public class ActSuppliesConvertController extends BaseController{
@PostMapping("/converSupplies") @PostMapping("/converSupplies")
public TableDataInfo convertSupplies(@RequestBody String[] names){ public TableDataInfo convertSupplies(@RequestBody String[] names){
List<String> name = Arrays.asList(names);
List<ActOperation> list = actSuppliesConvertService.converSupplies(name);
name = name.stream()
.map(str -> {
if (str == null) {
return null; // 保留原始的null值
}
for (int i = 0; i < list.size(); i++) {
if (str.equals(list.get(i).getDetaliesName())) {
return list.get(i).getSuppliesName();
}
}
return str;
})
.collect(Collectors.toList());
return getDataTable(name);
} List<String> list = actSuppliesConvertService.converSupplies(names);
return getDataTable(list);
}
} }
...@@ -32,7 +32,7 @@ public class ActSuppliesRoleDetailController extends BaseController ...@@ -32,7 +32,7 @@ public class ActSuppliesRoleDetailController extends BaseController
/** /**
* 查询上级分类 * 查询上级分类(所有)
* */ * */
@PreAuthorize("@ss.hasPermi('system:suppliesroledetail:savesid')") @PreAuthorize("@ss.hasPermi('system:suppliesroledetail:savesid')")
@GetMapping("/savesid") @GetMapping("/savesid")
...@@ -45,6 +45,20 @@ public class ActSuppliesRoleDetailController extends BaseController ...@@ -45,6 +45,20 @@ public class ActSuppliesRoleDetailController extends BaseController
} }
/**
* 查询上级分类(未发布)
* */
@PreAuthorize("@ss.hasPermi('system:suppliesroledetail:savesidsta')")
@GetMapping("/savesidsta")
@ResponseBody
public TableDataInfo saveSidsta(){
List<ActSuppliesRole> options = actSuppliesRoleDetailService.saveSidsta();
return getDataTable(options);
}
// /** // /**
// * 查询运算方法 // * 查询运算方法
// * */ // * */
......
...@@ -108,11 +108,8 @@ public class ActSuppliesTemplateController extends BaseController { ...@@ -108,11 +108,8 @@ public class ActSuppliesTemplateController extends BaseController {
@PreAuthorize("@ss.hasPermi('SuppliesTemplate:SuppliesTemplate:listId')") @PreAuthorize("@ss.hasPermi('SuppliesTemplate:SuppliesTemplate:listId')")
@GetMapping("/listId/{id}") @GetMapping("/listId/{id}")
public TableDataInfo listId(@PathVariable("id") Long id) { public TableDataInfo listId(@PathVariable("id") Long id) {
List<ActSuppliesTemplate> sysSupplies = actSuppliesTemplateService.saveTemplate(id); List<ActSuppliesTemplate> sysSupplies = actSuppliesTemplateService.saveTemplate(id);
return getDataTable(sysSupplies); return getDataTable(sysSupplies);
} }
/** /**
...@@ -169,9 +166,7 @@ public class ActSuppliesTemplateController extends BaseController { ...@@ -169,9 +166,7 @@ public class ActSuppliesTemplateController extends BaseController {
if (list.size()>0){ if (list.size()>0){
return AjaxResult.success("312",list.toArray()); return AjaxResult.success("312",list.toArray());
} }
return toAjax(1); return toAjax(1);
} }
/** /**
...@@ -186,7 +181,6 @@ public class ActSuppliesTemplateController extends BaseController { ...@@ -186,7 +181,6 @@ public class ActSuppliesTemplateController extends BaseController {
if (find.contains(name)){ if (find.contains(name)){
return AjaxResult.success("上传文件名重复,请修改后上传!","存在重复"); return AjaxResult.success("上传文件名重复,请修改后上传!","存在重复");
} }
return AjaxResult.success("验证通过","验证通过"); return AjaxResult.success("验证通过","验证通过");
} }
...@@ -197,7 +191,6 @@ public class ActSuppliesTemplateController extends BaseController { ...@@ -197,7 +191,6 @@ public class ActSuppliesTemplateController extends BaseController {
@GetMapping("/enable/{id}") @GetMapping("/enable/{id}")
public AjaxResult setEnable(@PathVariable("id") Long id) public AjaxResult setEnable(@PathVariable("id") Long id)
{ {
actSuppliesTemplateService.setEnable(id); actSuppliesTemplateService.setEnable(id);
return AjaxResult.success(); return AjaxResult.success();
} }
...@@ -212,9 +205,7 @@ public class ActSuppliesTemplateController extends BaseController { ...@@ -212,9 +205,7 @@ public class ActSuppliesTemplateController extends BaseController {
// if(actSuppliesTemplateService.find(id).size()>0){ // if(actSuppliesTemplateService.find(id).size()>0){
// return AjaxResult.success("该物料下存在关联物料,请先删除关联物料!!!","操作失败"); // return AjaxResult.success("该物料下存在关联物料,请先删除关联物料!!!","操作失败");
// } // }
actSuppliesTemplateService.setDisable(id); actSuppliesTemplateService.setDisable(id);
return AjaxResult.success(); return AjaxResult.success();
} }
} }
\ No newline at end of file
...@@ -9,7 +9,9 @@ public class ActOperation extends BaseEntity { ...@@ -9,7 +9,9 @@ public class ActOperation extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer id; private Integer id;
private String encoding; private String oneLevel;
private String twoLevel;
private String threeLevel;
private String suppliesName; private String suppliesName;
private String detaliesName; private String detaliesName;
...@@ -21,12 +23,28 @@ public class ActOperation extends BaseEntity { ...@@ -21,12 +23,28 @@ public class ActOperation extends BaseEntity {
this.id = id; this.id = id;
} }
public String getEncoding() { public String getOneLevel() {
return encoding; return oneLevel;
} }
public void setEncoding(String encoding) { public void setOneLevel(String oneLevel) {
this.encoding = encoding; this.oneLevel = oneLevel;
}
public String getTwoLevel() {
return twoLevel;
}
public void setTwoLevel(String twoLevel) {
this.twoLevel = twoLevel;
}
public String getThreeLevel() {
return threeLevel;
}
public void setThreeLevel(String threeLevel) {
this.threeLevel = threeLevel;
} }
public String getSuppliesName() { public String getSuppliesName() {
......
...@@ -68,5 +68,7 @@ public interface ActSuppliesRoleDetailMapper ...@@ -68,5 +68,7 @@ public interface ActSuppliesRoleDetailMapper
void updateRoleDetailStatus(ActSuppliesRoleDetail actSuppliesRoleDetail); void updateRoleDetailStatus(ActSuppliesRoleDetail actSuppliesRoleDetail);
List<ActSuppliesRole> saveSidsta();
// List<ActOperation> saveOperation(); // List<ActOperation> saveOperation();
} }
...@@ -16,5 +16,5 @@ public interface IActSuppliesConvertService { ...@@ -16,5 +16,5 @@ public interface IActSuppliesConvertService {
ActSupplies selectSuppliesname(String name); ActSupplies selectSuppliesname(String name);
List<ActOperation> converSupplies(List<String> name); List<String> converSupplies(String[] name);
} }
...@@ -82,4 +82,7 @@ public interface IActSuppliesRoleDetailService ...@@ -82,4 +82,7 @@ public interface IActSuppliesRoleDetailService
* @param id 尝试禁用物料细分类管理的id * @param id 尝试禁用物料细分类管理的id
*/ */
void setDisable(Long id); void setDisable(Long id);
List<ActSuppliesRole> saveSidsta();
} }
...@@ -7,7 +7,9 @@ import com.ruoyi.system.service.IActSuppliesConvertService; ...@@ -7,7 +7,9 @@ import com.ruoyi.system.service.IActSuppliesConvertService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService { public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService {
...@@ -41,7 +43,26 @@ public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService ...@@ -41,7 +43,26 @@ public class ActSuppliesConvertServiceImpl implements IActSuppliesConvertService
} }
@Override @Override
public List<ActOperation> converSupplies(List<String> name) { public List<String> converSupplies(String[] names) {
return actSuppliesConverMapper.converSupplies(name);
List<String> name = Arrays.asList(names);
List<ActOperation> list = actSuppliesConverMapper.converSupplies(name);
name = name.stream()
.map(str -> {
if (str == null) {
return null; // 保留原始的null值
}
for (int i = 0; i < list.size(); i++) {
if (str.equals(list.get(i).getDetaliesName())) {
return list.get(i).getSuppliesName();
}
}
return str;
})
.collect(Collectors.toList());
return name;
} }
} }
...@@ -119,17 +119,18 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat ...@@ -119,17 +119,18 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
} }
}else { }else {
Long[] longs = actSuppliesHistorydataMapper.selectActSuppliesRole(actSuppliesHistorydata.get(0).getTemplateId()); for (int i =0;i<actSuppliesHistorydata.size();i++){
for (int i=0;i<longs.length;i++){ if (actSuppliesHistorydata.get(i).getIdentifyingCode()==0){
actSuppliesHistorydata1.setImportUuid(actSuppliesHistorydata.get(0).getImportUuid()); actSuppliesHistorydata1.setImportUuid(actSuppliesHistorydata.get(0).getImportUuid());
actSuppliesHistorydata1.setTemplateId(actSuppliesHistorydata.get(0).getTemplateId()); actSuppliesHistorydata1.setTemplateId(actSuppliesHistorydata.get(0).getTemplateId());
actSuppliesHistorydata1.setRoleId(longs[i]); actSuppliesHistorydata1.setRoleId(actSuppliesHistorydata.get(i).getRoleId());
actSuppliesHistorydata1.setStatus(1L); actSuppliesHistorydata1.setStatus(1L);
actSuppliesHistorydata1.setIdentifyingCode(0L); actSuppliesHistorydata1.setIdentifyingCode(0L);
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1);
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1); }
} }
......
...@@ -167,6 +167,11 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS ...@@ -167,6 +167,11 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS
updateStatusById(id,1); updateStatusById(id,1);
} }
@Override
public List<ActSuppliesRole> saveSidsta() {
return actSuppliesRoleDetailMapper.saveSidsta();
}
private void updateStatusById(Long id, Integer status){ private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"}; String[] statusText={"禁用","启用"};
......
...@@ -63,7 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -63,7 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.ruoyi.system.domain.ActOperation" id="ActOperationResult"> <resultMap type="com.ruoyi.system.domain.ActOperation" id="ActOperationResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="encoding" column="encoding"/> <result property="oneLevel" column="one_level" />
<result property="twoLevel" column="two_level" />
<result property="threeLevel" column="three_level" />
<result property="suppliesName" column="supplies_name" /> <result property="suppliesName" column="supplies_name" />
<result property="detaliesName" column="details_name" /> <result property="detaliesName" column="details_name" />
</resultMap> </resultMap>
...@@ -90,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -90,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="converSupplies" parameterType="java.util.List" resultMap="ActOperationResult"> <select id="converSupplies" parameterType="java.util.List" resultMap="ActOperationResult">
select id , encoding, supplies_name, b.details_name from act_supplies a ,( select a.id ,a.one_level,a.two_level,a.three_level, a.supplies_name, b.details_name from act_supplies a ,(
SELECT sid ,details_name SELECT sid ,details_name
FROM act_supplies_details FROM act_supplies_details
WHERE details_name IN WHERE details_name IN
......
...@@ -47,9 +47,12 @@ ...@@ -47,9 +47,12 @@
</sql> </sql>
<select id="saveSid" parameterType="com.ruoyi.system.domain.ActSuppliesRole" resultMap="ActSuppliesRoleResult"> <select id="saveSid" parameterType="com.ruoyi.system.domain.ActSuppliesRole" resultMap="ActSuppliesRoleResult">
select id, temp_id, role_name from act_supplies_role where status = 1 select id, temp_id, role_name from act_supplies_role
</select> </select>
<select id="saveSidsta" parameterType="com.ruoyi.system.domain.ActSuppliesRole" resultMap="ActSuppliesRoleResult">
select id, temp_id, role_name from act_supplies_role where status = 1;
</select>
<!-- <select id="saveOperation" parameterType="ActOperation" resultMap="ActOperationResult">--> <!-- <select id="saveOperation" parameterType="ActOperation" resultMap="ActOperationResult">-->
<!-- select id, operation_name, status from act_operation_role where status = 0--> <!-- select id, operation_name, status from act_operation_role where status = 0-->
<!-- </select>--> <!-- </select>-->
......
...@@ -3,7 +3,7 @@ import Excel from 'exceljs'; ...@@ -3,7 +3,7 @@ import Excel from 'exceljs';
import FileSaver from 'file-saver'; import FileSaver from 'file-saver';
const exportExcel = function(luckysheet, value) { const exportExcel = function(luckysheet, value,contrast) {
// 参数为luckysheet.getluckysheetfile()获取的对象 // 参数为luckysheet.getluckysheetfile()获取的对象
// 1.创建工作簿,可以为工作簿添加属性 // 1.创建工作簿,可以为工作簿添加属性
const workbook = new Excel.Workbook(); const workbook = new Excel.Workbook();
...@@ -18,7 +18,7 @@ const exportExcel = function(luckysheet, value) { ...@@ -18,7 +18,7 @@ const exportExcel = function(luckysheet, value) {
const merge = (table.config && table.config.merge) || {}; const merge = (table.config && table.config.merge) || {};
const borderInfo = (table.config && table.config.borderInfo) || {}; const borderInfo = (table.config && table.config.borderInfo) || {};
// 3.设置单元格合并,设置单元格边框,设置单元格样式,设置值 // 3.设置单元格合并,设置单元格边框,设置单元格样式,设置值
setStyleAndValue(table.data, worksheet); setStyleAndValue(table.data, worksheet,contrast);
setMerge(merge, worksheet); setMerge(merge, worksheet);
setBorder(borderInfo, worksheet); setBorder(borderInfo, worksheet);
return true; return true;
...@@ -88,7 +88,7 @@ var setBorder = function(luckyBorderInfo, worksheet) { ...@@ -88,7 +88,7 @@ var setBorder = function(luckyBorderInfo, worksheet) {
// worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border // worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border
}); });
}; };
var setStyleAndValue = function(cellArr, worksheet) { var setStyleAndValue = function(cellArr, worksheet,contrast) {
if (!Array.isArray(cellArr)) { return; } if (!Array.isArray(cellArr)) { return; }
cellArr.forEach(function(row, rowid) { cellArr.forEach(function(row, rowid) {
row.every(function(cell, columnid) { row.every(function(cell, columnid) {
...@@ -122,6 +122,11 @@ var setStyleAndValue = function(cellArr, worksheet) { ...@@ -122,6 +122,11 @@ var setStyleAndValue = function(cellArr, worksheet) {
// style 填入到_value中可以实现填充色 // style 填入到_value中可以实现填充色
let letter = createCellPos(columnid); let letter = createCellPos(columnid);
let target = worksheet.getCell(letter + (rowid + 1)); let target = worksheet.getCell(letter + (rowid + 1));
if(contrast){
const column =worksheet.getColumn(1);
column.hidden=true;
}
// console.log('1233', letter + (rowid + 1)) // console.log('1233', letter + (rowid + 1))
for (const key in fill) { for (const key in fill) {
target.fill = fill; target.fill = fill;
......
...@@ -37,4 +37,4 @@ export function getCodeImg() { ...@@ -37,4 +37,4 @@ export function getCodeImg() {
url: '/captchaImage', url: '/captchaImage',
method: 'get' method: 'get'
}) })
} }
\ No newline at end of file
...@@ -16,7 +16,13 @@ export function saveSid() { ...@@ -16,7 +16,13 @@ export function saveSid() {
method: 'get' method: 'get'
}) })
} }
//查询上级ID
export function saveSidsta() {
return request({
url: '/system/suppliesroledetail/savesidsta',
method: 'get'
})
}
export function saveOperation(){ export function saveOperation(){
return request({ return request({
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
...@@ -98,9 +98,30 @@ ...@@ -98,9 +98,30 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<div id="luckysheet" :style="{ position: positionValue, top: '0', left: '0', right: '0', bottom: '0' }"></div>
</div> </div>
</template> </template>
<style>
#luckysheet_info_detail_title {
display: none;
}
#luckysheet_info_detail_update {
display: none;
}
#luckysheet_info_detail_save {
display: none;
}
.luckysheet-share-logo {
display: none;
}
</style>
<script> <script>
import { listHistorydata, getHistorydata, delHistorydata, addHistorydata, updateHistorydata, exportHistorydata } from "@/api/system/historydata"; import { listHistorydata, getHistorydata, delHistorydata, addHistorydata, updateHistorydata, exportHistorydata } from "@/api/system/historydata";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
...@@ -115,7 +136,9 @@ export default { ...@@ -115,7 +136,9 @@ export default {
}, },
data() { data() {
return { return {
// 遮罩层 positionValue: 'static',
// 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
...@@ -155,7 +178,14 @@ export default { ...@@ -155,7 +178,14 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.positionValue = "static";
}, },
mounted() {
window.handleReturnButtonClick = this.handleReturnButtonClick;
},
methods: { methods: {
/** 查询 历史数据列表 */ /** 查询 历史数据列表 */
getList() { getList() {
...@@ -241,29 +271,24 @@ export default { ...@@ -241,29 +271,24 @@ export default {
}); });
}, },
handleDetails(row) { handleDetails(row) {
getHistorydata(row.id).then(response => {
this.TemplateId = response.rows;
this.luckyLook();
})
},
/**展示详情luckysheet */
luckyLook() {
this.positionValue = 'absolute'; this.positionValue = 'absolute';
luckysheet.destroy(); luckysheet.destroy();
luckysheet.create({ luckysheet.create({
container: "luckysheet", // Luckysheet 的容器元素 ID container: "luckysheet", // Luckysheet 的容器元素 ID
title: this.TemplateId[0].historyName, // Excel 文件名 title: row.historyName, // Excel 文件名
data: JSON.parse(this.TemplateId[0].historyContent), // Excel 数据 data: JSON.parse(row.historyContent), // Excel 数据
showtoolbar: false, //是否第二列显示工具栏 showtoolbar: false, //是否第二列显示工具栏
showinfobar: true, //是否显示顶部名称栏 showinfobar: true, //是否显示顶部名称栏
showsheetbar: false, //是否显示底部表格名称区域 showsheetbar: false, //是否显示底部表格名称区域
pointEdit: false, //是否是编辑器插入表格模式 pointEdit: false, //是否是编辑器插入表格模式
pointEditUpdate: null, //编辑器表格更新函数 pointEditUpdate: null, //编辑器表格更新函数
allowEdit: false,//作用:是否允许前台编辑 allowEdit: false,//作用:是否允许前台编辑
functionButton: '<button id="exportButton" class="btn btn-primary" style=" padding:3px 6px; font-size: 16px;width: 100px;height: 27px; margin-right: 85px;" onclick="handleReturnButtonClick()">返回</button>', functionButton: '<button id="exportButton" class="btn btn-primary" style=" padding:3px 6px; font-size: 16px;width: 100px;height: 27px; margin-right: 85px;" onclick="handleReturnButtonClick()">返回</button>',
});
}, });
},
/**详情返回按钮 */ /**详情返回按钮 */
handleReturnButtonClick() { handleReturnButtonClick() {
this.positionValue = 'static'; this.positionValue = 'static';
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<!-- luckysheet容器 --> <!-- luckysheet容器 -->
<div <div
id="luckysheet" id="luckysheet"
style="margin: 0px; padding: 0px; position: absolute; width: 100%; height:78vh; z-index: 0" style="margin: 0px; padding: 0px; position: absolute; width: 100%; height:80vh; z-index: 0"
> >
</div> </div>
<div v-if="showMask" class="mask"> <div v-if="showMask" class="mask">
...@@ -77,6 +77,7 @@ var rule=[]; ...@@ -77,6 +77,7 @@ var rule=[];
var tempId; var tempId;
var roleId; var roleId;
var uuid1; var uuid1;
var trueORfalse=false;
export default { export default {
name: "Mymodule", name: "Mymodule",
data() { data() {
...@@ -106,7 +107,6 @@ export default { ...@@ -106,7 +107,6 @@ export default {
created() { created() {
//刷新页面时进行的操作 //刷新页面时进行的操作
this.getList(); this.getList();
}, },
mounted() { mounted() {
...@@ -127,6 +127,11 @@ export default { ...@@ -127,6 +127,11 @@ export default {
this.disableNextButton = this.selectedRule === ''; this.disableNextButton = this.selectedRule === '';
//根据选中的下拉选项值获取相应的信息 //根据选中的下拉选项值获取相应的信息
getSuppliesTemplate(this.selectedOption).then(response => { getSuppliesTemplate(this.selectedOption).then(response => {
if(this.selectedOption===7){
trueORfalse=true;
}else{
trueORfalse=false;
}
tempId= this.selectedOption; tempId= this.selectedOption;
uuid1=this.uuid=uuidv4().substring(0,8); uuid1=this.uuid=uuidv4().substring(0,8);
console.log(this.uuid); console.log(this.uuid);
...@@ -165,6 +170,37 @@ export default { ...@@ -165,6 +170,37 @@ export default {
roleId=this.selectedRule; roleId=this.selectedRule;
rule=response.rows; rule=response.rows;
}); });
if(tempId===7){
getSuppliesTemplate(7).then(response => {
uuid1=this.uuid=uuidv4().substring(0,8);
//console.log(this.uuid);
// 通过遍历this.luckyrule找到对应的iem.roleName
for (let i = 0; i < this.luckyrule.length; i++) {
if (this.luckyrule[i].id === this.selectedRule) {
let name = this.luckyrule[i].roleName;
fileName=name.slice(0,-2);
break;
}
}
const sysSupplies = response.rows;
this.luckysheetData = sysSupplies[0].templateContent;
//将接收到的json存到json_data中
//const json_data = response.data;
let json_data = JSON.parse(sysSupplies[0].templateContent);
//luckysheet.destroy()
luckysheet.create({
container: "luckysheet", // Luckysheet 的容器元素 ID
title: fileName, // Excel 文件名
data: json_data, // Excel 数据
showinfobar: false, //是否显示顶部名称栏
lang:'zh',
});
}).catch(() => {
// 处理错误逻辑,这里是一个空的错误处理函数
this.$message.error('查询失败,发生未知错误!');
});
}
}, },
/** 回车事件和保存提交绑定 */ /** 回车事件和保存提交绑定 */
...@@ -183,6 +219,7 @@ export default { ...@@ -183,6 +219,7 @@ export default {
this.disableNextButton=''; this.disableNextButton='';
this.selectedRule=''; this.selectedRule='';
this.luckyrule=[]; this.luckyrule=[];
trueORfalse=false;
uuid1=''; uuid1='';
//刷新luckysheet表格 //刷新luckysheet表格
this.init(); this.init();
...@@ -261,8 +298,8 @@ export default { ...@@ -261,8 +298,8 @@ export default {
try { try {
const exportJson = await cons; const exportJson = await cons;
await this.summary(exportJson); await this.summary(exportJson);
console.log('summary 执行完毕'); //console.log('summary 执行完毕');
//this.submit(exportJson); this.submit(exportJson);
} catch (Error) { } catch (Error) {
this.$message({ this.$message({
...@@ -852,9 +889,6 @@ export default { ...@@ -852,9 +889,6 @@ export default {
"color": "#000000", "color": "#000000",
"range": [{ "range": [{
"row": [0, 0], "row": [0, 0],
"column": [0, 0] "column": [0, 0]
}] }]
} }
...@@ -889,7 +923,7 @@ export default { ...@@ -889,7 +923,7 @@ export default {
});*/ });*/
config = luckysheet.getConfig(0); config = luckysheet.getConfig(0);
bord.range[0].row = [rowws + 1, rowws + 1]; bord.range[0].row = [rowws + 1, rowws + 1];
bord.range[0].column = [0, sysRules[sysRules.length - 1].ct]; bord.range[0].column = [0, parseInt(sysRules[sysRules.length - 1].ct)];
config.borderInfo.push(bord); config.borderInfo.push(bord);
luckysheet.setConfig(config); luckysheet.setConfig(config);
} else{ } else{
...@@ -1039,7 +1073,7 @@ export default { ...@@ -1039,7 +1073,7 @@ export default {
this.from.templateId=this.dfrom.templateId=tempId; this.from.templateId=this.dfrom.templateId=tempId;
this.from.importUuid=this.dfrom.importUuid=uuid1; this.from.importUuid=this.dfrom.importUuid=uuid1;
this.from.roleId=this.dfrom.roleId=roleId; this.from.roleId=this.dfrom.roleId=roleId;
this.dfrom.historyName=name; this.dfrom.historyName=name+'(导入文件)';
this.dfrom.historyContent=str; this.dfrom.historyContent=str;
this.dfrom.identifyingCode=0; this.dfrom.identifyingCode=0;
this.from.status=this.dfrom.status=0; this.from.status=this.dfrom.status=0;
...@@ -1062,7 +1096,7 @@ export default { ...@@ -1062,7 +1096,7 @@ export default {
/** 导出设置 */ /** 导出设置 */
handleExport: debounce(function() { handleExport: debounce(function() {
// 处理点击事件 // 处理点击事件
exportExcel(luckysheet.getAllSheets(),fileName) exportExcel(luckysheet.getAllSheets(),fileName,trueORfalse)
}, 500), // 设置延迟时间,单位为毫秒 }, 500), // 设置延迟时间,单位为毫秒
} }
// 配置项111 // 配置项111
......
...@@ -388,9 +388,7 @@ export default { ...@@ -388,9 +388,7 @@ export default {
}, },
mounted() { mounted() {
window.handleReturnButtonClick = this.handleReturnButtonClick; window.handleReturnButtonClick = this.handleReturnButtonClick;
}, },
methods: { methods: {
......
...@@ -151,6 +151,7 @@ export default { ...@@ -151,6 +151,7 @@ export default {
const originalName = item.name; const originalName = item.name;
let newName = originalName; let newName = originalName;
let count = 1; let count = 1;
// 检查是否存在同名文件,如果存在则进行递增命名 // 检查是否存在同名文件,如果存在则进行递增命名
while (this.isFileNameExists(newName)) { while (this.isFileNameExists(newName)) {
const dotIndex = originalName.lastIndexOf('.'); const dotIndex = originalName.lastIndexOf('.');
...@@ -164,6 +165,12 @@ export default { ...@@ -164,6 +165,12 @@ export default {
item.name = newName; item.name = newName;
this.fileName1.splice(index + 1, 0, item); this.fileName1.splice(index + 1, 0, item);
this.fileName1[index+1].copy =`(${count-1})`; this.fileName1[index+1].copy =`(${count-1})`;
if (!this.fileName1[index+1].hasOwnProperty('oldname')) {
let suffixArr = originalName.split('.');
suffixArr.pop(); // 删除数组中的最后一项,即 '.xlsx'
const newname = suffixArr.join('.'); // 将数组中剩下的部分通过 . 连接起来
this.fileName1[index+1].oldname = newname;
}
}, },
uploadFolder2() { uploadFolder2() {
this.$refs.folderInput2.value = ''; // 清空文件选择框的值 this.$refs.folderInput2.value = ''; // 清空文件选择框的值
...@@ -328,7 +335,18 @@ export default { ...@@ -328,7 +335,18 @@ export default {
this.isDivVisible=false; this.isDivVisible=false;
this.isluckysheet = true; this.isluckysheet = true;
for (let i =0;i<this.fileName1.length;i++){ for (let i =0;i<this.fileName1.length;i++){
await this.handleFileChange(this.fileName1[i].data,this.fileName1[i].copy); let sda=this.fileName1;
const name = this.fileName1[i].name;//ACCOUNT通用 (1) (1).xlsx
let suffixArr = name.split('.');
suffixArr.pop(); // 删除数组中的最后一项,即 '.xlsx'
const newname = suffixArr.join('.'); // 将数组中剩下的部分通过 . 连接起来
const oldname = this.fileName1[i].oldname;//ACCOUNT通用.xlsx
let extraPart
if(oldname!==undefined){
extraPart = newname.replace(oldname, '').trim(); // 去掉前后空格
}
//const newcode = extraPart ? extraPart : '没有多余的部分';
await this.handleFileChange(this.fileName1[i].data,extraPart);
await this.handleFileChange1(this.fileName2[i].data); await this.handleFileChange1(this.fileName2[i].data);
} }
luckysheet.create({ luckysheet.create({
...@@ -377,6 +395,7 @@ export default { ...@@ -377,6 +395,7 @@ export default {
}else{ }else{
name1=exportJson.sheets[0].name; name1=exportJson.sheets[0].name;
} }
//console.log(name1);
datast=exportJson.sheets; datast=exportJson.sheets;
namest=exportJson.info.name; namest=exportJson.info.name;
let suffixArr = exportJson.info.name.split('.'); let suffixArr = exportJson.info.name.split('.');
...@@ -419,6 +438,9 @@ export default { ...@@ -419,6 +438,9 @@ export default {
let cell = (c1 <= c2) ? c1 : c2; let cell = (c1 <= c2) ? c1 : c2;
let array = []; let array = [];
let r = this.row - 1; let r = this.row - 1;
try{
for (let i = r; i < row; i++) { for (let i = r; i < row; i++) {
for (let j = 0; j < cell; j++) { for (let j = 0; j < cell; j++) {
//第一个表的单元格为null直接跳出 //第一个表的单元格为null直接跳出
...@@ -494,6 +516,11 @@ export default { ...@@ -494,6 +516,11 @@ export default {
type: "success" type: "success"
}); });
} }
}catch (err){
this.$message({
message: "导入失败,导入文件与对比文件有所不匹",
type: "error"});
}
data1 = ''; data1 = '';
ddd = ''; ddd = '';
resolve(data1); resolve(data1);
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="模板ID" prop="tempId">
<el-input
v-model="queryParams.tempId"
placeholder="请输入模板ID"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规则名称" prop="roleName">
<el-input
v-model="queryParams.roleName"
placeholder="请输入规则名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" 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"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:suppliesrole:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:suppliesrole:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:suppliesrole: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="['system:suppliesrole:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="suppliesroleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="模板ID" align="center" prop="tempId" />
<el-table-column label="规则名称" align="center" prop="roleName" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column 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="['system:suppliesrole:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:suppliesrole: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="模板ID" prop="tempId">
<el-select v-model="form.tempId" filterable placeholder="请选择关联项" >
<el-option
v-for="option in options"
:key="option.templateName"
:label="option.templateName"
:value="option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="规则名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入规则名称" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="parseInt(dict.dictValue)"
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</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 { listSuppliesrole, getSuppliesrole, delSuppliesrole, addSuppliesrole, updateSuppliesrole, exportSuppliesrole,saveSid } from "@/api/system/suppliesrole";
export default {
name: "Suppliesrole",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 导入规则表格数据
suppliesroleList: [],
options:[],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 状态数据字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
tempId: null,
roleName: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
tempId: [
{ required: true, message: "关联id不能为空", trigger: "change" }
]
}
};
},
created() {
this.getList();
this.getnameid();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询上级id*/
getnameid(){
saveSid().then(response =>{
this.options = response.rows;
})
},
/** 查询导入规则列表 */
getList() {
this.loading = true;
listSuppliesrole(this.queryParams).then(response => {
this.suppliesroleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 岗位状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
tempId: null,
roleName: null,
status: 0,
createBy: null,
createTime: null,
updateBy: 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
getSuppliesrole(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) {
updateSuppliesrole(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSuppliesrole(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除导入规则编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delSuppliesrole(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有导入规则数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportSuppliesrole(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
<el-form-item label="上级规则" prop="roleId"> <el-form-item label="上级规则" prop="roleId">
<el-select v-model="form.roleId" filterable placeholder="请选择关联项" > <el-select v-model="form.roleId" filterable placeholder="请选择关联项" >
<el-option <el-option
v-for="option in options1" v-for="option in options3"
:key="option.roleName" :key="option.roleName"
:label="option.roleName" :label="option.roleName"
:value="option.id" :value="option.id"
...@@ -279,6 +279,7 @@ import { ...@@ -279,6 +279,7 @@ import {
toggleEnable, toggleEnable,
toggleDisable, toggleDisable,
saveOperation, saveOperation,
saveSidsta,
} from "@/api/system/suppliesroledetail"; } from "@/api/system/suppliesroledetail";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
...@@ -424,11 +425,6 @@ export default { ...@@ -424,11 +425,6 @@ export default {
saveSid().then(response =>{ saveSid().then(response =>{
this.options1 = response.rows; this.options1 = response.rows;
}) })
// //运算规则
// saveOperation().then(response =>{
// this.options2 = response.rows;
// console.log(this.options2)
// })
}, },
...@@ -483,6 +479,12 @@ export default { ...@@ -483,6 +479,12 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
//上级规则
saveSidsta().then(response =>{
this.options3 = response.rows;
})
this.instea=0; this.instea=0;
this.getnameid(); this.getnameid();
this.reset(); this.reset();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment