Browse Source

对接了日执行-修改计划-撒料计划及撒料计划顺序

duanxiaoduan 2 years ago
parent
commit
46785ea032

+ 2 - 2
.env.development

@@ -3,9 +3,9 @@ ENV = 'development'
 
 # base api
 # 测试线
-VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
+# VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
 
-# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 
 # 沙巍
 # VUE_APP_BASE_API = 'http://192.168.1.56:8081/'

BIN
dist.zip


+ 98 - 105
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -332,8 +332,7 @@
           <div class="spreadingMaterial">
             <div>撒料:</div>
             <div class="spreadingMaterialList">
-              <!-- 注释内容后续版本更 -->
-              <!-- <draggable
+              <draggable
                 :disabled="isDropState"
                 id="1"
                 data-source="juju"
@@ -344,11 +343,10 @@
                 animation="500"
                 force-fallback="true"
                 :move="move1"
-                @change="changeLog1(create.temp)"
+                @change="changeLog1"
                 @start="start1"
-                @end="end1(create.temp)"
-              > -->
-              <!-- 注释内容后续版本更 -->
+                @end="end1"
+              >
                 <div v-for="element in create.list2" :key="element.name" class="list-group-item2 item">
                   <div class="arr-l" :style="{'background':element.tbackground}">
                     <div class="arr-l-t">
@@ -405,10 +403,8 @@
                   <div class="arr-t" :style="{'background':element.background}">
                     <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
                   </div>
-                </div>
-              <!-- 注释内容后续版本更 -->
-              <!-- </draggable> -->
-              <!-- 注释内容后续版本更 -->
+                </div>
+              </draggable>
             </div>
           </div>
           <div slot="footer" class="dialog-footer" style="height:55px;">
@@ -1213,73 +1209,63 @@ export default {
         this.getCreateList1()
         return
       }
-      console.log('item.weight===>', item.weight)
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'updateLpplandtlSortsdate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: evt.pastureid,
-          sort: evt.sort,
-          lppid: evt.id,
-          date: this.date
-        }
-      }
-      this.requestParam.data[1] = {
-        'name': 'insertLppddate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: evt.pastureid,
-          lppid: evt.id,
-          barid: item.barid,
-          barname: item.barname,
-          fpdid: item.id,
-          fttype: item.fttype,
-          lweight: item.weight,
-          sort: evt.sort,
-          tmrid: evt.tmrid,
-          tmrname: evt.tmrname,
-          background: item.background,
-          ccountradio: item.ccountradio,
-          cowcount: item.cowcount,
-          date: this.date
-        }
-      }
-      this.requestParam.data[2] = {
-        'name': 'updateFpdetailUsedate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: item.pastureid,
-          id: item.id,
-          fttype: item.fttype,
-          lweight: item.weight,
-          date: this.date
-        }
-      }
-      const url = 'authdata/ExecDataByConfig'
-      const data = this.requestParam
-      postJson(url, data).then(response => {
-        if (response.msg === 'fail') {
-          this.$notify({
-            title: '保存失败',
-            message: response.data,
-            type: 'warning',
-            duration: 2000
-          })
-        } else {
-          this.$notify({
-            title: '',
-            message: '保存成功',
-            type: 'success',
-            duration: 2000
-          })
-        }
-        this.getCreateList1()
+      console.log('item.weight===>', item.weight)
+      const url = 'authdata/lpplandtl/date/add'
+      const data = {}
+      data.parammaps = {}
+      data.parammaps.id = item.id
+      data.parammaps.pastureid = evt.pastureid
+      data.parammaps.lppid = evt.id
+      data.parammaps.barid = item.barid
+      data.parammaps.barname = item.barname
+      data.parammaps.fpdid = item.id
+      data.parammaps.lweight = item.weight
+      data.parammaps.tmrid = evt.tmrid
+      data.parammaps.tmrname = evt.tmrname
+      data.parammaps.fttype = item.fttype
+      data.parammaps.background = item.background
+      data.parammaps.cowcount = item.cowcount
+      data.parammaps.ccountradio = item.ccountradio
+      data.parammaps.date = this.date
+      postJson(url, data).then(response => {
+        this.requestParam = {}
+        this.requestParam.common = {
+          'returnmap': '0'
+        }
+        this.requestParam.data = []
+        this.requestParam.data[0] = {
+          'name': 'updateLpplandtlSortsdate',
+          'type': 'e',
+          'parammaps': {
+            pastureid: evt.pastureid,
+            sort: evt.sort,
+            lppid: evt.id,
+            date: this.date
+          }
+        }
+        this.requestParam.data[1] = {
+          'name': 'updateFpdetailUsedate',
+          'type': 'e',
+          'parammaps': {
+            pastureid: item.pastureid,
+            id: item.id,
+            fttype: item.fttype,
+            lweight: item.weight,
+            date: this.date
+          }
+        }
+        const url2 = 'authdata/ExecDataByConfig'
+        const data2 = this.requestParam
+        postJson(url2, data2).then(response => {
+          if (response.msg === 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          }
+          this.getCreateList1()
+        })
       })
+
     },
     handleUpdate(row) {
       this.getDownList()
@@ -1423,32 +1409,18 @@ export default {
           }
         }
       }
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'updateLppddate',
-        'type': 'e',
-        'parammaps': {
-          pastureid: this.create.temp.pastureid,
-          lppid: this.create.temp.id,
-          barid: objList.barid,
-          barname: objList.barname,
-          fpdid: objList.fpdid,
-          fttype: objList.fttype,
-          lweight: objList.weight,
-          sort: objList.sort,
-          tmrid: objList.tmrid,
-          tmrname: objList.tmrname,
-          background: objList.background,
-          id: objList.id,
-          date:this.date
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
+      const url = 'authdata/lpplandtl/date/add'
+      const data = {}
+      data.parammaps = {}
+      data.parammaps.id = objList.id
+      data.parammaps.pastureid = this.create.temp.pastureid
+      data.parammaps.lppid = this.create.temp.id
+      data.parammaps.tmrid = objList.tmrid
+      data.parammaps.tmrname = objList.tmrname
+      data.parammaps.date = this.date
+
+      postJson(url, data).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
         if (response.msg === 'fail') {
           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         } else {
@@ -1458,15 +1430,36 @@ export default {
       })
     },
     move1(evt, originalEvent){
-      console.log('move1===>', evt, originalEvent)
+      console.log('move1===>evt', evt)
+      console.log('move1===>originalEvent', originalEvent)
+    },
+    changeLog1(evt){
+       console.log('changeLog1===>', evt)
+       var obj = evt.moved.element
+       const url = 'authdata/lpplandtl/edit/date/sort'
+       const data = {}
+       data.parammaps = {}
+       data.parammaps.tmrid = obj.tmrid
+       data.parammaps.pastureid = obj.pastureid
+       data.parammaps.lppid = obj.lppid
+       data.parammaps.sort = evt.moved.newIndex +1
+       data.parammaps.date = this.date
+       postJson(url, data).then(response => {
+         console.log('拖动保存发送参数', this.requestParam)
+         if (response.msg === 'fail') {
+           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+         } else {
+           this.getCreateList2()
+           this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+         }
+       })
     },
