Kaynağa Gözat

生产总订单

jingbb 11 ay önce
ebeveyn
işleme
461c4b526a

+ 1 - 1
src/views/production/productionTotalOrder/modules/material.vue

@@ -485,7 +485,7 @@
             }
         },
         changeUQuantity(record){
-            if(rrecord.unQuantity&&record.unQuantityExecute&&(Number(record.unQuantity)<Number(record.unQuantityExecute))){
+            if(record.unQuantity&&record.unQuantityExecute&&(Number(record.unQuantity)<Number(record.unQuantityExecute))){
                 record.unQuantity = ''
                 this.$message.warning('辅数量不可小于已执行辅数量!')
             }

+ 1 - 1
src/views/production/productionTotalOrder/modules/productDetails.vue

@@ -159,7 +159,7 @@
                 </template>
                 <template slot="semiClass" slot-scope="text, record, index">
                     <a-form-model-item prop="semiClass" class='sonItem'>
-                        <a-input placeholder="请输入" v-model="record.semiClass"</a-input>
+                        <a-input placeholder="请输入" v-model="record.semiClass"></a-input>
                      </a-form-model-item>
                 </template>
                 <template slot="area" slot-scope="text, record, index">

+ 30 - 26
src/views/production/productionTotalOrder/modules/productionTotalOrderAdd.vue

@@ -81,7 +81,7 @@
                     </a-col>
                     <a-col :md="4" :sm="24">
                         <a-form-item label="备注">
-                            <a-input-search placeholder="请输入" v-model="form.remarks"  @search="onSearch" ></a-input-search>
+                            <a-input placeholder="请输入" v-model="form.remarks"></a-input>
                         </a-form-item>
                     </a-col>                    
                 </a-row>
@@ -235,8 +235,8 @@
                 var madeProductionOrdersPage = this.form
                 madeProductionOrdersPage.madeProductionOrdersFinishedList = this.$refs.productDetails.dataSource
                 madeProductionOrdersPage.madeProductionOrdersMaterialList = this.$refs.material.dataSource
-                madeProductionOrdersPage.madeProductionOrdersOutList = this.$refs.TemporaryStorage.dataSource
-                madeProductionOrdersPage.madeProductionOrdersInList = this.$refs.SurplusMaterials.dataSource
+                madeProductionOrdersPage.madeProductionOrdersInList = this.$refs.TemporaryStorage.dataSource
+                madeProductionOrdersPage.madeProductionOrdersOutList = this.$refs.SurplusMaterials.dataSource
                 this.loading = true
                 if(this.defaultMethod=='add'){
                     postAction('/productionOrder/madeProductionOrders/add', madeProductionOrdersPage).then((res) => {
@@ -268,8 +268,8 @@
                 var madeProductionOrdersPage = this.form
                 madeProductionOrdersPage.madeProductionOrdersFinishedList = this.$refs.productDetails.dataSource
                 madeProductionOrdersPage.madeProductionOrdersMaterialList = this.$refs.material.dataSource
-                madeProductionOrdersPage.madeProductionOrdersOutList = this.$refs.TemporaryStorage.dataSource
-                madeProductionOrdersPage.madeProductionOrdersInList = this.$refs.SurplusMaterials.dataSource
+                madeProductionOrdersPage.madeProductionOrdersInList = this.$refs.TemporaryStorage.dataSource
+                madeProductionOrdersPage.madeProductionOrdersOutList = this.$refs.SurplusMaterials.dataSource
                 postAction('/productionOrder/madeProductionOrders/editChild', madeProductionOrdersPage).then((res) => {
                         if (res.success) {
                             console.log(res.message);
@@ -309,6 +309,7 @@
                 getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersFinishedByMainId',{id:id}).then(res=>{
                     if(res.success){
                         this.$refs.productDetails.dataSource =res.result
+                        this.$refs.productDetails.planOrg=this.form.pkOrg
                         this.$refs.productDetails.dataSource.map((item,index)=>{
                             item.rowNo =index+1
                        })
@@ -324,6 +325,7 @@
                 getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersMaterialByMainId',{id:id}).then(res=>{
                     if(res.success){
                         this.$refs.material.dataSource =res.result
+                        this.$refs.material.planOrg=this.form.pkOrg
                         this.$refs.material.dataSource.map((item,index)=>{
                             item.rowNo =index+1
                        })
@@ -336,8 +338,9 @@
              //获取子表信息
              getTemporaryStorageData(id){
                 //入库暂存
-                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersOutByMainId',{id:id}).then(res=>{
+                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersInByMainId',{id:id}).then(res=>{
                     if(res.success){
+                        this.$refs.TemporaryStorage.planOrg=this.form.pkOrg
                         this.$refs.TemporaryStorage.dataSource =res.result
                         this.$refs.TemporaryStorage.dataSource.map((item,index)=>{
                             item.rowNo =index+1
@@ -346,6 +349,22 @@
                       this.$message.error(res.message);
                     }
                 })
+            },
+             //获取子表信息
+             getSurplusMaterialsData(id){
+                //余料管理
+                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersOutByMainId',{id:id}).then(res=>{
+                    if(res.success){
+                        this.$refs.SurplusMaterials.dataSource =res.result
+                        this.$refs.SurplusMaterials.planOrg=this.form.pkOrg
+                        this.$refs.SurplusMaterials.dataSource.map((item,index)=>{
+                            item.rowNo =index+1
+                       })
+                       
+                    }else{
+                      this.$message.error(res.message);
+                    }
+                })
             },
             onSearchProductionOrg(){ 
                 
@@ -376,36 +395,18 @@
             onSearchProject(){
                     if(this.form.orgName&&this.form.orgName!==''){
                         this.$refs.projectPopup.visible = true
-                        this.$refs.projectPopup.getData(this.form.planOrg)
+                        this.$refs.projectPopup.getData(this.form.pkOrg)
                     }else{
                         this.$message.warning('请选择生产组织!')
                     }
             },
-            //获取子表信息
-            getSurplusMaterialsData(id){
-                //余料管理
-                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersInByMainId',{id:id}).then(res=>{
-                    if(res.success){
-                        this.$refs.SurplusMaterials.dataSource =res.result
-                        this.$refs.SurplusMaterials.dataSource.map((item,index)=>{
-                            item.rowNo =index+1
-                       })
-                       
-                    }else{
-                      this.$message.error(res.message);
-                    }
-                })
-            },
             addList(){
                 if(this.activeKey=='finishProduct'){
                     this.$refs.productDetails.addList(this.form.projectCode,this.form.projectName)
-                    this.$refs.productDetails.planOrg=this.form.planOrg
                 }else if(this.activeKey=='material'){
                     this.$refs.material.addList(this.form.projectCode,this.form.projectName)
-                    this.$refs.material.planOrg=this.form.planOrg
                 }else if(this.activeKey=='SurplusMaterials'){
                     this.$refs.SurplusMaterials.addList(this.form.projectCode,this.form.projectName)
-                    this.$refs.SurplusMaterials.planOrg=this.form.planOrg
                 }
             },
             delectRow(){
@@ -423,7 +424,10 @@
             okDataOrganization(data){
                 this.$set(this.form,'orgName',data.Name)
                 this.$set(this.form,'orgCode',data.Code)
-                this.$set(this.form,'planOrg',data.ID)
+                this.$set(this.form,'pkOrg',data.ID)
+                this.$refs.productDetails.planOrg=this.form.pkOrg
+                this.$refs.material.planOrg=this.form.pkOrg
+                this.$refs.SurplusMaterials.planOrg=this.form.pkOrg
             },
             okDataOperators(data){
                 this.$set(this.form,'salesperson',data.Name)

+ 3 - 3
src/views/production/productionTotalOrder/modules/productionTotalOrderDetail.vue

@@ -174,7 +174,7 @@
                        this.getProductData(this.form.id)
                        this.getMaterialData(this.form.id)
                        this.getTemporaryStorageData(this.form.id)
-                       this.getWarehousingData(this.form.id)
+                       this.getSurplusMaterialsDetailData(this.form.id)
                     }else{
                       this.$message.error(res.message);
                     }
@@ -213,7 +213,7 @@
              //获取子表信息
              getTemporaryStorageData(id){
                 //委外出库
-                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersOutByMainId',{id:id}).then(res=>{
+                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersInByMainId',{id:id}).then(res=>{
                     if(res.success){
                         this.$refs.TemporaryStorageDetail.dataSource =res.result
                         this.$refs.TemporaryStorageDetail.dataSource.map((item,index)=>{
@@ -227,7 +227,7 @@
             //获取子表信息
             getSurplusMaterialsDetailData(id){
                 //余料管理
-                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersInByMainId',{id:id}).then(res=>{
+                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersOutByMainId',{id:id}).then(res=>{
                     if(res.success){
                         this.$refs.SurplusMaterialsDetail.dataSource =res.result
                         this.$refs.SurplusMaterialsDetail.dataSource.map((item,index)=>{

+ 34 - 8
src/views/production/productionTotalOrder/productionTotalOrderList.vue

@@ -126,8 +126,8 @@
             <a-button  size="small" @click="detailList">详情</a-button>
             <a-button  size="small" @click="examineApprove">审批</a-button>
             <a-button  size="small" @click="abstainExamineApprove">弃审</a-button>
-            <a-button size="small">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl">
+            <a-button size="small" @click="exportList('生产总订单列表')">导出</a-button>
+            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="fileUpload">
                 <a-button  size="small">导入</a-button>
             </a-upload>
           </div>
@@ -319,17 +319,13 @@
                   ellipsis: true,
                 },
               ],
-              importExcelUrl:'/production/safetyStock/importExcel',
+              fileUpload: window._CONFIG['domianURL'] + "/production/safetyStock/importExcel",
                  // ---------workflow  by fhf start -------------
               serviceName: 'assetAllocationService',
               // ---------workflow  by fhf end -------------
               }
             },
-            computed: {
-              importExcelUrl: function(){
-                  return `${window._CONFIG['domianURL']}/${this.importExcelUrl}`;
-              },
-            },
+          computed: {},
       
           created () {
             this.getTableList()
@@ -474,6 +470,36 @@
                 })
               }
             },
+            //导出
+            exportList(fileName){
+              this.$confirm({
+                  title: '确认导出',
+                  content: '是否导出数据?',
+                  onOk:  ()=> {
+                    alertModal.loading("执行中,请稍后!")
+                    downFile('/productionOrder/madeProductionOrders/exportXls', this.queryParam).then(data => {
+                      alertModal.closeLoading();
+                      if (!data) {
+                        this.$message.warning('文件下载失败')
+                        return
+                      }
+                      if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                        window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
+                      } else {
+                        let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+                        let link = document.createElement('a')
+                        link.style.display = 'none'
+                        link.href = url
+                        link.setAttribute('download', fileName + '.xlsx')
+                        document.body.appendChild(link)
+                        link.click()
+                        document.body.removeChild(link) // 下载完成移除元素
+                        window.URL.revokeObjectURL(url) // 释放掉blob对象
+                      }
+                    })
+                  }
+                })
+            },
             examineApprove(){
               if(this.selectedRowKeys.length==0){
                 this.$message.warning('请选择数据!')