Ver Código Fonte

档案物资功能修改

liuzhen 5 anos atrás
pai
commit
d9ca47fa6a

+ 1 - 0
CallCenterWeb.UI/ArchivesManagement/ArchivesList.html

@@ -54,6 +54,7 @@
54 54
 						<tr>
55 55
 							<!--<th data-checkbox="true"></th>-->
56 56
 							<!--<th data-field="F_CustomerCode" data-align="center">客户编号</th>-->
57
+							<th data-field="F_CompanyName" data-align="center">公司名称</th>
57 58
 							<th data-field="A_archiveName" data-align="center">物资名称</th>
58 59
 							<th data-field="stateName" data-align="center">物资状态</th>
59 60
 							<th data-field="OperationDate" data-align="center">最近一次变更时间</th>

+ 12 - 3
CallCenterWeb.UI/ArchivesManagement/js/addOrEditArchivesList.js

@@ -9,7 +9,7 @@ $(function() {
9 9
 	}, function(result) {
10 10
 		if(result.state.toLowerCase() == "success") {
11 11
 			seatlist = result.data;
12
-			WZstate($("#state"));
12
+//			WZstate($("#state"));
13 13
 		}
14 14
 	});
15 15
 	if(editId){
@@ -26,12 +26,20 @@ $(function() {
26 26
 			var isadd = 0
27 27
 			editId = ''
28 28
 		}
29
+		if(!$('#customer_code').val()){
30
+			layer.msg('请输入客户编号!')
31
+			return
32
+		}
33
+		if(!$('#customer_name').val()){
34
+			layer.msg('请输入物资名称!')
35
+			return
36
+		}
29 37
 		$.post(huayi.config.callcenter_url + 'archives/AddorUpdateArchives', {
30 38
 			isadd: isadd,
31 39
 			id: editId,
32 40
 			A_archiveCode: $('#customer_code').val(),
33 41
 			A_archiveName: $('#customer_name').val(),
34
-			A_archiveState: $('#state').val(),
42
+			A_archiveState: $('#stateid').val(),
35 43
 			token: $.cookie("token")
36 44
 		}, function(data) {
37 45
 			data = JSON.parse(data);
@@ -65,7 +73,8 @@ function getArchivesDetail(editId) {
65 73
 		if(data.state=='success'){
66 74
 			$('#customer_code').val(data.data.A_archiveCode);
67 75
 			$('#customer_name').val(data.data.A_archiveName);
68
-			$('#state').val(data.data.A_archiveState);
76
+			$('#state').val(data.data.stateName);
77
+			$('#stateid').val(data.data.A_archiveState);
69 78
 		}
70 79
 	})
71 80
 }

+ 4 - 18
CallCenterWeb.UI/ArchivesManagement/js/archivesListInfo.js

@@ -133,7 +133,7 @@ function btn_add() {
133 133
 		type: 2,
134 134
 		title: '添加档案物资信息',
135 135
 		maxmin: true, //开启最大化最小化按钮
136
-		area: ['80%', '70%'],
136
+		area: ['50%', '60%'],
137 137
 		content: '../commonTpl/addOrEditArchivesList.html'
138 138
 	});
139 139
 }
@@ -145,27 +145,13 @@ function btn_add() {
145 145
 function btn_edit(editId) {
146 146
 	layer.open({
147 147
 		type: 2,
148
-		title: '修改客户信息',
148
+		title: '修改档案物资信息',
149 149
 		maxmin: true, //开启最大化最小化按钮
150
-		area: ['80%', '70%'],
150
+		area: ['50%', '60%'],
151 151
 		content: '../commonTpl/addOrEditArchivesList.html?edit_id=' + editId
152 152
 	});
153 153
 }
154 154
 
155
-/**
156
- * 详情
157
- * editId 客户id
158
- * */
159
-function btn_details(editId) {
160
-	layer.open({
161
-		type: 2,
162
-		title: '客户信息详情',
163
-		maxmin: true, //开启最大化最小化按钮
164
-		area: ['80%', '90%'],
165
-		content: '../commonTpl/cusDetails.html?edit_id=' + editId
166
-	});
167
-}
168
-
169 155
 
170 156
 //导入客户信息
171 157
 function btn_export() {
@@ -173,7 +159,7 @@ function btn_export() {
173 159
 		maxmin: true, //开启最大化最小化按钮
174 160
 		type: 2,
175 161
 		content: "../commonTpl/importArchivesList.html", //iframe的url,no代表不显示滚动条
176
-		title: '导入客户信息',
162
+		title: '导入物资档案信息',
177 163
 		area: ['50%', '55%'], //宽高
178 164
 	});
179 165
 }

