diff --git a/js/accessory/accessory_store_list.js b/js/accessory/accessory_store_list.js
index bfd2997..bc50182 100644
--- a/js/accessory/accessory_store_list.js
+++ b/js/accessory/accessory_store_list.js
@@ -146,8 +146,8 @@ function initTable() {
unresize: true,
templet: function (d) {
let html = "";
- html += "详情";
- html += "
' +
+ html += '
' +
'

' +
'
' + file.name + '
' +
'
';
@@ -112,19 +128,26 @@ function handleFileType(index, file, result) {
$(document).on("click", ".file-iteme .handle", function (event) {
imgListUp.splice(0, imgListUp.length);
let index = $(this).next().attr('data-index');
- $.each(fileList, function (inx, ele) {
- //对比删除文件索引
- //将未删除的存入新集合
- if (index != ele.index) {
- imgListUp.push(ele);
- }
- });
- $(this).parent().remove();
- //将新文件集合替换老集合
- fileList.splice(0, fileList.length);
- $.each(imgListUp, function (inx, ele) {
- fileList.push(ele)
- });
+ let isOld = $(this).next().attr('isOld');
+ if (isOld) {
+ delImgIdList.push(isOld);
+ console.log(delImgIdList)
+ $(this).parent().remove();
+ } else {
+ $.each(fileList, function (inx, ele) {
+ //对比删除文件索引
+ //将未删除的存入新集合
+ if (index != ele.index) {
+ imgListUp.push(ele);
+ }
+ });
+ $(this).parent().remove();
+ //将新文件集合替换老集合
+ fileList.splice(0, fileList.length);
+ $.each(imgListUp, function (inx, ele) {
+ fileList.push(ele)
+ });
+ }
});
function saveData2() {
@@ -162,6 +185,18 @@ function submitApply(data) {
}
}
data.field.details = list;
+ data.field.id = objParam.id;
+ let delId = '';
+ if (delImgIdList && delImgIdList.length > 0) {
+ for (let i = 0; i < delImgIdList.length; i++) {
+ if (i === delImgIdList.length - 1) {
+ delId += delImgIdList[i];
+ } else {
+ delId += delImgIdList[i] + '@';
+ }
+ }
+ }
+ data.field.delId = delId;
let formData = new FormData();
//遍历最终文件集合
for (let i = 0; i < fileList.length; i++) {
@@ -216,16 +251,6 @@ function getBaseTableData() {
return tableData;
}
-
-// 选择入库配件类型
-function chooseFitType() {
- let params = {};
- /* if (jjDataArr && jjDataArr.length > 0) {
- params.jjDataArrStr = JSON.stringify(jjDataArr);
- } */
- openIframeByParamObj("choose_fit_type", '选择入库配件类型', "./choose_fit_type_list.html", '92%', '95%', params);
-}
-
// 查询
function search() {
let keyWord = $('#type').val();
@@ -279,37 +304,6 @@ function resetSearch() {
setTableData(jjDataArr);
}
-// 子页面回调数据
-function addFitDatas(data) {
- console.log('新增的数据:' + data);
- if (jjDataArr.length > 0) { // 继续添加数据
- let newJjDataArr = JSON.parse(data);
- $.each(newJjDataArr, function (index, item) {
- updateOrAddObject(item.id, item);
- });
- setTableData(jjDataArr);
- } else { // 第一次添加数据
- jjDataArr = JSON.parse(data);
- if (jjDataArr && jjDataArr.length > 0) {
- $('#no_data_title').css({ 'display': 'none' });
- $('#search-info').removeAttr('style');
- $('#table-box').removeAttr('style');
- setTableData(jjDataArr);
- }
- }
-
- function updateOrAddObject(id, newObject) {
- const index = jjDataArr.findIndex(obj => obj.id === id);
- if (index !== -1) {
- // 如果对象存在,则替换它
- jjDataArr[index] = newObject;
- } else {
- // 如果对象不存在,则添加到数组
- jjDataArr.push(newObject);
- }
- }
-}
-
// 入库配件明细表格赋值
function setTableData(results) {
$('#allCheck').prop('checked', false)
@@ -318,7 +312,6 @@ function setTableData(results) {
for (var i = 0; i < results.length; i++) {
var l = results[i];
html += "
";
- html += ' | ';
html += ""
+ (i + 1) + " | ";
html += "" + l.type + " | ";
@@ -385,67 +378,6 @@ function getVendList() {
}, null);
}
-// 复选框全选
-function selectAll(selectStatus) {//传入参数(全选框的选中状态)
- if (selectStatus) {
- $("input[name='check']").each(function (i, n) {
- n.checked = true;
- });
- $.each(jjDataArr, function (index, item) {
- delIdArr.push(item.id);
- })
- } else {
- $("input[name='check']").each(function (i, n) {
- n.checked = false;
- });
- delIdArr.splice(0, delIdArr.length);
- }
-}
-
-// 单个选中
-function sel(selectStatus, that, id) {
- if (selectStatus) {
- $(that).prop('checked', true);
- delIdArr.push(id);
- } else {
- $(that).prop('checked', false);
- for (let i = 0; i < delIdArr.length; i++) {
- if (delIdArr[i] == id) {
- arr.splice(i, 1);
- break;
- }
- }
- }
-}
-
-// 删除选中
-function delFitType() {
- if (delIdArr.length == 0) {
- layer.msg('请先选择需要删除的数据!', { icon: 7 })
- return;
- }
- let layerIndex = layer.confirm('确定要删除选中数据吗!
', { title: '操作提示' }, function () {
- layer.close(layerIndex);
- for (let i = 0; i < delIdArr.length; i++) {
- for (let j = 0; j < jjDataArr.length; j++) {
- let id = jjDataArr[j].id;
- if (delIdArr[i] == id) {
- jjDataArr.splice(j, 1);
- break;
- }
- }
- }
- if (jjDataArr.length === 0) {
- $('#no_data_title').removeAttr('style');
- $('#search-info').css({ 'display': 'none' });
- $('#table-box').css({ 'display': 'none' });
- } else {
- setTableData(jjDataArr);
- }
-
- });
-}
-
// 校验数据
function checkValue(that, type) {
let value = $(that).val();
diff --git a/page/accessory/accessory_store_list.html b/page/accessory/accessory_store_list.html
index ef43e14..e65f539 100644
--- a/page/accessory/accessory_store_list.html
+++ b/page/accessory/accessory_store_list.html
@@ -46,12 +46,8 @@
class="layui-icon layui-icon-refresh"> 重 置
-
-
+ class="layui-icon layui-icon-download-circle"> 导 出
diff --git a/page/accessory/child/accessory_store_edit_form.html b/page/accessory/child/accessory_store_edit_form.html
index 8bc9ee0..3ec567e 100644
--- a/page/accessory/child/accessory_store_edit_form.html
+++ b/page/accessory/child/accessory_store_edit_form.html
@@ -15,7 +15,7 @@