Browse Source

任务处理中心:调整字段

chrislee 1 year ago
parent
commit
2926215a7a

+ 1 - 0
src/api/cus.js

@@ -21,6 +21,7 @@ export function getCustomer () {
   })
 }
 
+// 获取沟通编码
 export function getCoCode () {
   return request({
     url: request.adornUrl(`/biz-service/cusCommunication/code/list`),

+ 123 - 0
src/views/modules/common/communication-component.vue

@@ -0,0 +1,123 @@
+<template>
+  <div>
+    <el-select
+      v-model="value"
+      ref="select"
+      placeholder="请选择"
+      clearable
+      filterable
+      remote
+      :remote-method="remoteMethod"
+      @change = "onChange"
+      @focus="cancelReadOnly"
+      @hook:mounted="cancelReadOnly"
+      @visible-change="cancelReadOnly">
+      <el-option
+        v-for="item in options"
+        :key="item.value"
+        :label="item.label"
+        :value="item.value">
+      </el-option>
+<!--      <el-option v-if="options.length > 0" label="加载更多" style="font-style: italic; color: #8a979e" value="undefined" @click.native="handleClick()"></el-option>-->
+    </el-select>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'communication-component',
+    props: {
+      coCode: {
+        type: String,
+        default: ''
+      }
+    },
+    model: {
+      prop: 'coCode',
+      event: 'communicationSelected'
+    },
+    data () {
+      return {
+        value: '',
+        current: 1,
+        size: 100000,
+        name: '',
+        options: [],
+        loading: false,
+        noMore: false
+      }
+    },
+    mounted () {
+      this.init()
+    },
+    watch: {
+      productId (value) {
+        this.value = value
+      }
+    },
+    methods: {
+      async init () {
+        this.getList()
+      },
+      remoteMethod (query) {
+        this.options = []
+        this.current = 1
+        this.name = query
+        this.getList()
+      },
+      getList () {
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/cusCommunication/code/list`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.current,
+            'size': this.size
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            if (this.current > data.data.pages) {
+              return
+            }
+            data.data.forEach(item => {
+              this.options.push({
+                label: item.coCode + ' (' + item.customerName + ')',
+                value: item.coCode
+              })
+            })
+          } else {
+            this.options = []
+          }
+        })
+      },
+      handleClick () {
+        this.loadMore()
+      },
+      loadMore () {
+        this.current ++
+        this.getList()
+      },
+      onChange (item) {
+        if (item === 'undefined') {
+          this.value = null
+        }
+        let obj = this.options.find((t) => t.value === item)
+        this.$emit('communicationSelected', obj)
+      },
+      cancelReadOnly (onOff) {
+        this.$nextTick(() => {
+          if (!onOff) {
+            const input = this.$refs.select.$el.querySelector('.el-input__inner')
+            const timer = setTimeout(() => {
+              input.removeAttribute('readonly')
+              clearTimeout(timer)
+            }, 200)
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 23 - 5
src/views/modules/production/scheduling-check.vue

@@ -12,15 +12,32 @@
               </el-form-item>
             </el-col>
           </el-row>
+          <el-row class="my-row">
+            <el-col :span="8">
+              <el-form-item label="物料名称" prop="productName">
+                <el-input v-model="dataForm.productName" placeholder="物料名称" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="物料规格" prop="productSpec">
+                <el-input v-model="dataForm.productSpec" placeholder="物料规格" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="材料" prop="materials">
+                <el-input v-model="dataForm.materials" placeholder="材料" disabled></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
           <el-row class="my-row">
             <el-col :span="8">
               <el-form-item label="物品(零件)规格" prop="specifications">
-                <el-input v-model="specifications" placeholder="物品(零件)规格" disabled></el-input>
+                <el-input v-model="specifications" placeholder="请选择物品" disabled></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="物品(零件)单位" prop="unitName">
-                <el-input v-model="unitName" placeholder="物品(零件)单位" disabled></el-input>
+                <el-input v-model="unitName" placeholder="请选择物品" disabled></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -62,9 +79,10 @@ export default {
       onChose () {
         this.$emit('onChose')
       },
-      async init (scheduleId, materialId) {
-        this.dataForm.id = scheduleId || ''
-        this.dataForm.materialId = materialId || ''
+      async init (dataForm) {
+        // this.dataForm.id = dataForm.id || ''
+        // this.dataForm.materialId = dataForm.materialId || ''
+        this.dataForm = dataForm
       },
       validateField (type) {
         this.$refs.dataForm.validateField(type)

+ 1 - 1
src/views/modules/production/scheduling.vue

@@ -379,7 +379,7 @@ export default {
       check (row) {
         this.checkVisible = true
         this.$nextTick(() => {
-          this.$refs.check.init(row.id, row.materialId)
+          this.$refs.check.init(row)
         })
       },
       // 核料