Bladeren bron

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 2 jaren geleden
bovenliggende
commit
9888f51367

+ 18 - 0
src/api/purchase/DemandSummary.js

@@ -75,4 +75,22 @@ export function reloadBatch(data) {
     method: 'post',
     data: data
   })
+}
+// 采购需求汇总列表导出
+export function exportList(data) {
+  return request({
+    url: `/pu/demand/item/list/export`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}
+// 采购需求汇总明细导出
+export function exportItems(data) {
+  return request({
+    url: `/pu/demand/item/exports`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
 }

+ 94 - 9
src/views/material/requisition/add.vue

@@ -607,7 +607,7 @@
     <div class="btn_group">
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="save"
-          v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+          v-if="pageStu == 'add' || pageStu == 'edit' || pageStu ==='copy' ">保存</el-button>
       </el-col>
       <el-col :span="1.5" style="margin: 0 10px;">
         <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
@@ -898,7 +898,7 @@ export default {
   //   }
   // },
   mounted() {
-    // console.log('页面状态',this.pageStu)
+    console.log('页面状态',this.pageStu)
     if (this.pageStu == 'check') {
       // alert('详情页面:')
       console.log('页面状态', this.pageStu)
@@ -943,7 +943,7 @@ export default {
       if (this.row.innerPackingUnit) {
         this.getInnerPackingUnitDetails(this.row.innerPackingUnit)
       }
-    } else if (this.pageStu == 'edit') {
+    } else if (this.pageStu == 'edit' ) {
       // alert('修改页面')
       console.log('页面状态', this.pageStu)
       console.log('数据', this.row)
@@ -1001,6 +1001,58 @@ export default {
     } else if (this.pageStu == 'add') {
       // alert('新增页面')
       console.log('页面状态', this.pageStu)
+    }else if(this.pageStu === 'copy'){
+      this.getDetails(this.row)
+      // 控制效期单位后面的是否可填写
+      if (this.row.expiryDateManagerment == '0') {
+        this.isExp = false
+      } else {
+        this.isExp = true
+      }
+      // 控制业务部门是否能够填写
+      if (this.row.purchasingOrganization) {
+        this.orgControl = false
+      } else {
+        this.orgControl = true
+      }
+      // 控制医药属性是否能够填写
+      if (this.row.isMedicine == '0') {
+        this.isControl = false
+      } else {
+        this.isControl = true
+      }
+      // 生产厂家代理人用于回显
+      if (this.row.manufacturerId) {
+        this.getFactoryDetails(this.row.manufacturerId)
+      }
+      // 计量单位回显
+      if (this.row.unitId) {
+        this.getUnitDetails(this.row.unitId)
+      }
+      // 产地回显
+      if (this.row.originPlace) {
+        this.getPlaceDetails(this.row.originPlace)
+      }
+      // 物料税类回显
+      if (this.row.materialRate) {
+        this.getTaxDetails(this.row.materialRate)
+      }
+      // 物料税类回显
+      if (this.row.puPersonnelId) {
+        this.getStaffDetails(this.row.puPersonnelId)
+      }
+      // 业务线回显
+      if (this.row.businessLine) {
+        this.getLineDetails(this.row.businessLine)
+      }
+      // 中包装单位回显
+      if (this.row.mediumPackageUnitId) {
+        this.getMidPackDetails(this.row.mediumPackageUnitId)
+      }
+      // 内包装单位回显
+      if (this.row.innerPackingUnit) {
+        this.getInnerPackingUnitDetails(this.row.innerPackingUnit)
+      }
     }
   },
   methods: {
@@ -1164,7 +1216,36 @@ export default {
       getReqDetail(row.id).then(res => {
         console.log('res', res)
         if (res.code === 200) {
-          this.basicForm = res.data
+
+          this.basicForm = res.data;
+
+          if(this.pageStu === 'copy'){
+
+            this.basicForm.id = '';
+
+            this.basicForm.billCode = '';
+
+            this.basicForm.diCode = '';
+
+            this.basicForm.status = '0';
+
+            this.basicForm.sysMaterialMedcineApply.id = '';
+
+            this.basicForm.sysMaterialMedcineItemApply.length &&
+
+            this.basicForm.sysMaterialMedcineItemApply.forEach(item =>(item.id = ''));
+
+            this.basicForm.createName = '';
+
+            this.basicForm.createTime = '';
+
+            this.basicForm.updateName = '';
+
+            this.basicForm.updateTime = '';
+
+
+          }
+
           // 获取树形详情
           if (res.data.classifyId) {
             this.getTreeDetails(res.data.classifyId)
@@ -1196,8 +1277,8 @@ export default {
       })
     },
     save() {
-      let sparams = { ...this.basicForm, ...{ status: 0 } }
-      console.log(sparams, 'sparams');
+      // let sparams = { ...this.basicForm, ...{ status: 0 } }
+      // console.log(sparams, 'sparams');
       if (this.pageStu == 'edit') {
         if (!this.basicForm.proposerId) {
           this.basicForm.proposerId = this.$store.state.user.name
@@ -1228,13 +1309,17 @@ export default {
           })
         })
       } else {
+
         // alert('保存传status:0')
         if (!this.basicForm.proposerId) {
           this.basicForm.proposerId = this.$store.state.user.name
         }
-        let sparams = { ...this.basicForm, ...{ status: 0 } }
-        sparams.sysMaterialMedcineApply = this.basicForm2
-        sparams.sysMaterialMedcineItemApply = this.sysMaterialMedcineItemApply
+        let sparams = { ...this.basicForm, ...{ status: 0 } };
+
+        sparams.sysMaterialMedcineApply = this.basicForm2;
+
+        sparams.sysMaterialMedcineItemApply = this.sysMaterialMedcineItemApply;
+
         console.log('保存参数', sparams)
         const form1 = new Promise((resolve, reject) => {
           this.$refs['basic'].validate(valid => {

+ 24 - 2
src/views/material/requisition/index.vue

@@ -57,6 +57,9 @@
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+      </el-col>
       <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>导入</el-button>
       </el-col>
@@ -78,8 +81,9 @@
         fit
         max-height="680"
         @selection-change="handleSelectionChange"
+        @select="handleSelect"
       >
-        <!-- <el-table-column type="selection" width="55" /> -->
+      <el-table-column type="selection" width="45" ></el-table-column>
         <el-table-column label="序号" align="center" type="index" width="50"/>
         <el-table-column label="所属组织" align="center" width="200" prop="orgName" />
         <el-table-column label="单据编码" align="center" width="200" prop="billCode" />
@@ -157,7 +161,8 @@ export default {
       // 页面状态
       page: '',
       rowDetail: {},
-      disable: false
+      disable: false,
+      checkedList:[],
     }
   },
   created() {
@@ -180,6 +185,22 @@ export default {
       this.page = 'add'
       this.disable = false
     },
+    // 复制
+    handleCopy(){
+      this.isList = false;
+      this.isComponent = 'addReq';
+      this.page = 'copy';
+      this.rowDetail =  this.checkedList[0];
+      this.disable = false;
+    },
+    // Select框
+    handleSelect(selection, row) {
+
+      this.checkedList = selection;
+
+      console.log(this.checkedList, 'this.checkedList');
+
+    },
     getList(val) {
       console.log('val',val)
       getReqList(val).then(res => {
@@ -188,6 +209,7 @@ export default {
           this.total = res.total
         }
       })
+      this.checkedList = [];
     },
     // 表格内状态栏判断值
     statusJug(row) {

+ 52 - 4
src/views/purchase/DemandSummary/index.vue

@@ -375,7 +375,7 @@ import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getSummaryList, auditSummary, confirmSummary , cancelSummary , shutDownSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
+import {getSummaryList, auditSummary, confirmSummary , cancelSummary , shutDownSummary, editSummaryList, exportList, exportItems } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
   dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
@@ -577,7 +577,53 @@ export default {
       console.log('选中数组', this.ids.join())
     },
     handleCommand(command) {
-      alert(command)
+      if(command == 'Excel导出') {
+        if(this.allSelection.length == 0) {
+          this.$modal.msgWarning("请选中至少一条数据");
+        } else {
+          exportList(this.allSelection).then(res => {
+            const blob = new Blob([res], {
+              type: "application/vnd.ms-excel;charset=UTF-8",
+            });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+            const downloadElement = document.createElement("a"); //创建a标签
+            const href = window.URL.createObjectURL(blob); // 创建下载的链接
+            // var temp = res.headers["content-disposition"]; 
+            // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+            // var name = fileName.split(";")[0]; //切割成文件名
+            downloadElement.href = href;  //下载地址
+            downloadElement.download = '导出Excel'; // 下载后文件名
+            document.body.appendChild(downloadElement);
+            downloadElement.click(); // 点击下载
+            document.body.removeChild(downloadElement); // 下载完成移除元素
+            window.URL.revokeObjectURL(href); // 释放blob对象
+          })
+        }
+      }
+
+      if (command == '导出明细') {
+        if (this.allSelection.length == 0 || this.allSelection.length > 1) {
+          this.$modal.msgWarning("明细只能进行单条导出!");
+        } else {
+          let param = this.queryParams
+          param.sumFlag = this.allSelection[0].sumFlag
+          exportItems(param).then(res => {
+            const blob = new Blob([res], {
+              type: "application/vnd.ms-excel;charset=UTF-8",
+            });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+            const downloadElement = document.createElement("a"); //创建a标签
+            const href = window.URL.createObjectURL(blob); // 创建下载的链接
+            // var temp = res.headers["content-disposition"]; 
+            // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+            // var name = fileName.split(";")[0]; //切割成文件名
+            downloadElement.href = href;  //下载地址
+            downloadElement.download = '导出明细'; // 下载后文件名
+            document.body.appendChild(downloadElement);
+            downloadElement.click(); // 点击下载
+            document.body.removeChild(downloadElement); // 下载完成移除元素
+            window.URL.revokeObjectURL(href); // 释放blob对象
+          })
+        }
+      }
     },
     check(row) {
       this.isList = false
@@ -620,8 +666,10 @@ export default {
         this.$modal.msgWarning("请选中至少一条数据");
       } else {
         confirmSummary(this.allSelection).then(res => {
-          this.$modal.msgSuccess("确认成功");
-          this.getList(this.queryParams)
+          if (res.code === 200) {
+            this.$modal.msgSuccess("确认成功");
+            this.getList(this.queryParams)
+          }
         })
       }
     },

+ 6 - 6
src/views/purchase/PurchaseDemandList/add.vue

@@ -400,22 +400,22 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
+          <el-table-column show-overflow-tooltip label="补单供应商" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplier'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
-                <el-input clearable :disabled="sonDisable || BDZT" size="mini" v-model="scope.row.additionalSupplier" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplierName'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
+                <el-input clearable :disabled="sonDisable || BDZT" size="mini" v-model="scope.row.additionalSupplierName" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
                   <el-button size="mini" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
+          <!-- <el-table-column show-overflow-tooltip label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="mini" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <!-- <el-table-column show-overflow-tooltip label="周期单位" align="center"  prop="periodUnit" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -1100,7 +1100,7 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referCondition.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
         this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referCondition.title == '选择收货地址') {

+ 135 - 33
src/views/purchase/purchase-order/add/column.js

@@ -143,9 +143,30 @@ export const Columns = [
     isShow:true,
     disabled:true,
   },
-  { key: "money", title: "价税合计", inputType: "Input", isShow:true, disabled:true,},
-  { key: "originalMoney", title: "原始总金额", inputType: "Input",  isShow:true, disabled:true,},
-  { key: "notaxMoney", title: "无税金额", inputType: "Input",  isShow:true, disabled:true,},
+  { 
+    key: "money", 
+    title: "价税合计", 
+    inputType: "InputNumber",
+    controlsPosition: "right", 
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "originalMoney", 
+    title: "原始总金额", 
+    inputType: "InputNumber",
+    controlsPosition: "right", 
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "notaxMoney", 
+    title: "无税金额", 
+    inputType: "InputNumber",  
+    controlsPosition: "right",
+    isShow:true, 
+    disabled:true,
+  },
   {
     key: "status",
     title: "单据状态",
@@ -202,13 +223,15 @@ export const Columns = [
   { 
     key: "rebateMoney", 
     title: "订单使用返利金额", 
-    inputType: "Input",
+    inputType: "InputNumber",
+    controlsPosition: "right",
     isShow:true, 
   },
   { 
     key: "deductionMoney", 
     title: "订单抵扣余款金额", 
-    inputType: "Input",
+    inputType: "InputNumber",
+    controlsPosition: "right",
     isShow:true, 
   },
   { 
@@ -330,12 +353,25 @@ export const Columns = [
   { 
     key: "applyPaymentMoney", 
     title: "累计付款申请金额", 
-    inputType: "Input", 
+    inputType: "InputNumber", 
+    controlsPosition: "right",
     isShow:true,
     disabled:true,
   },
-  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", isShow:true,},
-  { key: "invoiceMoney", title: "发票金额", inputType: "Input",isShow:true, },
+  { 
+    key: "paymentMoney", 
+    title: "累计付款金额", 
+    inputType: "InputNumber", 
+    controlsPosition: "right",
+    isShow:true,
+  },
+  { 
+    key: "invoiceMoney", 
+    title: "发票金额", 
+    inputType: "InputNumber",
+    controlsPosition: "right",
+    isShow:true,
+   },
   {
     key: "supplierPersonalName",
     title: "供应商业务员",
@@ -597,28 +633,68 @@ export const TabColumns = [
       { 
         key: "taxPrice", 
         title: "含税单价", 
-        inputType: "Input",
+        inputType: "InputNumber",
+        controlsPosition: "right",
         require: true,
         disabled:true,
-        width: 120,
+        width: 180,
+       },
+      { 
+        key: "money", 
+        title: "价税合计", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
        },
-      { key: "money", title: "价税合计", inputType: "Input",disabled:true, },
       { //materialRate  materialRateName
         key: "tax", 
         title: "税率",
-        inputType: "Input",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
+      },
+      { 
+        key: "taxDeductMoneya", 
+        title: "折扣金额", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
+       },
+      { 
+        key: "arrivalQty",
+        title: "已到货数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
         disabled:true,
+        width: 180,
+      },
+      { 
+        key: "unarrivedQty", 
+        title: "未到货数量", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
       },
-      { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input",disabled:true, },
-      { key: "arrivalQty", title: "已到货数量", inputType: "Input", disabled:true,},
-      { key: "unarrivedQty", title: "未到货数量", inputType: "Input", disabled:true,},
       { 
         key: "price",
         title: "无税单价",
-        inputType: "Input",
+        inputType: "InputNumber",
+        controlsPosition: "right",
         disabled:true,
+        width: 180,
+      },
+      { 
+        key: "notaxMoney", 
+        title: "无税金额", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
       },
-      { key: "notaxMoney", title: "无税金额", inputType: "Input", disabled:true,},
       // { key: "priceSource", title: "价格目录ID", inputType: "Input", },
       { key: "isStorage", title: "入库关闭", inputType: "Checkbox", disabled:true, },
       { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", disabled:true, },
@@ -705,11 +781,31 @@ export const TabColumns = [
       { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
       { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
       { key: "isUrgency", title: "紧急标识", inputType: "Checkbox", },
-      { key: "originalQty", title: "原始数量", inputType: "Input", disabled:true,},
-      { key: "originalMoney", title: "原始金额", inputType: "Input", disabled:true,},
+      { 
+        key: "originalQty", 
+        title: "原始数量", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        disabled:true,
+        width: 180 ,
+      },
+      { 
+        key: "originalMoney", 
+        title: "原始金额", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
+      },
       { key: "directProductBatch", title: "直运产品批号", inputType: "Input", width: 180 },
       { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
-      { key: "reservedQty", title: "预留数量", inputType: "Input", },
+      { 
+        key: "reservedQty", 
+        title: "预留数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180 ,
+       },
       { key: "reservedPeriod", title: "预留周期", inputType: "Input", },
       { 
         key: "taxDeductClassify", 
@@ -821,44 +917,50 @@ export const TabColumns = [
         title: "数量",
         inputType: "InputNumber",
         controlsPosition: "right",
-        width: 120,
+        width: 180,
         require: true,
       },
       { 
         key: "stroageQty", 
         title: "累计到货主数量", 
-        inputType: "Input", 
-        width: 120 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
       },
       { 
         key: "stockQty", 
         title: "累计入库主数量", 
-        inputType: "Input", 
-        width: 120 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
       },
       { 
         key: "invoiceQty", 
         title: "累计开票主数量", 
-        inputType: "Input", 
-        width: 120 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
       },
       { 
         key: "rollbackQty", 
         title: "累计退货主数量", 
-        inputType: "Input", 
-        width: 120 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
       },
       { 
         key: "backStockQty", 
         title: "累计退库主数量", 
-        inputType: "Input", 
-        width: 120 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
       },
       { 
         key: "floatQty", 
         title: "未到货数量", 
-        inputType: "Input", 
-        width: 120 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
       },
       { 
         key: "createByName",