Explorar o código

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-web

huxy hai 1 ano
pai
achega
8d8cbc5069

+ 60 - 7
src/views/jeecg/helloworld.vue

@@ -3,14 +3,14 @@
     <a-form-model ref="form" :model="model" :rules="rules" @submit="handleSubmit">
       <a-row>
       <a-col :md="24" :sm="24">
-      <a-form-model-item label="Note" prop="note" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
+      <a-form-model-item label="Note" prop="note" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }" style="display:none">
         <a-input v-model="model.note"/>
       </a-form-model-item>
       </a-col>
       </a-row>
       <a-row>
       <a-col :md="24" :sm="24">
-      <a-form-model-item label="Gender" prop="gender" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
+      <a-form-model-item label="Gender" prop="gender" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }"  style="display:none">
         <a-select v-model="model.gender" placeholder="Select a option and change input text above" @change="handleSelectChange">
           <a-select-option value="male">male</a-select-option>
           <a-select-option value="female">female</a-select-option>
@@ -20,7 +20,7 @@
       </a-row>
       <a-row>
       <a-col :md="24" :sm="24">
-      <a-form-model-item label="Gender" prop="cascader" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
+      <a-form-model-item label="Gender" prop="cascader" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }"  style="display:none">
         <a-cascader :options="areaOptions" @change="onChange" :showSearch="{filter}" placeholder="Please select" />
       </a-form-model-item>
       </a-col>
@@ -28,16 +28,25 @@
       <a-form-model-item :wrapperCol="{ span: 12, offset: 5 }">
         <a-col :md="24" :sm="24">
           <a-form-model-item :wrapperCol="{ span: 12, offset: 5 }">
-            <a-button type="primary" htmlType="submit">Submit</a-button>
+            <a-button type="primary" htmlType="submit"  style="display:none">Submit</a-button>
+            <a-upload  :headers="tokenHeader" :multiple="false"    :customRequest="uploadFlie" :showUploadList="false" >
+                <a-button type="primary" >PMK销售订单上传</a-button>
+              </a-upload>
+              <a-button type="primary" style="margin-left:20px;" :disabled="exportDisabled" @click="exportOrder" >导出订单CSV格式</a-button>
           </a-form-model-item>
+
         </a-col>
       </a-form-model-item>
     </a-form-model>
+    <span class="mytd">
+    {{info}}
+    </span>
   </a-card>
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
+  import { getAction,postAction } from '@/api/manage'
+  import { downFile } from '@/api/manage'
   export default {
     props: ['sex','name'],
     data () {
@@ -48,7 +57,13 @@
           note: [{required: true, message: 'Please input your note!'}],
           gender:[{ required: true, message: 'Please select your gender!' }]
         },
-        areaOptions:[]
+        areaOptions:[],
+        url:{
+          importExcelUrl: 'report/FabricLoss/uploadOrder' ,// 导入
+          list:"",
+        },
+        info:"",
+        exportDisabled:true,
       }
     },
     methods: {
@@ -71,6 +86,39 @@
       filter(inputValue, path) {
         return (path.some(option => (option.label).toLowerCase().indexOf(inputValue.toLowerCase()) > -1));
       },
+      uploadFlie(file) {
+      const formData = new FormData()
+      formData.append('file',file.file)
+      postAction(this.url.importExcelUrl, formData).then(res => {
+        if (res.success) {
+          this.$message.info("解析成功,请点击'导出订单CSV格式下载'");
+          this.exportDisabled = false;
+        }else{
+          this.exportDisabled = true;
+          this.$message.error("解析失败:"+res.message);
+        }
+      })},
+      exportOrder(){
+        downFile('/report/FabricLoss/downOrder',{}).then(data => {
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'text/csv' }), 'order.csv')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'text/csv' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', 'order.csv')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+      }
     },
     created (){
       console.log('============= online href common props ============= ');
@@ -94,4 +142,9 @@
       }
     },
   }
-</script>
+</script>
+<style lang="less" scoped>
+.mytd{
+  white-space: pre-wrap;
+}
+</style>

+ 7 - 7
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -762,13 +762,13 @@ export default {
             this.$refs.fabRemQuaModal.fabRemQuaModVis = true
             this.$refs.fabRemQuaModal.recordF = record
             this.$refs.fabRemQuaModal.data = record.syRemaining
-            if(this.mList.length!==0){
-              this.mList.map(item=>{
-                if(item.goodsName == record.goodsName && item.syRemaining.length!==0){
-                  this.$refs.fabRemQuaModal.data = item.syRemaining
-                }
-              })
-            }
+            // if(this.mList.length!==0){
+            //   this.mList.map(item=>{
+            //     if(item.goodsName == record.goodsName && item.syRemaining.length!==0){
+            //       this.$refs.fabRemQuaModal.data = item.syRemaining
+            //     }
+            //   })
+            // }
           }
         }
       }

+ 11 - 2
src/views/shipment-details/shipmentList.vue

@@ -602,12 +602,21 @@ export default {
                             }
                             
                         },},
-          { field: "preDeliveryDate", key: "j", title: "预发货日期", align: "center", width: 120,sortBy: "", ellipsis: {showTitle: true,}, },
+          { field: "preDeliveryDate", key: "j", title: "预发货日期", align: "center", width: 120,sortBy: "", ellipsis: {showTitle: true,}, renderBodyCell: ({ row, column, rowIndex }, h) => {
+                            const text = row[column.field];
+                            if(text&&text!==''){
+                              return (
+                                moment(text).format('YYYY-MM-DD')
+                              ) 
+                            }else{
+                              return ''
+                            }
+                        } },
           { field: "shipmentQuantity", key: "k", title: "数量", align: "center", width: 80,sortBy: "", ellipsis: {showTitle: true,},},
           { field: "customsDeclarationUnitPrice", key: "m", title: "报关单价", align: "center", width: 100,sortBy: "",ellipsis: {showTitle: true,}, },
           { field: "garmentFactory", key: "l", title: "成衣工厂", align: "center", width: 100,sortBy: "" ,ellipsis: {showTitle: true,},},
           { field: "hsCode", key: "n", title: "HScode", align: "center", width: 120,sortBy: "",ellipsis: {showTitle: true,}, },
-          { field: "englishProductName", key: "o", title: "英文品名", align: "center", width: 110,sortBy: "",ellipsis: {showTitle: true,},  },
+          { field: "englishProductName", key: "o", title: "英文品名", align: "center", width: 150,sortBy: "",ellipsis: {showTitle: true,},  },
           { field: "materialComposition", key: "p", title: "物料成分", align: "center", width: 180,sortBy: "",ellipsis: {showTitle: true,}, },
           { field: "purOrSubOrder", key: "q", title: "采购/委外订单号", align: "center", width: 180,sortBy: "",ellipsis: {showTitle: true,}, },
           { field: "numberOfSets", key: "r", title: "套装件数", align: "center", width: 100,sortBy: "",ellipsis: {showTitle: true,}, },