-    changeLog1(){},
     start1(evt){
       console.log('start1===>', evt)
       // this.$set(this.table.startObj, 'from', evt.from.className)
       // this.$set(this.table.startObj, 'to', evt.from.className)
     },
-    end1(evt){
+    end1(evt, originalEvent){
       console.log('end1===>', evt)
     },
     // 减少车次

+ 119 - 39
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -280,7 +280,7 @@
                 animation="500"
                 force-fallback="true"
                 :move="move1"
-                @change="changeLog1(create.temp)"
+                @change="changeLog1"
                 @start="start1"
                 @end="end1(create.temp)"
               >
@@ -935,25 +935,69 @@ export default {
         return
       }
       console.log('item.weight===>', item.weight)
+      const url = 'authdata/lpplandtl/add'
+      const data = {}
+      data.parammaps = {}
+      data.parammaps.id = item.id
+      data.parammaps.pastureid = evt.pastureid
+      data.parammaps.lppid = evt.id
+      data.parammaps.barid = item.barid
+      data.parammaps.barname = item.barname
+      data.parammaps.fpdid = item.id
+      data.parammaps.lweight = item.weight
+      data.parammaps.tmrid = evt.tmrid
+      data.parammaps.tmrname = evt.tmrname
+      data.parammaps.fttype = item.fttype
+      data.parammaps.background = item.background
+      data.parammaps.cowcount = item.cowcount
+      data.parammaps.ccountradio = item.ccountradio
+      postJson(url, data).then(response => {
+        this.requestParam = {}
+        this.requestParam.common = { 'returnmap': '0' }
+        this.requestParam.data = []
+        this.requestParam.data[0] = { 'name': 'updateLpplandtlSorts', 'type': 'e',
+          'parammaps': { pastureid: evt.pastureid, sort: evt.sort, lppid: evt.id }
+        }
+        // this.requestParam.data[1] = { 'name': 'insertLppd', 'type': 'e',
+        //   'parammaps': {
+        //     pastureid: evt.pastureid, lppid: evt.id, barid: item.barid, barname: item.barname, fpdid: item.id, fttype: item.fttype,
+        //     lweight: item.weight, sort: evt.sort, tmrid: evt.tmrid, tmrname: evt.tmrname,
+        //     background: item.background, ccountradio: item.ccountradio, cowcount: item.cowcount
+        //   }
+        // }
+        this.requestParam.data[1] = { 'name': 'updateFpdetailUse', 'type': 'e',
+          'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
+        }
+        const url2 = 'authdata/ExecDataByConfig'
+        const data2 = this.requestParam
+        postJson(url2, data2).then(response => {
+          if (response.msg === 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          }
+          this.getCreateList1()
+        })
+      })
       this.requestParam = {}
       this.requestParam.common = { 'returnmap': '0' }
       this.requestParam.data = []
       this.requestParam.data[0] = { 'name': 'updateLpplandtlSorts', 'type': 'e',
         'parammaps': { pastureid: evt.pastureid, sort: evt.sort, lppid: evt.id }
       }
-      this.requestParam.data[1] = { 'name': 'insertLppd', 'type': 'e',
-        'parammaps': {
-          pastureid: evt.pastureid, lppid: evt.id, barid: item.barid, barname: item.barname, fpdid: item.id, fttype: item.fttype,
-          lweight: item.weight, sort: evt.sort, tmrid: evt.tmrid, tmrname: evt.tmrname,
-          background: item.background, ccountradio: item.ccountradio, cowcount: item.cowcount
-        }
-      }
-      this.requestParam.data[2] = { 'name': 'updateFpdetailUse', 'type': 'e',
+      // this.requestParam.data[1] = { 'name': 'insertLppd', 'type': 'e',
+      //   'parammaps': {
+      //     pastureid: evt.pastureid, lppid: evt.id, barid: item.barid, barname: item.barname, fpdid: item.id, fttype: item.fttype,
+      //     lweight: item.weight, sort: evt.sort, tmrid: evt.tmrid, tmrname: evt.tmrname,
+      //     background: item.background, ccountradio: item.ccountradio, cowcount: item.cowcount
+      //   }
+      // }
+      this.requestParam.data[1] = { 'name': 'updateFpdetailUse', 'type': 'e',
         'parammaps': { pastureid: item.pastureid, id: item.id, fttype: item.fttype, lweight: item.weight }
       }
-      const url = 'authdata/ExecDataByConfig'
-      const data = this.requestParam
-      postJson(url, data).then(response => {
+      const url2 = 'authdata/ExecDataByConfig'
+      const data2 = this.requestParam
+      postJson(url2, data2).then(response => {
         if (response.msg === 'fail') {
           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         } else {
@@ -1071,31 +1115,16 @@ export default {
           }
         }
       }
-      this.requestParam = {}
-      this.requestParam.common = {
-        'returnmap': '0'
-      }
-      this.requestParam.data = []
-      this.requestParam.data[0] = {
-        'name': 'updateLppd',
-        'type': 'e',
-        'parammaps': {
-          pastureid: this.create.temp.pastureid,
-          lppid: this.create.temp.id,
-          barid: objList.barid,
-          barname: objList.barname,
-          fpdid: objList.fpdid,
-          fttype: objList.fttype,
-          lweight: objList.weight,
-          sort: objList.sort,
-          tmrid: objList.tmrid,
-          tmrname: objList.tmrname,
-          background: objList.background,
-          id: objList.id
-        }
-      }
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('编辑保存发送参数', this.requestParam)
+      const url = 'authdata/lpplandtl/add'
+      const data = {}
+      data.parammaps = {}
+      data.parammaps.id = objList.id
+      data.parammaps.pastureid = this.create.temp.pastureid
+      data.parammaps.lppid = this.create.temp.id
+      data.parammaps.tmrid = objList.tmrid
+      data.parammaps.tmrname = objList.tmrname
+      postJson(url, data).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
         if (response.msg === 'fail') {
           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         } else {
@@ -1103,11 +1132,62 @@ export default {
           this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
         }
       })
+      // this.requestParam = {}
+      // this.requestParam.common = {
+      //   'returnmap': '0'
+      // }
+      // this.requestParam.data = []
+      // this.requestParam.data[0] = {
+      //   'name': 'updateLppd',
+      //   'type': 'e',
+      //   'parammaps': {
+      //     pastureid: this.create.temp.pastureid,
+      //     lppid: this.create.temp.id,
+      //     barid: objList.barid,
+      //     barname: objList.barname,
+      //     fpdid: objList.fpdid,
+      //     fttype: objList.fttype,
+      //     lweight: objList.weight,
+      //     sort: objList.sort,
+      //     tmrid: objList.tmrid,
+      //     tmrname: objList.tmrname,
+      //     background: objList.background,
+      //     id: objList.id
+      //   }
+      // }
+      // ExecDataByConfig(this.requestParam).then(response => {
+      //   console.log('编辑保存发送参数', this.requestParam)
+      //   if (response.msg === 'fail') {
+      //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+      //   } else {
+      //     this.getCreateList2()
+      //     this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+      //   }
+      // })
     },
     move1(evt, originalEvent){
-      console.log('move1===>', evt, originalEvent)
+      console.log('move1===>evt', evt)
+      console.log('move1===>originalEvent', originalEvent)
+    },
+    changeLog1(evt){
+      const url = 'authdata/lpplandtl/edit/sort'
+      const data = {}
+      var obj = evt.moved.element
+      data.parammaps = {}
+      data.parammaps.tmrid = obj.tmrid
+      data.parammaps.pastureid = obj.pastureid
+      data.parammaps.lppid = obj.lppid
+      data.parammaps.sort = evt.moved.newIndex +1
+      postJson(url, data).then(response => {
+        console.log('拖动保存发送参数', this.requestParam)
+        if (response.msg === 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.getCreateList2()
+          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+        }
+      })
     },
-    changeLog1(){},
     start1(evt){
       console.log('start1===>', evt)
       // this.$set(this.table.startObj, 'from', evt.from.className)