Browse Source

feat:商品信息联调、首页提醒弹框

maliang 5 days ago
parent
commit
5becc4563c

+ 27 - 21
jshERP-web/src/views/dashboard/Analysis.vue

@@ -1,21 +1,27 @@
-<template>
-  <div style="margin: 12px 12px 0px">
-    <index-chart></index-chart>
-  </div>
-</template>
-
-<script>
-import IndexChart from './IndexChart'
-
-export default {
-  name: 'Analysis',
-  components: {
-    IndexChart,
-  },
-  data() {
-    return {}
-  },
-  created() {},
-  methods: {},
-}
-</script>
+<template>
+  <div style="margin: 12px 12px 0px">
+    <index-chart></index-chart>
+    <sys-tip-modal ref="sysTipModal"></sys-tip-modal>
+  </div>
+</template>
+
+<script>
+import IndexChart from './IndexChart'
+import SysTipModal from './dialog/SysTipModal.vue'
+export default {
+  name: 'Analysis',
+  components: {
+    IndexChart,
+    SysTipModal,
+  },
+  data() {
+    return {}
+  },
+  created() {},
+  methods: {
+    openSysTipModal() {
+      this.$refs.sysTipModal.open({})
+    },
+  },
+}
+</script>

+ 126 - 0
jshERP-web/src/views/dashboard/dialog/SysTipModal.vue

@@ -0,0 +1,126 @@
+<template>
+  <div ref="container">
+    <a-modal
+      :width="630"
+      :visible="visible"
+      :confirm-loading="confirmLoading"
+      :getContainer="() => $refs.container"
+      :mask="true"
+      :maskClosable="false"
+      @cancel="handleCancel"
+      centered
+      wrapClassName="sys-tip-modal-wrap"
+      :footer="null"
+    >
+      <template #title>
+        <div class="title-wrap">提醒</div>
+      </template>
+      <div class="tip-body">
+        <div class="tip-content">
+          <div class="text-title">无动销提醒</div>
+          <p class="text-val">1.商品名称xxx,在【无动销提醒周期】内,无动销,请及时处理</p>
+          <p class="text-val">1.商品名称xxx,在【无动销提醒周期】内,无动销,请及时处理</p>
+          <div class="text-title">过期提醒</div>
+          <p class="text-val">3.商品名称xxx,条码xxx,生产日期xxx,保质期xxx,库存xxx,即将要过期,请及时处理</p>
+          <div class="text-title">库存提醒</div>
+          <p class="text-val">4.商品名称xxx,库存告警,请及时处理</p>
+        </div>
+        <div class="btn-wrap">
+          <a-button type="primary" @click="handleOk" class="confirm-btn">好的</a-button>
+        </div>
+      </div>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      visible: false,
+      confirmLoading: false,
+      dataInfo: {},
+    }
+  },
+  methods: {
+    open(data = {}) {
+      this.visible = true
+      this.dataInfo = { ...data }
+    },
+    handleCancel() {
+      this.visible = false
+    },
+    handleOk() {
+      this.visible = false
+    },
+  },
+}
+</script>
+
+<style lang="less">
+.sys-tip-modal-wrap {
+  .ant-modal-header {
+    border-bottom: 0;
+    background-color: transparent;
+  }
+  .ant-modal-footer {
+    border-top: 0;
+    text-align: center;
+  }
+  .ant-modal-content {
+    background: url('./sys-tip-bg.png') no-repeat;
+    background-size: 100% 100%;
+    background-blend-mode: lighten;
+  }
+  .ant-modal-body {
+    padding-top: 0;
+  }
+  .confirm-btn {
+    width: 118px;
+  }
+  .title-wrap {
+    position: relative;
+    padding-left: 16px;
+    font-size: 20px;
+    &::before {
+      position: absolute;
+      content: '';
+      left: 0;
+      top: 50%;
+      transform: translateY(-50%);
+      height: 20px;
+      width: 4px;
+      background: #1890ff;
+      border-radius: 4px;
+    }
+  }
+  .tip-body {
+    position: relative;
+    padding: 16px;
+    width: 100%;
+    border-radius: 8px;
+    box-shadow: 0px 0px 10px 0px #3f6bfd24;
+    background-color: rgba(255, 255, 255, 0.8);
+  }
+  .tip-content {
+    height: 210px;
+  }
+  .btn-wrap {
+    margin-top: 16px;
+    text-align: center;
+  }
+  .text-title {
+    font-family: PingFang SC;
+    font-weight: 500;
+    font-size: 16px;
+    margin: 8px 0;
+  }
+  .text-val {
+    font-size: 14px;
+    font-family: PingFang SC;
+    font-weight: 400;
+    font-size: 14px;
+    margin-bottom: 0;
+  }
+}
+</style>

