Explorar o código

增加了修改花材分类的弹窗

wangn %!s(int64=5) %!d(string=hai) anos
pai
achega
ed0c77c3e2
Modificáronse 1 ficheiros con 99 adicións e 4 borrados
  1. 99 4
      ghs/src/views/item/list.vue

+ 99 - 4
ghs/src/views/item/list.vue

@@ -42,6 +42,13 @@
         </div>
       </template>
 
+      <template #slot-modify="{ scope }">
+				<el-button
+					type="text"
+					@click.native.stop="replaceBtnFn"
+					>修改</el-button
+				>
+			</template>
 
       <template #table-column-addPrice="{scope}">
         <span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
@@ -76,7 +83,28 @@
     </x-crud>
     <item-list-layer :show.sync="showItemModal" :classId.sync="classId" :className.sync="className" @confirm="selectItemFn" @cancel="showItemModal = false">
     </item-list-layer>
-
+    <!-- 新增弹窗 -->
+		<el-dialog
+			title="修改花材"
+			:visible.sync="addDialog"
+			:close-on-click-modal="false"
+			width="600px"
+		>
+      <div class="ad-modal-content">
+        <el-form
+					:model="replaceForm"
+					:rules="replaceFormRules"
+					ref="replaceForm"
+					label-width="100px"
+					class="demo-form"
+				>
+        </el-form>
+      </div>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="small" @click="resetForm">取 消</el-button>
+				<el-button type="primary" size="small" @click="replaceConfirmFn">确认</el-button>
+			</div>
+		</el-dialog>
   </div>
 </template>
 <script>
@@ -115,7 +143,66 @@ export default {
         }
         
       },
-      initData: []
+      initData: [],
+      addDialog: false,
+      replaceForm: {
+				name: '',
+				alias: '',
+				classId: '',
+				className: '',
+				cover: '',
+				bigUnitId: '',
+				bigUnit: '',
+				smallUnitId: '',
+				smallUnit: '',
+				stockWarning:'',
+				cost:'',
+				addPrice:'',
+				weight:'',
+				ratio:''
+			},
+      replaceFormRules: {
+				name: {
+					required: true,
+					message: '名称不能为空',
+				},
+				cover: {
+					required: true,
+					message: '图片不能为空',
+				},
+				classId: {
+					required: true,
+					message: '请选择分类',
+				},
+				bigUnitId: {
+					required: true,
+					message: '请选择大单位',
+				},
+				smallUnitId: {
+					required: true,
+					message: '请选择小单位',
+				},
+				ratio: {
+					required: true,
+					message: '比例不能为空',
+				},
+				stockWarning: {
+					required: true,
+					message: '最低库存不能为空',
+				},
+				cost: {
+					required: true,
+					message: '运费不能为空',
+				},
+				addPrice: {
+					required: true,
+					message: '加价不能为空',
+				},
+				weight: {
+					required: true,
+					message: '重量不能为空',
+				}
+			},
     };
   },
   computed: {
@@ -154,6 +241,12 @@ export default {
     addFn () {
       this.showItemModal = true
     },
+    resetForm() {
+			this.goodsData = {};
+			this.$refs['replaceForm'].resetFields();
+			this.addDialog = false;
+		},
+    replaceConfirmFn() {},
     tabClick (tab, e) {
       this.app.refresh({ classId: this.classId });
     },
@@ -263,7 +356,7 @@ export default {
               fixed: 'right',
               label: '操作'
             },
-            layout: []
+            layout: ['slot-modify']
           }
         })
         .set('dict', {
@@ -308,7 +401,9 @@ export default {
       this.canAddPrice = false
       this.costPrice = false
     },
-
+    replaceBtnFn() {
+      this.addDialog = true
+    },
     changeSort (d, type) {
       this.dataList.form.type = type
       let obj = {