shish hace 4 años
padre
commit
a7cf948000
Se han modificado 2 ficheros con 21 adiciones y 9 borrados
  1. 2 0
      ghs/src/views/item-class/list.vue
  2. 19 9
      ghs/src/views/item/list.vue

+ 2 - 0
ghs/src/views/item-class/list.vue

@@ -189,6 +189,8 @@ export default {
 			let query = {};
 			query.classId = data.id
 			query.className = data.name
+			query.status = 0
+			query.delStatus = 2
 			this.$router.push({ path: '/item/list', query });
 		},
 		// x-crud 组件

+ 19 - 9
ghs/src/views/item/list.vue

@@ -21,7 +21,8 @@
 	</template>
 
       <template #table-column-name="{scope}">
-        <span class="item-name"><i class="el-icon-delete" v-if="scope.row.delStatus == 1" style="font-size:13px;"></i>{{ scope.row.name }}</span>
+        <span class="item-name" v-if="scope.row.delStatus == 1" style="text-decoration: line-through;color:red;">{{ scope.row.name }}</span>
+		<span class="item-name" v-else>{{ scope.row.name }}</span>
       </template>
 
       <template #table-column-status="{scope}">
@@ -316,6 +317,7 @@ export default {
 		],
 		selects: {},
 		status:1,
+		delStatus:2,
 		sort: {
 			status: false
 		},
@@ -424,15 +426,15 @@ export default {
 	},
 	//自动填写拼音
 	fillName(event){
-	this.$service.product.py({ name: event }).then(res => {
-		if(res.py){
-			this.replaceForm.py = res.py
-		}
-	}).catch(err => { console.log(err) })
+		this.$service.product.py({ name: event }).then(res => {
+			if(res.py){
+				this.replaceForm.py = res.py
+			}
+		}).catch(err => { console.log(err) })
 	},
 	init(){
-	this.getAllClass()
-	this.getAllUnit()
+		this.getAllClass()
+		this.getAllUnit()
 	},
     selectItemFn (currentItem) {
 
@@ -550,6 +552,14 @@ export default {
           this.$forceUpdate();
         }
       }
+
+		if(this.$route.query.status){
+			this.status = this.$route.query.status
+		}
+		if(this.$route.query.delStatus){
+			this.delStatus = this.$route.query.delStatus
+		}
+
       ctx.service(this.$service.product)
         .set('table', {
           columns: [
@@ -672,7 +682,7 @@ export default {
 		})
         .set('layout', [['slot-tabs'],['search-key'],['flex1', 'slot-addNew-goods-btn','slot-add-goods-btn','slot-download-price-btn', 'refresh-btn'],
 		['data-table'],['flex1', 'pagination']]).done();
-		app.refresh({ classId: this.classId,status:this.status,delStatus:0,showPage: 1});
+		app.refresh({ classId: this.classId,status:this.status,delStatus:this.delStatus,showPage: 1});
     },
     uploadSuccess() {
 		console.log('valid',this.$refs['replaceForm'].validateField('cover'))