BIN
jshERP-web/src/views/dashboard/dialog/sys-tip-bg.png


+ 8 - 8
jshERP-web/src/views/material/MaterialList.vue

@@ -59,11 +59,11 @@
                     <a-input placeholder="请输入品牌查询" v-model="queryParam.brand"></a-input>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <!-- <a-col :md="6" :sm="24">
                   <a-form-item label="制造商" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input placeholder="请输入制造商查询" v-model="queryParam.mfrs"></a-input>
                   </a-form-item>
-                </a-col>
+                </a-col> -->
                 <a-col :md="6" :sm="24">
                   <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-select placeholder="请选择状态" v-model="queryParam.enabled">
@@ -80,15 +80,15 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <!-- <a-col :md="6" :sm="24">
                   <a-form-item label="批号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
                       <a-select-option value="1">有</a-select-option>
                       <a-select-option value="0">无</a-select-option>
                     </a-select>
                   </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
+                </a-col> -->
+                <!-- <a-col :md="6" :sm="24">
                   <a-form-item label="仓位货架" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input
                       style="width: 100%"
@@ -96,7 +96,7 @@
                       v-model="queryParam.position"
                     ></a-input>
                   </a-form-item>
-                </a-col>
+                </a-col> -->
                 <a-col :md="6" :sm="24">
                   <a-form-item label="扩展信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input
@@ -115,7 +115,7 @@
                     ></a-input-number>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <!-- <a-col :md="6" :sm="24">
                   <a-form-item label="保质期" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input-number
                       style="width: 100%"
@@ -123,7 +123,7 @@
                       v-model="queryParam.expiryNum"
                     ></a-input-number>
                   </a-form-item>
-                </a-col>
+                </a-col> -->
                 <a-col :md="6" :sm="24">
                   <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>

+ 24 - 45
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -209,7 +209,7 @@
                   data-title="系统SKU"
                   data-intro="系统SKU"
                 >
-                  <a-input placeholder="提交后自动生成" disabled />
+                  <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSku']" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -400,13 +400,15 @@
                 @added="onAdded"
                 @deleted="onDeleted"
               >
-                <template #supplierId>
+                <template #supplierId="{ handleChange, value }">
                   <a-select
                     placeholder="请选择供应商"
                     v-decorator="['supplierId']"
                     :dropdownMatchSelectWidth="false"
                     showSearch
                     optionFilterProp="children"
+                    :value="typeof value === 'string' ? Number(value) : ''"
+                    @change="($event) => handleChange($event)"
                   >
                     <div slot="dropdownRender" slot-scope="menu">
                       <v-nodes :vnodes="menu" />
@@ -424,13 +426,15 @@
                     </a-select-option>
                   </a-select>
                 </template>
-                <template #depotId>
+                <template #depotId="{ handleChange, value }">
                   <a-select
                     placeholder="请选择仓库名称"
                     v-decorator="['depotId']"
                     :dropdownMatchSelectWidth="false"
                     showSearch
                     optionFilterProp="children"
