瀏覽代碼

Merge branch 'demo_' of http://123.60.19.203:8088/hitch/hitch-antd

guarantee-lsq 2 年之前
父節點
當前提交
599606cb68

+ 17 - 0
src/api/big/screen.js

@@ -0,0 +1,17 @@
+import { axios } from '@/utils/request'
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getGroupByLine (parameter) {
+  return axios({
+    url: '/big/screens/sb/' + parameter.lineNum,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 99 - 43
src/views/repair/application-form/modules/LongYanSelectSpareForm.vue

@@ -1,57 +1,66 @@
 <template>
   <a-modal
     :title="modalTitle"
-    :width="600"
+    :width="1000"
     :visible="visible"
     :confirmLoading="confirmLoading"
     class="ant-modal2"
     @cancel="handleCancel"
   >
     <a-form :form="form">
-      <row-list :col="1">
-        <row-item>
-          <a-form-item
-            label="备件"
-            :labelCol="BaseTool.Constant.labelCol2"
-            :wrapperCol="BaseTool.Constant.wrapperCol2"
-          >
-            <a-input
-              style="width: 70%"
-              disabled
-              v-model="spareName" />
-            <a-button style="width: 30%" type="primary" @click="handleSpareLongYanSelect">选择备件</a-button>
-          </a-form-item>
-        </row-item>
 
-<!--        <row-item>
-          <a-form-item
-            label="备件寿命"
-            :labelCol="BaseTool.Constant.labelCol2"
-            :wrapperCol="BaseTool.Constant.wrapperCol2"
-          >
-            <a-input
-              style="width: 100%"
-              suffix="天"
-              v-decorator="['sparePeriod']" />
-          </a-form-item>
-        </row-item>
-        <row-item>
-          <a-form-item
-            label="更换备注"
-            :labelCol="BaseTool.Constant.labelCol2"
-            :wrapperCol="BaseTool.Constant.wrapperCol2"
-          >
-            <a-textarea
-              :rows="4"
-              v-decorator="['remark']"/>
-          </a-form-item>
-        </row-item>-->
-      </row-list>
+      <a-form-item
+        label="备件"
+        :labelCol="BaseTool.Constant.labelCol2"
+        :wrapperCol="BaseTool.Constant.wrapperCol2"
+      >
+        <a-input
+          style="width: 300px"
+          disabled
+          v-model="spareName" />
+        <a-button style="width: 100px" type="primary" @click="handleSpareLongYanSelect">选择备件</a-button>
+      </a-form-item>
+
     </a-form>
+    <a-table
+      :columns="columns"
+      :data-source="spareRows"
+      bordered
+      :defaultExpandAllRows="true"
+    >
+      <template v-slot:index="text,record,index">
+        {{ index+1 }}
+      </template>
+      <template v-slot:startDate="text,record">
+        <div>
+          <a-date-picker
+            style="width: 150px"
+            :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+            v-model="record.startDate" />
+        </div>
+      </template>
+      <template v-slot:num="text,record">
+        <div>
+          <a-input
+            type="number"
+            :min="0"
+            style="width: 100%"
+            v-model="record.num"/>
+        </div>
+      </template>
+      <template v-slot:remark="text,record">
+        <div>
+          <a-input
+            type="textarea"
+            style="width: 100%"
+            v-model="record.remark"/>
+        </div>
+      </template>
+    </a-table>
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
     </template>
-    <spare-long-yan-select-modal ref='spareLongYanSelectModal' @selected="handleSpareLongYanSelected"/>
+    <spare-long-yan-select-modal ref="spareLongYanSelectModal" @selected="handleSpareLongYanSelected"/>
   </a-modal>
 </template>
 
@@ -70,7 +79,49 @@ export default {
       spareRows: [],
       // 下拉框map
       isSpecial: 0,
-      spareName: null
+      spareName: null,
+      columns: [
+        {
+          title: '序号',
+          key: 'index',
+          align: 'center',
+          width: 50,
+          scopedSlots: { customRender: 'index' }
+        },
+        {
+          title: '备件名称',
+          width: 100,
+          dataIndex: 'spareName'
+        },
+        {
+          title: '备件编码',
+          dataIndex: 'no',
+          width: 120
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'ggxh',
+          width: 150
+        },
+        {
+          title: '更换日期',
+          dataIndex: 'startDate',
+          width: 150,
+          scopedSlots: { customRender: 'startDate' }
+        },
+        {
+          title: '更换数量',
+          dataIndex: 'num',
+          width: 150,
+          scopedSlots: { customRender: 'num' }
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark',
+          width: 150,
+          scopedSlots: { customRender: 'remark' }
+        }
+      ]
     }
   },
   components: {
@@ -99,7 +150,7 @@ export default {
         }
         const data = []
         for (let i = 0; i < this.spareRows.length; i++) {
-          data.push({ remark: values.remark, isSpecial: this.isSpecial, sbId: this.model.sbId, repairId: this.model.id, num: 1, spareName: this.spareRows[i].spareName, ggxh: this.spareRows[i].ggxh })
+          data.push({ remark: this.spareRows[i].remark, isSpecial: this.isSpecial, sbId: this.model.sbId, no: this.spareRows[i].no, repairId: this.model.id, spareName: this.spareRows[i].spareName, ggxh: this.spareRows[i].ggxh, num: this.spareRows[i].num, startDate: this.BaseTool.Date.formatter(this.spareRows[i].startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
         }
         addLongYanSparePartUsedBatch(data)
           .then((response) => {
@@ -120,7 +171,12 @@ export default {
       this.$refs.spareLongYanSelectModal.base({ isSpecial: this.isSpecial }, { isSpecial: this.isSpecial, sbId: this.model.sbId })
     },
     handleSpareLongYanSelected (record, keys, rows) {
-      this.spareRows = rows
+      this.spareRows = rows.map(item => {
+        item.num = 1
+        item.remark = ''
+        return item
+      })
+
       this.spareName = rows.length
     }
   }

+ 6 - 0
src/views/statisticView/SwitchingRoom.vue

@@ -188,7 +188,13 @@
 </template>
 
 <script>
+import { getGroupByLine } from '@/api/big/screen'
 export default {
+  created () {
+    getGroupByLine({ lineNum: 1 }).then(res => {
+      console.log(res.data)
+    })
+  },
   data () {
     return {
       date: this.BaseTool.Moment().format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN_CHINESE)