+ 4 - 2
CallCenterWeb.UI/commonTpl/addOrEditArchivesList.html

@@ -31,9 +31,11 @@
31 31
 					<li class="form-group">
32 32
 						<label for="customer_notes" class="col-md-2">物资状态</label>
33 33
 						<div class="col-md-4">
34
-							<select id="state" class="form-control">
34
+							<input id="state" class="form-control" type="text" autocomplete="off" disabled style="background-color: #fff;"/>
35
+							<input id="stateid" class="form-control" type="hidden" autocomplete="off"/>
36
+							<!--<select id="state" class="form-control" disabled>
35 37
 								<option value="">请选择物资状态</option>
36
-							</select>
38
+							</select>-->
37 39
 						</div>
38 40
 					</li>
39 41
 				</ul>

+ 0 - 21
WeChat/content/borrowDetail.html

@@ -111,27 +111,6 @@
111 111
 					</div>
112 112
 				</li>
113 113
 			</ul>
114
-			<ul class="mui-table-view ">
115
-				<h4 class="mui-ellipsis size-16 mui_btn1_tit">操作按钮:</h4>
116
-				<div class="type1">
117
-					<div class="mui_btn1 company">
118
-						<li class=" mui-media mui-col-xs-3">
119
-							<button type="button" data-loading-text="提交中" class="mui-btn mui-btn-primary mui-btn-block borrow">借阅</button>
120
-						</li>
121
-						<li class="mui-media mui-col-xs-3 ">
122
-							<button type="button" data-loading-text="提交中" class="mui-btn mui-btn-primary mui-btn-block BtnReutrn">归还</button>
123
-						</li>
124
-					</div>
125
-					<div class="mui_btn1 staff">
126
-						<li class="mui-media mui-col-xs-3 ">
127
-							<button type="button" data-loading-text="提交中" class="mui-btn mui-btn-primary mui-btn-block out">出库</button>
128
-						</li>
129
-						<li class="mui-media mui-col-xs-3 ">
130
-							<button type="button" data-loading-text="提交中" class="mui-btn mui-btn-primary mui-btn-block warehousing">入库</button>
131
-						</li>
132
-					</div>
133
-				</div>
134
-			</ul>
135 114
 		</div>
136 115
 		<div class="pop_up_bj"></div>
137 116
 		<script src="../js/mui.min.js?"></script>

+ 25 - 2
WeChat/content/borrowList.html

@@ -24,17 +24,23 @@
24 24
 			#keyword{
25 25
 				padding: 10px 0 0 5px;
26 26
 				height: 40px;
27
-				width: 75%;
27
+				width: 55%;
28 28
 				margin: 10px 0 0 10px;
29 29
 				border-radius: 5px;
30 30
 			}
31
+			.warehousing,
32
+			.out,
33
+			.borrow,
34
+			.BtnReutrn,
31 35
 			.search{
32 36
 				margin: 10px 10px 0 0px;
33 37
 				padding: 10px 0;
34 38
 				height: 40px;
35 39
 				float: right;
36
-				width: 15%;
40
+				width: 10%;
41
+				font-size: 12px;
37 42
 				text-align: center;
43
+				display: none;
38 44
 			}
