Эх сурвалжийг харах

Merge remote-tracking branch 'origin/demo_' into demo_

hfxc226 2 жил өмнө
parent
commit
61e967b315

+ 15 - 0
src/api/fill/info.js

@@ -17,6 +17,21 @@ export function getFillInfoPage (parameter) {
   })
 }
 
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getFillInfo () {
+  return axios({
+    url: '/fill/infos',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
 /**
  * add func
  * parameter: { }

+ 16 - 12
src/views/fill/gather/FillGather.vue

@@ -103,19 +103,23 @@ export default {
           title: '名称',
           dataIndex: 'name'
         },
+        // {
+        //   title: '类型',
+        //   dataIndex: 'codeId',
+        //   customRender: (text, record, index) => {
+        //     return this.BaseTool.Table.getMapText(this.codeIdMap, text)
+        //   }
+        // },
+        // {
+        //   title: '使用类型',
+        //   dataIndex: 'useType',
+        //   customRender: (text, record, index) => {
+        //     return this.BaseTool.Table.getMapText(this.useTypeMap, text)
+        //   }
+        // },
         {
-          title: '类型',
-          dataIndex: 'codeId',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Table.getMapText(this.codeIdMap, text)
-          }
-        },
-        {
-          title: '使用类型',
-          dataIndex: 'useType',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Table.getMapText(this.useTypeMap, text)
-          }
+          title: '频次周期(天)',
+          dataIndex: 'period'
         },
         {
           title: '备注',

+ 58 - 9
src/views/fill/gather/modules/BaseForm.vue

@@ -14,7 +14,7 @@
           </a-form-item>
         </row-item>
       </row-list>
-      <row-list :col="1">
+      <row-list :col="1" v-show="content == 0">
         <row-item>
           <a-form-item
             label="名称"
@@ -26,6 +26,19 @@
           </a-form-item>
         </row-item>
         <row-item>
+          <a-form-item
+            label="频次周期"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input-number
+              :min="0"
+              :formatter="value => `${value}天`"
+              :parser="value => value.replace('天', '')"
+              v-decorator="['period', {rules: [{required: true, message: '名频次周期不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+        <!-- <row-item>
           <a-form-item
             label="类型"
             :labelCol="BaseTool.Constant.labelCol"
@@ -42,8 +55,8 @@
               </a-select-option>
             </a-select>
           </a-form-item>
-        </row-item>
-        <row-item>
+        </row-item> -->
+        <!-- <row-item>
           <a-form-item
             label="使用类型"
             :labelCol="BaseTool.Constant.labelCol"
@@ -60,9 +73,7 @@
               </a-select-option>
             </a-select>
           </a-form-item>
-        </row-item>
-      </row-list>
-      <row-list :col="1">
+        </row-item> -->
         <row-item>
           <a-form-item
             label="备注"
@@ -75,9 +86,32 @@
           </a-form-item>
         </row-item>
       </row-list>
+      <row-list v-show="content == 1">
+        <row-item>
+          <a-form-item
+            label="巡检内容"
+            :labelCol="BaseTool.Constant.labelCol3"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-checkbox-group
+              v-decorator="['infoIds']"
+            >
+              <br />
+              <div v-for="option in options " :key="option.id">
+                <a-checkbox style="display: inline-block;width:500px;" :value="option.id">
+                  <span >{{ option.name }}---{{ option.remark }}</span>
+                </a-checkbox>
+                <br />
+              </div>
+            </a-checkbox-group>
+          </a-form-item>
+        </row-item>
+      </row-list>
     </a-form>
     <template slot="footer">
-      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+      <a-button v-show="content == 1" :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+      <a-button v-show="content == 0" :loading="confirmLoading" type="primary" @click="content++">下一步</a-button>
+      <a-button v-show="content == 1" :loading="confirmLoading" type="primary" @click="content--">上一步</a-button>
     </template>
   </a-modal>
 </template>
@@ -85,8 +119,11 @@
 <script>
 import pick from 'lodash.pick'
 import { addFillGather, updateFillGather } from '@/api/fill/gather'
+import { getFillInfo } from '@/api/fill/info'
+import RowList from '@/components/custom/RowList.vue'
 
 export default {
+  components: { RowList },
   name: 'BaseFillGather',
   data () {
     return {
@@ -94,6 +131,8 @@ export default {
       modalTitle: null,
       form: this.$form.createForm(this),
       visible: false,
+      options: [],
+      content: 0,
       // 下拉框map
       useTypeMap: {},
       codeIdMap: {}
@@ -104,6 +143,10 @@ export default {
     // 下拉框map
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FILL_INFO_USE_TYPE)
     this.codeIdMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FILL_GATHER_CODE_ID)
+    getFillInfo().then(res => {
+      console.log(res)
+      this.options = res.data
+    })
   },
   methods: {
     base (record) {
@@ -116,12 +159,13 @@ export default {
       this.modalTitle = '编辑'
       const { form: { setFieldsValue } } = this
       // 日期处理
+
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
           'id',
           'name',
-          'codeId',
-          'useType',
+          'period',
+          'infoIds',
           'remark'
         ])))
       })
@@ -135,6 +179,7 @@ export default {
           return
         }
         // 日期处理
+        console.log(values)
         if (this.BaseTool.String.isBlank(values.id)) {
           addFillGather(values)
             .then(() => {
@@ -154,6 +199,7 @@ export default {
     },
     handleCancel (values) {
       this.visible = false
+      this.content = 0
       this.confirmLoading = false
       this.form.resetFields()
       if (this.BaseTool.Object.isNotBlank(values)) {
@@ -164,3 +210,6 @@ export default {
   }
 }
 </script>
+<style lang="less" scoped>
+
+</style>

+ 4 - 3
src/views/fill/gather/modules/Detail.vue

@@ -8,11 +8,12 @@
   >
     <detail-list title="" :col="2">
       <detail-list-item term="名称">{{ model.name }}</detail-list-item>
-      <detail-list-item term="类型">{{ BaseTool.Object.getField(codeIdMap,model.codeId) }}</detail-list-item>
-      <detail-list-item term="使用类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</detail-list-item>
+      <!-- <detail-list-item term="类型">{{ BaseTool.Object.getField(codeIdMap,model.codeId) }}</detail-list-item>
+      <detail-list-item term="使用类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</detail-list-item> -->
       <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+      <detail-list-item term="频次周期">{{ model.period }} 天</detail-list-item>
       <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
-<!--      <detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>-->
+      <!--      <detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>-->
       <detail-list-item term="更新人名称">{{ model.updateUserName }}</detail-list-item>
       <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
     </detail-list>