From 54f2f3fface8a510847c17a9c5dd9853b28a0c29 Mon Sep 17 00:00:00 2001
From: cwchen <1048842385@qq.com>
Date: Wed, 13 Nov 2024 09:37:03 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
images/svg/u418.svg | 1 +
js/accessory/accessory_store_list.js | 10 +
js/accessory/child/accessory_store_detail.js | 324 +++++++++++++
.../child/accessory_store_edit_form.js | 450 ++++++++++++++++++
page/accessory/accessory_store_list.html | 4 +
.../child/accessory_store_detail.html | 152 ++++++
.../child/accessory_store_edit_form.html | 137 ++++++
7 files changed, 1078 insertions(+)
create mode 100644 images/svg/u418.svg
create mode 100644 js/accessory/child/accessory_store_detail.js
create mode 100644 js/accessory/child/accessory_store_edit_form.js
create mode 100644 page/accessory/child/accessory_store_detail.html
create mode 100644 page/accessory/child/accessory_store_edit_form.html
diff --git a/images/svg/u418.svg b/images/svg/u418.svg
new file mode 100644
index 0000000..94bc041
--- /dev/null
+++ b/images/svg/u418.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/js/accessory/accessory_store_list.js b/js/accessory/accessory_store_list.js
index 4b63ff1..bfd2997 100644
--- a/js/accessory/accessory_store_list.js
+++ b/js/accessory/accessory_store_list.js
@@ -188,4 +188,14 @@ function exportExcel() {
function accessoryStore(type, obj) {
obj.type = type;
openIframeByParamObj("accessory_store", "配件到货入库", "../accessory/child/accessory_store_form.html", "92%", "95%", obj);
+}
+
+// 配件入库详情
+function accessoryStoreDetail(obj) {
+ openIframeByParamObj("accessory_store_detail", "配件到货入库", "../accessory/child/accessory_store_detail.html", "92%", "95%", obj);
+}
+
+// 配件入库编辑
+function accessoryStoreEdit(obj) {
+ openIframeByParamObj("accessory_store_edit", "配件到货入库编辑", "../accessory/child/accessory_store_edit_form.html", "92%", "95%", obj);
}
\ No newline at end of file
diff --git a/js/accessory/child/accessory_store_detail.js b/js/accessory/child/accessory_store_detail.js
new file mode 100644
index 0000000..221a0b8
--- /dev/null
+++ b/js/accessory/child/accessory_store_detail.js
@@ -0,0 +1,324 @@
+let objParam;
+let id = getUrlParam('id'); // 批次ID
+let time = getUrlParam('time'); // 批次日期
+let form, table, element, tableIns, layer;
+let pageNum = 1;
+
+function setParams(params) {
+ objParam = JSON.parse(params);
+ layui.use(["form", "table", 'element', 'layer'], function () {
+ form = layui.form;
+ table = layui.table;
+ element = layui.element;
+ layer = layui.layer;
+ getOutDetails();
+ initTable();
+ });
+}
+
+
+// 基本信息和附件文档接口
+function getOutDetails() {
+ let params = {
+ encryptedData: JSON.stringify({
+ 'proId': objParam.proId,
+ 'id': id
+ })
+ };
+ let url = dataUrl + 'backstage/planOut/getOutDetails';
+ ajaxRequest(url, "POST", params, true, function () {
+ }, function (result) {
+ console.error(result);
+ if (result.code === 200) {
+ setBasicValue(result.data);
+ setFileTable(result.data.fileList);
+ } else {
+ setBasicValue(null);
+ setFileTable(null);
+ }
+ }, function (xhr, status, error) {
+ errorFn(xhr, status, error)
+ }, null);
+}
+
+function setBasicValue(obj) {
+ if (obj) {
+ $('#userName').html(obj.userName); parseInt();
+ $('#createDay').html(obj.createDay + '查看概述');
+ $('#remark').html(obj.remarks);
+ }
+}
+
+// 附件文档赋值
+function setFileTable(fileList) {
+ $('#file-table tbody tr:not(:first)').remove();
+ let html = '';
+ if (fileList && fileList.length > 0) {
+ $.each(fileList, function (index, item) {
+ html += '
' +
+ '| ' + handleFileType(item.fileName) + item.fileName + ' | ' +
+ ' ' + item.createName + ' | ' +
+ '入库附件 | ' +
+ '' + item.createTime + ' | ' +
+ '预览' +
+ '下载' +
+ ' | ' +
+ '
';
+ })
+ } else {
+ html = '| 暂无数据 |
';
+ }
+ $('#file-table tbody').after(html);
+}
+
+// 处理文件类型
+function handleFileType(value) {
+ value = value.toLowerCase();
+ let src = '';
+ if (value.indexOf('docx') > -1 || value.indexOf('doc') > -1) {
+ src = '../../../images/docx.png'
+ } else if (value.indexOf('xls') > -1 || value.indexOf('xlsx') > -1) {
+ src = '../../../images/xlsx.png'
+ } else if (value.indexOf('pdf') > -1) {
+ src = '../../../images/pdf.png'
+ } else if (value.indexOf('png') > -1 || value.indexOf('jpg') > -1 || value.indexOf('jpeg') > -1) {
+ src = '../../../images/img_icon.png'
+ }
+ return '
'
+}
+
+// 查询/重置
+function queryTable(type) {
+ if (type === 1) {
+ reloadTable(1);
+ } else if (type === 2) {
+ $('#name').val('');
+ $('#module').val('');
+ layui.form.render();
+ reloadTable(1);
+ }
+}
+
+// 刷新页面数据
+function reloadData() {
+ reloadData(pageNum);
+}
+
+// 重载表格
+function reloadTable(pageNum) {
+ table.reload("currentTableId", {
+ page: {
+ curr: pageNum ? pageNum : 1,
+ },
+ where: {
+ encryptedData: JSON.stringify({
+ 'name': $('#name').val(),
+ 'module': $('#module').val(),
+ 'proId': objParam.proId,
+ 'id': id
+ }),
+ },
+ },
+ );
+}
+
+// 初始化表格
+function initTable() {
+ tableIns = table.render({
+ elem: "#currentTableId",
+ id: 'currentTableId',
+ headers: {
+ authorization: sessionStorage.getItem("gz-token"),
+ },
+ height: "full",
+ url: dataUrl + "backstage/planOut/getOutDetailList",
+ where: {
+ encryptedData: JSON.stringify({
+ 'name': $('#name').val(),
+ 'module': $('#module').val(),
+ 'id': id
+ }),
+ },
+ request: {
+ pageName: 'pageNum',
+ limitName: 'pageSize'
+ },
+ parseData: function (res) { // res 即为原始返回的数据
+ return {
+ "code": 0, // 解析接口状态
+ "msg": '获取成功', // 解析提示文本
+ "count": res.total, // 解析数据长度
+ "data": res.list // 解析数据列表
+ };
+ },
+ cols: [
+ [
+ {
+ width: '8%',
+ title: "序号",
+ align: "center",
+ templet: function (d) {
+ return d.LAY_NUM;
+ },
+ },
+ {
+ field: "type",
+ width: '10%',
+ title: "配件类型",
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "name",
+ width: '10%',
+ title: "配件名称",
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "model",
+ title: "规格型号",
+ width: '10%',
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "unit",
+ title: "单位",
+ width: '10%',
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "needNum",
+ title: "入库量",
+ width: '10%',
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "fhNum",
+ width: '10%',
+ title: "单价(元)",
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "tzNum",
+ width: '15%',
+ title: "配件厂家",
+ unresize: true,
+ align: "center",
+ },
+ {
+ field: "remarks",
+ title: "备注",
+ width: '17%',
+ align: "center",
+ unresize: true,
+ },
+ ],
+ ],
+ limits: [10, 15, 20, 25, 50, 100],
+ limit: 10,
+ page: true,
+ done: function (res, curr, count) {
+ pageNum = tableIns.config.page.curr;
+ element.render();
+ table.resize("currentTableId");
+ },
+ });
+}
+
+
+// 导出
+function exportExcel() {
+ let params = {
+ 'name': $('#name').val(),
+ 'module': $('#module').val(),
+ 'proId': objParam.proId,
+ 'id': id,
+ 'curryDay': time
+ }
+ let url = dataUrl + "backstage/export/exportPcList";
+ exportExcelUtil(url, '发货详情-批次-' + time, JSON.stringify(params));
+}
+
+// 打印
+function print() {
+ Print('#table-box', {
+ onStart: function () {
+ console.log('onStart', new Date())
+ },
+ onEnd: function () {
+ console.log('onEnd', new Date())
+ }
+ })
+}
+
+// 查看概述
+function viewGs(obj) {
+ layer.open({
+ type: 1,
+ shade: false, // 不显示遮罩
+ content: '' + obj.details + '
',
+ title: '' + obj.createDay + '发货概述:
',
+ btn: ['复制文字', '关闭'],
+ area: ['60%', '50%'],
+ move: false,
+ btnAlign: 'c', // 按钮居中显示
+ btn1: function () {
+ exeCommandCopyText(obj.gs);
+ },
+ btn2: function () {
+ layer.close();
+ },
+ });
+}
+
+// 复制文字
+function exeCommandCopyText(text) {
+ try {
+ const t = document.createElement('textarea')
+ t.nodeValue = text
+ t.value = text
+ document.body.appendChild(t)
+ t.select()
+ document.execCommand('copy');
+ document.body.removeChild(t)
+ layer.msg('复制成功', { icon: 1 });
+ } catch (e) {
+ console.log(e)
+ layer.msg('复制失败', { icon: 2 });
+ }
+}
+
+// 预览文件
+function viewFile(obj) {
+ let fileName = obj.fileName.toLowerCase();
+ if (fileName.indexOf('png') || fileName.indexOf('jpg') || fileName.indexOf('jpeg')) {
+ layer.photos({
+ shade: 0.5,
+ photos: {
+ "title": "图片预览",
+ "start": 0,
+ "data": [
+ {
+ "alt": "layer",
+ "pid": 1,
+ "src": fileUrl + obj.fileUrl + '?token=' + sessionStorage.getItem("gz-token"),
+ }
+ ]
+ }
+ });
+ } else {
+ // 调用公司的预览文件的服务
+ }
+}
+
+// 下载文件
+function downLoadFile(obj) {
+ console.log(obj);
+ let url = dataUrl + "backstage/export/download?fileId=" + obj.id;
+ downLoadFileUtil(url, obj.fileName, null);
+}
\ No newline at end of file
diff --git a/js/accessory/child/accessory_store_edit_form.js b/js/accessory/child/accessory_store_edit_form.js
new file mode 100644
index 0000000..b5e7e86
--- /dev/null
+++ b/js/accessory/child/accessory_store_edit_form.js
@@ -0,0 +1,450 @@
+let idParam, objParam, fileList = new Array(), imgListUp = new Array();
+let form, laydate, layer, upload, table, util;
+let pageNum = 1, tableIns; // 定义分页
+let jjDataArr = []; // 入库配件数据
+let jjDetailArr = []; // 机具明细数据
+let cjList = []; // 厂家下拉选
+let delIdArr = [];
+function setParams(obj) {
+ objParam = JSON.parse(obj);
+ layui.use(['form', 'layer', 'laydate', 'upload', 'table'], function () {
+ form = layui.form;
+ layer = layui.layer;
+ laydate = layui.laydate;
+ upload = layui.upload;
+ table = layui.table;
+ util = layui.util;
+ laydate.render({
+ elem: '#inputDay'
+ });
+ form.verify();
+ form.on('submit(formData)', function (data) {
+ submitApply(data);
+ });
+ form.render();
+ let uploadObj = upload.render({
+ elem: '#test2',
+ multiple: true,
+ dataType: "json",
+ exts: 'jpg|png|jpeg|doc|docx|pdf|xlsx|xls',
+ acceptMime: 'image/jpg,image/png,image/jpeg,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ number: 5, //最大上传数量
+ size: 1024 * 10, //最大文件大小,单位k
+ auto: false, //是否自动上传 ,默认为true
+ bindAction: '#hideUpload', //绑定的按钮
+ choose: function (obj) {
+ uploadObj.config.elem.next()[0].value = '';
+ obj.preview(function (index, file, result) {
+ console.log(file);
+ $('#uploader-list').append(
+ '' +
+ '
' +
+ handleFileType(index, file, result) +
+ '
'
+ );
+ let map = new Map();//将选择的图片索引和图片写成对象存入集合
+ map.index = index;
+ map.file = file;
+ fileList.push(map);
+ });
+ }
+ });
+ });
+ getVendList();
+}
+// 设置文件类型
+function handleFileType(index, file, result) {
+ let html = '', img = '';
+ if (file.ext === 'doc' || file.ext === 'docx') {
+ img = '../../../images/docx.png';
+ } else if (file.ext === 'xls' || file.ext === 'xlsx') {
+ img = '../../../images/xlsx.png';
+ } else if (file.ext === 'pdf') {
+ img = '../../../images/PDF.png';
+ } else {
+ return '
';
+ }
+ html += '' +
+ '

' +
+ '
' + file.name + '
' +
+ '
';
+ return html;
+}
+
+// 删除文件
+$(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)
+ });
+});
+
+
+// 根据id 判断对象数组的对象是否存在 如果存在则替换,不存在则添加
+function updateOrAddObject(id, newObject) {
+ const index = jjDetailArr.findIndex(obj => obj.id === id);
+ if (index !== -1) {
+ // 如果对象存在,则替换它
+ jjDetailArr[index] = newObject;
+ } else {
+ // 如果对象不存在,则添加到数组
+ jjDetailArr.push(newObject);
+ }
+}
+function saveData2() {
+ $('#formSubmit').trigger('click')
+}
+
+function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量
+ let color = '#66b1ff';
+ if (type === 1) {
+ color = '#66b1ff';
+ } else if (type === 2) {
+ color = '#19be6b';
+ } else if (type === 3) {
+ color = '#ff9900';
+ }
+ return '' + value + "";
+}
+
+
+// 提交
+function submitApply(data) {
+ let list = getBaseTableData();
+ // 校验附件证明是否上传
+ if (fileList.length === 0) {
+ return layer.msg('请上传附件证明', { icon: 7 });
+ }
+ // 校验配件入库数量
+ if (list.length === 0) {
+ return layer.msg('未填写配件入库数量', { icon: 7 });
+ }
+ for (let i = 0; i < list.length; i++) {
+
+ if (!list[i].inputNum || list[i].inputNum === '0') {
+ return layer.msg('入库配件明细,第' + (i + 1) + '行,未填写配件入库数量', { icon: 7 });
+ }
+ }
+ data.field.details = list;
+ let formData = new FormData();
+ //遍历最终文件集合
+ for (let i = 0; i < fileList.length; i++) {
+ formData.append("file[]", fileList[i].file)
+ }
+ formData.append('params', JSON.stringify(data.field));
+ console.log(JSON.stringify(data.field));
+ let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' });
+ console.log(JSON.stringify(data.field));
+ let url = dataUrl + 'backstage/partInput/addInputData';
+ ajaxRequestByUploadFile(url, formData, function () {
+ $('.save').addClass("layui-btn-disabled").attr("disabled", true);
+ $('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
+ }, function (result) {
+ console.log(result);
+ layer.close(loadingMsg);
+ $('.save').removeClass("layui-btn-disabled").attr("disabled", false);
+ $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
+ if (result.code === 200) {
+ parent.layer.msg(result.msg, { icon: 1 });
+ closePage(1);
+ } else {
+ layer.msg(result.msg, { icon: 2 });
+ }
+ }, function (xhr, status, error) {
+ layer.close(loadingMsg); // 关闭提示层
+ layer.msg('服务异常,请稍后重试', { icon: 16, scrollbar: false, time: 2000 });
+ $('.save').removeClass("layui-btn-disabled").attr("disabled", false);
+ $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
+ errorFn(xhr, status, error)
+ }, null);
+}
+
+// 获取入库配件明细数据
+function getBaseTableData() {
+ let tableData = [];
+ $('#baseTable tbody tr').each(function (index, item) {
+ let price = $(this).find('td').eq(7).find('input[name="price"]').val();
+ let num = $(this).find('td').eq(6).find('input[name="num"]').val();
+ tableData.push({
+ partId: $(this).attr('id'),
+ partType: $(this).find('td').eq(2).html(),
+ partName: $(this).find('td').eq(3).html(),
+ partModel: $(this).find('td').eq(4).html(),
+ partUnit: $(this).find('td').eq(5).html(),
+ inputNum: num ? num : 0,
+ partPrice: price ? price : 0,
+ vendId: $(this).find('td').eq(8).find('select[name="manufacturer"]').val(),
+ remark: $(this).find('td').eq(9).find('input[name="remarks"]').val(),
+ })
+ })
+ 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();
+ let keyWord2 = $('#name').val();
+ let keyWord3 = $('#model').val();
+ if (!keyWord && !keyWord2 && !keyWord3) {
+ setTableData(jjDataArr);
+ } else if (keyWord && !keyWord2 && !keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.type.indexOf(keyWord) > -1;
+ })
+ setTableData(dataList);
+ } else if (!keyWord && keyWord2 && !keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.name.indexOf(keyWord2) > -1;
+ })
+ setTableData(dataList);
+ } else if (!keyWord && !keyWord2 && keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.model.indexOf(keyWord3) > -1;
+ })
+ setTableData(dataList);
+ } else if (keyWord && keyWord2 && !keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.type.indexOf(keyWord) > -1 && item.name.indexOf(keyWord2) > -1;
+ })
+ setTableData(dataList);
+ } else if (keyWord && !keyWord2 && keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.type.indexOf(keyWord) > -1 && item.model.indexOf(keyWord3) > -1;
+ })
+ setTableData(dataList);
+ } else if (!keyWord && keyWord2 && keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.name.indexOf(keyWord2) > -1 && item.model.indexOf(keyWord3) > -1;
+ })
+ setTableData(dataList);
+ } else if (keyWord && keyWord2 && keyWord3) {
+ let dataList = jjDataArr.filter(item => {
+ return item.type.indexOf(keyWord) > -1 && item.name.indexOf(keyWord2) > -1 && item.model.indexOf(keyWord3) > -1;
+ })
+ setTableData(dataList);
+ }
+}
+
+// 重置
+function resetSearch() {
+ $('#type').val('');
+ $('#name').val('');
+ $('#model').val('');
+ 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)
+ var html = "";
+ if (results && results.length > 0) {
+ for (var i = 0; i < results.length; i++) {
+ var l = results[i];
+ html += "";
+ html += ' | ';
+ html += ""
+ + (i + 1) + " | ";
+ html += "" + l.type + " | ";
+ html += "" + l.name + " | ";
+ html += "" + l.model + " | ";
+ html += "" + l.unit + " | ";
+ html += "" + setFormInput(l.num, 1) + " | ";
+ html += "" + setFormInput(l.price, 2) + " | ";
+ html += "" + setFormInput(l.manufacturer, 3) + " | ";
+ html += "" + setFormInput(l.remarks, 4) + " | ";
+ html += "
";
+ }
+ } else {
+ html += "| 没有相关数据 |
";
+ }
+ $("#baseTable tbody").empty().append(html);
+ layui.form.render();
+}
+
+function setFormInput(value, type) {
+ let html = '';
+ return html;
+
+}
+
+function setSelectData(value) {
+ let html = '';
+ $.each(cjList, function (index, item) {
+ if (item.id === value) {
+ html += ''
+ } else {
+ html += ''
+ }
+
+ })
+ return html;
+}
+
+// 厂家下拉选
+function getVendList() {
+ cjList.splice(0, cjList.length);
+ let encryptedData = {};
+ let url = dataUrl + 'backstage/paType/getVendList?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
+ ajaxRequest(url, "GET", null, false, function () {
+ }, function (result) {
+ console.log(result);
+ if (result.code === 200) {
+ cjList = result.data;
+ }
+ }, function (xhr, status, error) {
+ errorFn(xhr, status, error)
+ }, 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();
+ if (type === 1) { // 入库量
+ const regex = /^(0|[1-9]\d{0,6})$/;
+ if (!regex.test(value) && value) {
+ layer.msg('入库量输入不合法,请重新输入!', { icon: 5 })
+ $(that).val('');
+ }
+ } else if (type === 2) { // 单价
+ const regex = /^(?:1(?:\d{0,8}|[0-9]*\.\d{1,2})|(?:[1-9]\d{0,7}|[1-9]\d{0,6}\.\d{1,2}|[1-9]\d{1,7}\.\d{2}|100000000(?:\.00)?))$/;
+ if (!regex.test(value) && value) {
+ layer.msg('单价输入不合法,请重新输入!', { icon: 5 })
+ $(that).val('');
+ }
+ }
+}
+
+// 关闭页面
+function closePage(type) {
+ let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
+ parent.layer.close(index); // 再执行关闭
+ if (type == 1) {
+ window.parent.reloadData();
+ }
+
+}
\ No newline at end of file
diff --git a/page/accessory/accessory_store_list.html b/page/accessory/accessory_store_list.html
index 4e39b07..ef43e14 100644
--- a/page/accessory/accessory_store_list.html
+++ b/page/accessory/accessory_store_list.html
@@ -46,6 +46,10 @@
class="layui-icon layui-icon-refresh"> 重 置
+
+
diff --git a/page/accessory/child/accessory_store_detail.html b/page/accessory/child/accessory_store_detail.html
new file mode 100644
index 0000000..0f3cdea
--- /dev/null
+++ b/page/accessory/child/accessory_store_detail.html
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+ 配件入库记录
+
+
+
+
+
+
+
+
+
+
+
+

+
+
2024-05-05配件入库记录
+
20240607096
+
+
+
+
+
+
+
+
+
+
+
+ | 入库编号(系统自动生成) |
+ 入库数量 |
+ 成本价格(元) |
+ 入库人 |
+ 入库日期 |
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+ | 备注 |
+
+
+
+
+
+
+
+
+
+
+
+
+ | 文件名 |
+ 文件类型 |
+ 上传人员 |
+ 上传时间 |
+ 操作 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/page/accessory/child/accessory_store_edit_form.html b/page/accessory/child/accessory_store_edit_form.html
new file mode 100644
index 0000000..3894365
--- /dev/null
+++ b/page/accessory/child/accessory_store_edit_form.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ 发货
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 附件证明*
+
+
+

+
+ (最多上传5个附件)
+
+
+
+
+
+

+
您还没选择入库配件类型
+
需要添加配件类型后才能执行入库操作
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file