+                    :value="value"
+                    @change="($event) => handleChange($event)"
                   >
                     <div slot="dropdownRender" slot-scope="menu">
                       <v-nodes :vnodes="menu" />
@@ -443,7 +447,7 @@
                         <a-icon type="plus" /> 新增仓库
                       </div>
                     </div>
-                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.value">
                       {{ item.text }}
                     </a-select-option>
                   </a-select>
@@ -637,17 +641,19 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '条码',
-            key: 'barCode',
+            title: '批次号',
+            // key: 'barCode',
+            key: 'batchNumber',
             width: '15%',
             type: FormTypes.input,
+            disabled: true,
             defaultValue: '',
-            placeholder: '请输入${title}',
-            validateRules: [
-              { required: true, message: '${title}不能为空' },
-              { pattern: /^.{4,40}$/, message: '长度为4到40位' },
-              { handler: this.validateBarCode },
-            ],
+            placeholder: '自动生成',
+            // validateRules: [
+            //   { required: true, message: '${title}不能为空' },
+            //   { pattern: /^.{4,40}$/, message: '长度为4到40位' },
+            //   { handler: this.validateBarCode },
+            // ],
           },
           {
             title: '单位',
@@ -733,15 +739,6 @@ export default {
             placeholder: '请输入${title}',
           },
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '9%',
-            type: FormTypes.input,
-            readonly: true,
-            defaultValue: '',
-            placeholder: '自动生成,不可编辑',
-          },
-          {
             title: '库存(最小单位)',
             key: 'inventory',
             width: '9%',
@@ -893,6 +890,7 @@ export default {
           this.fileList = record.imgName
         }, 5)
       }
+      console.log('this.model--------', this.model)
       this.$nextTick(() => {
         this.form.setFieldsValue(
           pick(
@@ -908,12 +906,9 @@ export default {
             'categoryId',
             'enableSerialNumber',
             'movingPinReminderCycle',
-            'enableBatchNumber',
-            'position',
-            'expiryNum',
+            'systemSku',
             'weight',
             'remark',
-            'mfrs',
             'otherField1',
             'otherField2',
             'otherField3'
@@ -963,6 +958,7 @@ export default {
             }
           }
           tab.dataSource = res.data.rows || []
+          console.log('tab.dataSource-----', tab.dataSource)
         })
         .finally(() => {
           tab.loading = false
@@ -1041,6 +1037,7 @@ export default {
     },
     /** 发起新增或修改的请求 */
     requestAddOrEdit(formData) {
+      console.log('formData------------', formData)
       if (formData.meList.length === 0) {
         this.$message.warning('抱歉,请输入条码信息!')
         return
@@ -1413,32 +1410,14 @@ export default {
     },
     onAdded(event) {
       const { row, target } = event
-      let unit = ''
-      if (this.unitStatus == false) {
-        unit = this.form.getFieldValue('unit')
-      }
-      if (this.maxBarCodeInfo === '') {
-        getMaxBarCode({}).then((res) => {
-          if (res && res.code === 200) {
-            this.maxBarCodeInfo = res.data.barCode - 0
-            this.maxBarCodeInfo = this.maxBarCodeInfo + 1
-            target.setValues([
-              { rowKey: row.id, values: { barCode: this.maxBarCodeInfo, commodityUnit: unit ? unit : '' } },
-            ])
-          }
-        })
-      } else {
-        this.maxBarCodeInfo = this.maxBarCodeInfo + 1
-        target.setValues([
-          { rowKey: row.id, values: { barCode: this.maxBarCodeInfo, commodityUnit: unit ? unit : '' } },
-        ])
-      }
+      target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: '' } }])
     },
     onDeleted(value) {
       this.meDeleteIdList = value
     },
     //单元值改变一个字符就触发一次
     onValueChange(event) {
+      console.log('onValueChange--------table-change', event)
       const { type, row, column, value, target } = event
       switch (column.key) {
         case 'purchaseDecimal':