From 14c7cdc6439ef788ed448d1613c733e0fbf1418e Mon Sep 17 00:00:00 2001
From: cwchen <1048842385@qq.com>
Date: Wed, 13 Nov 2024 16:02:00 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
js/accessory/child/accessory_return_form.js | 69 +++++--------------
.../child/choose_return_fit_type_list.js | 54 ++++-----------
.../child/accessory_return_form.html | 16 ++---
.../child/choose_return_fit_type_list.html | 8 ---
4 files changed, 40 insertions(+), 107 deletions(-)
diff --git a/js/accessory/child/accessory_return_form.js b/js/accessory/child/accessory_return_form.js
index 9c7b616..316939d 100644
--- a/js/accessory/child/accessory_return_form.js
+++ b/js/accessory/child/accessory_return_form.js
@@ -4,6 +4,7 @@ let pageNum = 1, tableIns; // 定义分页
let jjDataArr = []; // 入库配件数据
let cjList = []; // 厂家下拉选
let delIdArr = [];
+let checkUserId;
function setParams(obj) {
objParam = JSON.parse(obj);
layui.use(['form', 'layer', 'laydate', 'upload', 'table'], function () {
@@ -20,6 +21,16 @@ function setParams(obj) {
form.on('submit(formData)', function (data) {
submitApply(data);
});
+ form.on('select(inputUser)', function (data) {
+ if (checkUserId && data.value !== checkUserId) {
+ // 清空退料配件明细数据
+ jjDataArr.splice(0, jjDataArr.length);
+ setTableData(jjDataArr);
+ $('#no_data_title').removeAttr('style');
+ $('#search-info').css({ 'display': 'none' });
+ $('#table-box').css({ 'display': 'none' });
+ }
+ })
form.render();
let uploadObj = upload.render({
elem: '#test2',
@@ -248,7 +259,8 @@ function resetSearch() {
}
// 子页面回调数据
-function addFitDatas(data) {
+function addFitDatas(data, userId) {
+ checkUserId = userId;
console.log('新增的数据:' + data);
if (jjDataArr.length > 0) { // 继续添加数据
let newJjDataArr = JSON.parse(data);
@@ -278,7 +290,7 @@ function addFitDatas(data) {
}
}
-// 入库配件明细表格赋值
+// 退件配件明细表格赋值
function setTableData(results) {
$('#allCheck').prop('checked', false)
var html = "";
@@ -294,9 +306,7 @@ function setTableData(results) {
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 += "" + setFormInput(l.remarks, 2) + " | ";
html += "";
}
} else {
@@ -308,15 +318,9 @@ function setTableData(results) {
function setFormInput(value, type) {
let html = '';
@@ -324,35 +328,6 @@ function setFormInput(value, type) {
}
-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) {
@@ -417,16 +392,10 @@ function delFitType() {
// 校验数据
function checkValue(that, type) {
let value = $(that).val();
- if (type === 1) { // 入库量
+ 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 })
+ layer.msg(' 本次退回量输入不合法,请重新输入!', { icon: 5 })
$(that).val('');
}
}
diff --git a/js/accessory/child/choose_return_fit_type_list.js b/js/accessory/child/choose_return_fit_type_list.js
index 15b4577..c71d8d1 100644
--- a/js/accessory/child/choose_return_fit_type_list.js
+++ b/js/accessory/child/choose_return_fit_type_list.js
@@ -1,13 +1,13 @@
-let objParam;
+let objParam, userId;
let form, table, element, tableIns, layer, util;
let pageNum = 1;
let quanju = new Array();//全局
let huancun = new Array();//缓存
let huancunObj = new Array();//缓存2
-let cjList = [];
-let jjDetailArr = []; // 入库配件类型数据
+let jjDetailArr = []; // 退料配件类型数据
function setParams(obj) {
objParam = JSON.parse(obj);
+ userId = objParam.userId;
console.log(objParam);
layui.use(["form", "table", 'element', 'layer', 'util'], function () {
form = layui.form;
@@ -15,27 +15,10 @@ function setParams(obj) {
element = layui.element;
layer = layui.layer;
util = layui.util;
- getVendList();
initTable();
});
}
-// 厂家下拉选
-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 queryTable(type) {
if (type === 1) {
@@ -82,6 +65,7 @@ function initTable() {
'type': $('#type').val(),
'name': $('#name').val(),
'model': $('#model').val(),
+ 'userId': userId
}),
},
request: {
@@ -112,7 +96,7 @@ function initTable() {
[
{ type: 'checkbox', width: '5%' },
{
- width: '6%',
+ width: '9.9%',
title: "序号",
align: "center",
templet: function (d) {
@@ -121,14 +105,14 @@ function initTable() {
},
{
field: "type",
- width: '11.8%',
+ width: '10%',
title: "配件类型",
unresize: true,
align: "center",
},
{
field: "name",
- width: '12%',
+ width: '15%',
title: "配件名称",
unresize: true,
align: "center",
@@ -143,39 +127,29 @@ function initTable() {
{
field: "unit",
title: "单位",
- width: '8%',
+ width: '10%',
unresize: true,
align: "center",
},
{
field: "num",
width: '10%',
- title: " * 本次入库量",
+ title: "累计领料数量",
unresize: true,
align: "center",
- edit: 'text',
- style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
},
{
field: "price",
- width: '9.8%',
- title: "单价(元)",
+ width: '10%',
+ title: " * 本次退回量",
unresize: true,
align: "center",
edit: 'text',
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
},
- {
- field: "manufacturer",
- width: '15%',
- title: " * 配件厂家",
- unresize: true,
- align: "center",
- templet: '#TPL-select-demo'
- },
{
field: "remarks",
- width: '12%',
+ width: '20%',
title: "备注",
unresize: true,
align: "center",
@@ -369,11 +343,11 @@ function addFitTypeData() {
openIframeByParamObj2("add_fit_type_data", "配件类型", "../../../page/basic/fit_type_list.html", "92%", "95%", {});
}
-function closePage(type,params) {
+function closePage(type, params) {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
parent.layer.close(index); // 再执行关闭
if (type == 1) {
- window.parent.addFitDatas(params);
+ window.parent.addFitDatas(params, userId);
}
}
\ No newline at end of file
diff --git a/page/accessory/child/accessory_return_form.html b/page/accessory/child/accessory_return_form.html
index faa0569..b0dd147 100644
--- a/page/accessory/child/accessory_return_form.html
+++ b/page/accessory/child/accessory_return_form.html
@@ -19,7 +19,7 @@
-
@@ -110,14 +110,12 @@
|
- 序号 |
- 配件类型 |
- 配件名称 |
- 规格型号 |
+ 序号 |
+ 配件类型 |
+ 配件名称 |
+ 规格型号 |
单位 |
- * 本次入库量 |
- 单价(元) |
- * 配件厂家 |
+ * 本次退回量 |
备注 |
diff --git a/page/accessory/child/choose_return_fit_type_list.html b/page/accessory/child/choose_return_fit_type_list.html
index e847cb4..8e88ceb 100644
--- a/page/accessory/child/choose_return_fit_type_list.html
+++ b/page/accessory/child/choose_return_fit_type_list.html
@@ -79,14 +79,6 @@