39 45
 			body{
40 46
 				background-color: #FFFFFF !important;
@@ -45,6 +51,18 @@
45 51
 			.mui-content{
46 52
 				background-color: #FFFFFF;
47 53
 			}
54
+			.mui-checkbox{
55
+				height: 30px;
56
+				width: 50px;
57
+				float: left;
58
+			}
59
+			.mui-checkbox.mui-left input[type='checkbox']{
60
+				left: 0px !important;
61
+			}
62
+			.mui-table{
63
+				width: 80% !important;
64
+			}
65
+			
48 66
 		</style>
49 67
 	</head>
50 68
 	<body>
@@ -53,7 +71,11 @@
53 71
 			<!--<a class="mui-icon mui-icon-arrowleft" href="company.html"></a>
54 72
 			工单列表-->
55 73
 			<input type="" name="" id="keyword" value="" placeholder="请输入内容"/>
74
+			<button type="button"  class="mui-btn mui-btn-primary mui-btn-block BtnReutrn">归还</button>
75
+			<button type="button"  class="mui-btn mui-btn-primary mui-btn-block borrow">借阅</button>
56 76
 			<button type="button"  class="mui-btn mui-btn-primary mui-btn-block search">搜索</button>
77
+			<button type="button"  class="mui-btn mui-btn-primary mui-btn-block out">出库</button>
78
+			<button type="button"  class="mui-btn mui-btn-primary mui-btn-block warehousing">入库</button>
57 79
 		</div>
58 80
 		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
59 81
 			<div class="mui-scroll">
@@ -61,6 +83,7 @@
61 83
 					
62 84
 				</ul>
63 85
 			</div>
86
+			<div class="noinfor" style="text-align: center; font-size: 16px;">
64 87
 		</div>
65 88
 	</body>
66 89
 	<script src="../js/mui.min.js"></script>

+ 0 - 60
WeChat/content/js/borrowDetail.js

@@ -28,66 +28,6 @@ $(function () {
28 28
 		mui.back()
29 29
 	})
30 30
 })
31
-//借阅
32
-$(".borrow").click(function(){
33
-	var btnArray = ['否', '是'];
34
-	mui.confirm('确定借阅吗?', '提示', btnArray, function(f) {
35
-		if(f.index == 1) {
36
-			$.ajax({
37
-				type: "post",
38
-				dataType: 'json',
39
-				url: huayi.config.callcenter_url + 'archives/AddorUpdateCustomerBorrow',
40
-				async: true,
41
-				data: {
42
-					isadd:0,
43
-					archivesid: id, //否	strubg	工单编号
44
-					openid: openid, //微信openid 测试用
45
-					BorrowOreturn:'借阅'
46
-				},
47
-				success: function(data) {
48
-					if(data.state == "success") {
49
-						mui.toast('操作成功');
50
-						window.location.href = "borrowList.html?Itype=1";
51
-					} else {
52
-						mui.toast(data.message);
53
-					}
54
-				}
55
-			});
56
-		} else {
57
-			mui.toast("取消");
58
-		}
59
-	})
60
-})
61
-//归还
62
-$(".BtnReutrn").click(function(){
63
-	var btnArray = ['否', '是'];
64
-	mui.confirm('确定归还吗?', '提示', btnArray, function(f) {
65
-		if(f.index == 1) {
66
-			$.ajax({
67
-				type: "post",
68
-				dataType: 'json',
69
-				url: huayi.config.callcenter_url + 'archives/AddorUpdateCustomerBorrow',
70
-				async: true,
71
-				data: {
72
-					isadd:0,
73
-					archivesid: id, //否	strubg	工单编号
74
-					openid: openid, //微信openid 测试用
75
-					BorrowOreturn:'归还'
76
-				},
77
-				success: function(data) {
78
-					if(data.state == "success") {
79
-						mui.toast('操作成功');
80
-						window.location.href = "borrowList.html?Itype=1";
81
-					} else {
82
-						mui.toast(data.message);
83
-					}
84
-				}
85
-			});
86
-		} else {
87
-			mui.toast("取消");
88
-		}
89
-	})
90
-})
91 31
 $(".allot").click(function(){ 
92 32
 	window.location.href = "redeploy.html?id=" + id + '&itype=' + state;
93 33
 })

+ 185 - 12
WeChat/content/js/borrowList.js

