Browse Source

出入库单页面

zyh 3 years ago
parent
commit
7a2c286c96

+ 27 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/haikong/StockChangeEntity.java

@@ -27,6 +27,7 @@ public class StockChangeEntity implements Serializable {
     /**
      * 出、入库时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
     private Date time;
     /**
      * 商户编号
@@ -87,6 +88,32 @@ public class StockChangeEntity implements Serializable {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
     private Date auditTime;
+    /**
+     * 规格
+     */
+
+    private String specification;
+    /**
+     * 商品名称
+     */
+
+    private String product;
+
+    public String getSpecification() {
+        return specification;
+    }
+
+    public void setSpecification(String specification) {
+        this.specification = specification;
+    }
+
+    public String getProduct() {
+        return product;
+    }
+
+    public void setProduct(String product) {
+        this.product = product;
+    }
 
     /**
      * 设置:出、入库单单号,手动录入

+ 4 - 1
kmall-admin/src/main/java/com/kmall/admin/service/impl/haikong/StockChangeServiceImpl.java

@@ -202,7 +202,10 @@ public class StockChangeServiceImpl implements StockChangeService {
         if (Constants.AuditStatus.AUDIT_SUCCESS.getType().equals(type)) {
             List<StockChangeEntity> stockChangeEntities = queryListByIds(ids);
 
-            stockChangeEntities.forEach(stockChangeEntity -> {
+            stockChangeEntities.stream().filter(stockChangeEntity -> {
+                log.info("工单号为:{}的审核状态为成功",stockChangeEntity.getId());
+                return !stockChangeEntity.getAudit().equals(Constants.AuditStatus.AUDIT_SUCCESS.getType());
+            }).peek(stockChangeEntity -> {
                 String type1 = stockChangeEntity.getType();
                 if (Constants.StockChangeType.item_0.getType().equals(type1)
                 || Constants.StockChangeType.item_1.getType().equals(type1)) {

+ 41 - 21
kmall-admin/src/main/resources/mybatis/mapper/haikong/StockChangeDao.xml

@@ -48,34 +48,54 @@
 
 	<select id="queryList" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
 		select
-    		`id`,
-    		`type`,
-    		`time`,
-    		`merch_sn`,
-    		`merch`,
-    		`store_id`,
-    		`store`,
-    		`third_merch_sn`,
-    		`audit`,
-    		`third_merch`,
-    		`remark`,
-    		`create_by`,
-    		`create_time`,
-    		`modify_by`,
-    		`modify_time`,
-    		`audit_by`,
-    		`audit_time`
-		from mall_stock_change
+    		c.`id`,
+			c.`type`,
+			c.`time`,
+			c.`merch_sn`,
+    		c.`merch`,
+    		c.`store_id`,
+    		c.`store`,
+			c.`third_merch_sn`,
+			c.`audit`,
+			c.`third_merch`,
+			c.`remark`,
+			c.`create_by`,
+			c.`create_time`,
+			c.`modify_by`,
+			c.`modify_time`,
+			c.`audit_by`,
+			c.`audit_time`,
+		    r.product,
+		    r.specification
+		from mall_stock_change c
+		inner join mall_stock_change_record r
+		on c.id =r.parent_id
 		WHERE 1=1
 		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+			AND c.name LIKE concat('%',#{name},'%')
+		</if>
+		<if test="id != null and id.trim() != ''">
+			AND c.id = #{id}
+		</if>
+		<if test="type != null and type.trim() != ''">
+			AND c.type = #{type}
+		</if>
+
+		<if test="time != null and time.trim() != ''">
+			AND c.time &gt; #{time}
+		</if>
+		<if test="audit != null and audit.trim() != ''">
+			AND c.audit = #{audit}
+		</if>
+		<if test="storeName != null and storeName.trim() != ''">
+			AND c.store_id = #{storeId}
 		</if>
-        <choose>
+		<choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by id desc
+                order by c.id desc
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 28 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/stockchange.html

@@ -12,6 +12,34 @@
                 <i-col span="4">
                     <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                 </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.orderId" @on-enter="query" placeholder="单号"/>
+                </i-col>
+                <i-col span="3">
+                    <i-select v-model="q.type" placeholder="类型" filterable label-in-value>
+                        <i-option v-for="stockChangeType in stockChangeTypes" :value="stockChangeType.value"
+                                  :key="stockChangeType.id">{{stockChangeType.name}}
+                        </i-option>
+                    </i-select>
+                </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.time" @on-enter="query" placeholder="出入库时间" type="date" />
+                </i-col>
+                <i-col span="3">
+                    <i-select v-model="q.audit" placeholder="审核状态" filterable label-in-value >
+                        <i-option v-for="stockChangeAudit in stockChangeAudits" :value="stockChangeAudit.value"
+                                  :key="stockChangeAudit.id">{{stockChangeAudit.name}}
+                        </i-option>
+                    </i-select>
+                </i-col>
+                <i-col span="3">
+                    <i-select v-model="q.storeId" placeholder="门店" filterable label-in-value>
+                        <i-option v-for="store in stores" :value="store.id"
+                                  :key="store.id">{{store.storeName}}
+                        </i-option>
+                    </i-select>
+                </i-col>
+
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>

+ 32 - 3
kmall-admin/src/main/webapp/js/shop/stockchange.js

@@ -23,6 +23,7 @@ $(function () {
 			{label: '商户名称', name: 'merch', index: 'merch', width: 80, align: 'center'},
 			{label: '门店id', name: 'storeId', index: 'store_id', width: 80, align: 'center'},
 			{label: '门店名称', name: 'store', index: 'store', width: 80, align: 'center'},
+			{label: '商品名称', name: 'product', index: 'product', width: 80, align: 'center'},
 			{label: '第三方商户', name: 'thirdMerchSn', index: 'third_merch_sn', width: 80, align: 'center'},
 			{label: '审核状态', name: 'audit', index: 'audit', width: 80, align: 'center', formatter: function (value) {
 					if (value == '0') {
@@ -41,7 +42,9 @@ $(function () {
 			{label: '修改人', name: 'modifyBy', index: 'modify_by', width: 80, align: 'center'},
 			{label: '修改时间', name: 'modifyTime', index: 'modify_time', width: 80, align: 'center'},
 			{label: '审核人', name: 'auditBy', index: 'audit_by', width: 80, align: 'center'},
-			{label: '审核时间', name: 'auditTime', index: 'audit_time', width: 80, align: 'center'}],
+			{label: '审核时间', name: 'auditTime', index: 'audit_time', width: 80, align: 'center'},
+			{label: '规格', name: 'specification', index: 'specification', width: 80, align: 'center'},
+		],
 		viewrecords: true,
         height: 550,
         rowNum: 10,
@@ -80,9 +83,17 @@ let vm = new Vue({
 			]
 		},
 		q: {
-		    name: ''
+		    name: '',
+			orderId:'',
+			type:'',
+			time:'',
+			audit:'',
+			storeId:''
 		},
 		uploadData:[],
+		stores:[],
+		stockChangeTypes:[],
+		stockChangeAudits:[]
 	},
 	methods: {
 		query: function () {
@@ -201,7 +212,7 @@ let vm = new Vue({
 			vm.showList = true;
             let page = $("#jqGrid").jqGrid('getGridParam', 'page');
 			$("#jqGrid").jqGrid('setGridParam', {
-                postData: {'name': vm.q.name},
+                postData: {'name': vm.q.name,'orderId':vm.q.orderId,'type':vm.q.type,'time':vm.q.time,'audit':vm.q.audit,"storeId":vm.q.storeId},
                 page: page
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');
@@ -244,5 +255,23 @@ let vm = new Vue({
 			return promise; //通过返回一个promis对象解决
 
 		}
+	},
+	mounted() {
+		// this.uploadList = this.$refs.upload.fileList;
+		/*$.get("../category/getCategorySelect", function (r) {
+            vm.queryCategories = r.list;
+        });*/
+		$.get("../sys/macro/queryMacrosByValue?value=stockChangeType", function (r) {
+			vm.stockChangeTypes = r.list;
+		});
+		$.get("../sys/macro/queryMacrosByValue?value=stockChangeAudit", function (r) {
+			vm.stockChangeAudits = r.list;
+		});
+		$.get("../store/queryAll", function (r) {
+			vm.stores = r.list;
+		});
+
+
+
 	}
 });