Sfoglia il codice sorgente

Merge branch 'develop_temp_yh14' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_fenbiao0309

lilei 2 anni fa
parent
commit
1c1f7edc86

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.1.75",
+    "version": "2.1.80",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 22 - 10
src/views/inventoryManagement/intelligentReplenishment/edit.vue

@@ -122,16 +122,23 @@ export default {
     },
     // 详情
     getDetail () {
+      this.spinning = true
       predictDetail({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
+          this.form.stockPredictRange = res.data.stockPredictRange != undefined ? Number(res.data.stockPredictRange) : 1
           if (res.data.state == 'RUN') {
             this.current = 2
+            this.spinning = false
           } else {
             this.current = 0
+            if (this.form.stockPredictRange == 0) {
+              this.getTrendSn()
+            }
           }
         } else {
           this.detailData = null
+          this.spinning = false
         }
       })
     },
@@ -140,6 +147,9 @@ export default {
       predictRangeSave(params).then(res => {
         if (res.status == 200) {
           this.$refs.productRange.refreshList()
+          if (this.current == 0) { //  产品设置
+            this.handleSave(true)
+          }
         }
       })
     },
@@ -147,12 +157,7 @@ export default {
     handleNext () {
       const _this = this
       if (this.current == 0) { //  产品设置
-        const params = {
-          id: this.detailData.id,
-          stockPredictSn: this.$route.params.sn,
-          stockPredictRange: this.form.stockPredictRange
-        }
-        this.handleSave(params)
+        this.handleSave(false)
       } else if (this.current == 1) { //  参数设置
         this.$refs.ruleForm.validate(valid => {
           if (valid) {
@@ -173,11 +178,18 @@ export default {
       }
     },
     // 保存
-    handleSave (params) {
+    handleSave (noNext) {
+      const params = {
+        id: this.detailData.id,
+        stockPredictSn: this.$route.params.sn,
+        stockPredictRange: this.form.stockPredictRange
+      }
       this.spinning = true
       predictSave(params).then(res => {
         if (res.status == 200) {
-          this.current++
+          if (!noNext) {
+            this.current++
+          }
           this.spinning = false
         } else {
           this.spinning = false
@@ -213,6 +225,7 @@ export default {
     },
     // 获取默认服务水平
     getTrendSn () {
+      this.spinning = true
       predictTrendList({ defaultFlag: 1 }).then(res => {
         if (res.status == 200) {
           this.form.trendSn = (res.data && res.data[0] && res.data[0].trendSn) ? res.data[0].trendSn : undefined
@@ -223,6 +236,7 @@ export default {
           this.form.serviceLevel = ''
           this.form.safetyFactor = ''
         }
+        this.spinning = false
       })
     },
     setTableH () {
@@ -238,8 +252,6 @@ export default {
       }
       this.$refs.ruleForm.resetFields()
       this.getDetail()
-      this.getTrendSn()
-      this.current = 0
 
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 2 - 2
src/views/supplierManagement/costSetting/chooseImportModal.vue

@@ -93,14 +93,14 @@ export default {
         { title: '供应商名称', dataIndex: 'supplierName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text || 0) : '--') } }
       ],
       nowUnColumns: [ //  不可导入
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '供应商名称', dataIndex: 'supplierName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'importErrorMsgList', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],