@@ -36,11 +36,17 @@ $(function () {
36 36
 	}
37 37
 	if(typeUser==5){
38 38
 		$("#OA_task").css("margin-top","45px");
39
+		$('.BtnReutrn').show();
40
+		$('.borrow').show();
41
+		$('.search').show();
39 42
 		state="";
40 43
 		Staff=1;
41 44
 		Ajax();
42 45
 	}else if(typeUser==1){
43 46
 		$("#OA_task").css("margin-top","85px");
47
+		$('.out').show();
48
+		$('.warehousing').show();
49
+		$('.search').show();
44 50
 		state=1;
45 51
 		Staff="";
46 52
 		Ajax();
@@ -61,13 +67,15 @@ function Ajax() {
61 67
 		dataType: 'json',
62 68
 		type: 'get', //HTTP请求类型
63 69
 		success: function(data) {
70
+			$("#OA_task").empty();
64 71
 			if(data.data.rows && data.data.rows.length > 0) {
65 72
 				$(".noinfor").text("");
66
-				$("#OA_task").empty();
67 73
 				$(data.data.rows).each(function(i, n) {
68
-					$('<li class="mui-table-view-cell order" data-index="' + n.id + '">' +
74
+					$('<li class="mui-table-view-cell">' +
75
+						'<div class="mui-input-row mui-checkbox mui-left">'+
76
+						'<input name="checkbox1" data-item="' + n.id + '" value="'+n.stateName+'" type="checkbox" class="selected"></div>'+
69 77
 						'<div class="mui-table">' +
70
-						'<div class="mui-table-cell mui-col-xs-8">' +
78
+						'<div class="mui-table-cell mui-col-xs-8 order" data-index="' + n.id + '">' +
71 79
 						'<h4 class="mui-ellipsis">' + n.A_archiveName +
72 80
 						'</h4><h5>' + n.OperationDate +
73 81
 						'</h5></div>'+
@@ -90,6 +98,169 @@ function Ajax() {
90 98
 	})
91 99
 
92 100
 }
101
+var idArr=[];
102
+var nameArr=[];
103
+//借阅
104
+$(".borrow").click(function(){
105
+	idArr=[];
106
+	nameArr=[];
107
+	$(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
108
+		idArr.push($(this).attr('data-item'));
109
+		nameArr.push($(this).val())
110
+	})
111
+	for(var i=0;i<nameArr.length;i++){
112
+		if(nameArr[i] !=='在库'){
113
+			mui.toast('不能借阅')
114
+			return false
115
+		}
116
+	}
117
+	var btnArray = ['否', '是'];
118
+	mui.confirm('确定借阅吗?', '提示', btnArray, function(f) {
119
+		if(f.index == 1) {
120
+			$.ajax({
121
+				type: "post",
122
+				dataType: 'json',
123
+				url: huayi.config.callcenter_url + 'archives/CustomerBorrowJY',
124
+				async: true,
125
+				data: {
126
+					archivesids: idArr.toString(), //否	strubg	工单编号
127
+					openid: openid, //微信openid 测试用
128
+				},
129
+				success: function(data) {
130
+					debugger
131
+					if(data.state == "success") {
132
+						mui.toast('操作成功');
133
+						window.location.href = "borrowList.html?Itype=1";
134
+					} else {
135
+						mui.toast(data.message);
136
+					}
137
+				}
138
+			});
139
+		} else {
140
+			mui.toast("取消");
141
+		}
142
+	})
143
+})
144
+//归还
145
+$(".BtnReutrn").click(function(){
146
+	idArr=[];
147
+	nameArr=[];
148
+	$(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
149
+		idArr.push($(this).attr('data-item'));
150
+		nameArr.push($(this).val())
151
+	})
152
+	for(var i=0;i<nameArr.length;i++){
153
+		if(nameArr[i] =='在库'){
154
+			mui.toast('不能归还')
155
+			return false
156
+		}
157
+	}
158
+	var btnArray = ['否', '是'];
159
+	mui.confirm('确定归还吗?', '提示', btnArray, function(f) {
160
+		if(f.index == 1) {
161
+			$.ajax({
162
+				type: "post",
163
+				dataType: 'json',
164
+				url: huayi.config.callcenter_url + 'archives/CustomerBorrowGH',
165
+				async: true,
166
+				data: {
167
+					archivesids: idArr.toString(), //否	strubg	工单编号
168
+					openid: openid, //微信openid 测试用
169
+				},
170
+				success: function(data) {
171
+					if(data.state == "success") {
172
+						mui.toast('操作成功');
173
+						window.location.href = "borrowList.html?Itype=1";
174
+					} else {
175
+						mui.toast(data.message);
176
+					}
177
+				}
178
+			});
179
+		} else {
180
+			mui.toast("取消");
181
+		}
182
+	})
183
+})
184
+//出库
185
+$(".out").click(function(){
186
+	idArr=[];
187
+	nameArr=[];
188
+	$(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
189
+		idArr.push($(this).attr('data-item'));
190
+		nameArr.push($(this).val())
191
+	})
192
+	for(var i=0;i<nameArr.length;i++){
193
+		if(nameArr[i] !=='在库'){
194
+			mui.toast('不能出库')
195
+			return false
196
+		}
197
+	}
198
+	var btnArray = ['否', '是'];
199
+	mui.confirm('确定出库吗?', '提示', btnArray, function(f) {
200
+		if(f.index == 1) {
201
+			$.ajax({
202
+				type: "post",
203
+				dataType: 'json',
204
+				url: huayi.config.callcenter_url + 'archives/insideOperationCk',
205
+				async: true,
206
+				data: {
207
+					archivesids: idArr.toString(), //否	strubg	工单编号
208
+					openid: openid, //微信openid 测试用
209
+				},
210
+				success: function(data) {
211
+					if(data.state == "success") {
212
+						mui.toast('操作成功');
213
+						window.location.href = "borrowList.html?Itype=1";
214
+					} else {
215
+						mui.toast(data.message);
216
+					}
217
+				}
218
+			});
219
+		} else {
220
+			mui.toast("取消");
221
+		}
222
+	})
223
+})
224
+//入库
225
+$(".warehousing").click(function(){
226
+	idArr=[];
227
+	nameArr=[];
228
+	$(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
229
+		idArr.push($(this).attr('data-item'));
230
+		nameArr.push($(this).val())
231
+	})
232
+	for(var i=0;i<nameArr.length;i++){
233
+		if(nameArr[i] =='在库'){
234
+			mui.toast('不能入库')
235
+			return false
236
+		}
237
+	}
238
+	var btnArray = ['否', '是'];
239
+	mui.confirm('确定入库吗?', '提示', btnArray, function(f) {
240
+		if(f.index == 1) {
241
+			$.ajax({
242
+				type: "post",
243
+				dataType: 'json',
244
+				url: huayi.config.callcenter_url + 'archives/insideOperationRK',
245
+				async: true,
246
+				data: {
247
+					archivesids: idArr.toString(), //否	strubg	工单编号
248
+					openid: openid, //微信openid 测试用
249
+				},
250
+				success: function(data) {
251
+					if(data.state == "success") {
252
+						mui.toast('操作成功');
253
+						window.location.href = "borrowList.html?Itype=1";
254
+					} else {
255
+						mui.toast(data.message);
256
+					}
257
+				}
258
+			});
259
+		} else {
260
+			mui.toast("取消");
261
+		}
262
+	})
263
+})
93 264
 //下拉刷新
94 265
 function pullupRefresh() {
95 266
 	setTimeout(function() {
@@ -110,15 +281,17 @@ function pullupRefresh() {
110 281
 				total = data.data.total;
111 282
 				if(data.data.rows && data.data.rows.length > 0) {
112 283
 					$(data.data.rows).each(function(i, n) {
113
-						$('<li class="mui-table-view-cell order" data-index="' + n.id + '">' +
114
-							'<div class="mui-table">' +
115
-							'<div class="mui-table-cell mui-col-xs-8">' +
116
-							'<h4 class="mui-ellipsis">' + n.A_archiveName +
117
-							'</h4><h5>' + n.OperationDate +
118
-							'</h5></div>'+
119
-							'<div class="mui-table-cell mui-col-xs-4 mui-text-right">'+
120
-							'<span class="mui-h5">'+n.stateName+
121
-							'</span></div></div></li>').appendTo('#OA_task');
284
+						$('<li class="mui-table-view-cell">' +
285
+						'<div class="mui-input-row mui-checkbox mui-left">'+
286
+						'<input name="checkbox1" data-item="' + n.id + '" value="'+n.stateName+'" type="checkbox" class="selected"></div>'+
287
+						'<div class="mui-table">' +
288
+						'<div class="mui-table-cell mui-col-xs-8 order" data-index="' + n.id + '">' +
289
+						'<h4 class="mui-ellipsis">' + n.A_archiveName +
290
+						'</h4><h5>' + n.OperationDate +
291
+						'</h5></div>'+
292
+						'<div class="mui-table-cell mui-col-xs-4 mui-text-right">'+
293
+						'<span class="mui-h5">'+n.stateName+
294
+						'</span></div></div></li>').appendTo('#OA_task');
122 295
 					});
123 296
 					//工单跳转
124 297
 					$('.order').on('tap', function() {