From 50538b42c86e69ba7d0de5fde2ad3d68779d9f77 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期五, 22 三月 2024 18:58:59 +0800 Subject: [PATCH] 采购订单添加到货确认与去质检 --- src/components/makepager/FilterPopover.vue | 150 +++++++++ src/api/purchaseManage/purchase.js | 40 ++ src/common/untils/request.js | 2 vue.config.js | 1 src/components/layout/components/appHeader/index.vue | 2 src/views/purchaseManage/purchase/index.vue | 83 ++++ src/api/data.js | 12 src/components/makepager/CommonFormTableView.vue | 35 ++ src/views/purchaseManage/purchase/components/TestingAll.vue | 335 ++++++++++++++++++++ src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue | 247 +++++++++++++++ 10 files changed, 890 insertions(+), 17 deletions(-) diff --git a/src/api/data.js b/src/api/data.js index 1909a6e..70f58ef 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -4,15 +4,21 @@ { id: 2, name: "寰呭叆搴�" }, { id: 3, name: "宸插叆搴�" }, { id: 4, name: "宸插畬鎴�" }, - { id: 5, name: "宸插彇娑�" } + { id: 5, name: "宸插彇娑�" }, + { id: 6, name: "寰呮敹璐�" }, + { id: 7, name: "閮ㄥ垎鏀惰揣" }, + { id: 8, name: "寰呰川妫�" }, ] // 鏀惰揣鐘舵�� const receiveStatus = [ { id: 1, name: "寰呯‘璁�" }, { id: 2, name: "寰呭叆搴�" }, - { id: 3, name: "灏辩华" }, + { id: 3, name: "宸插叆搴�" }, { id: 4, name: "宸插畬鎴�" }, - { id: 5, name: "宸插彇娑�" } + { id: 5, name: "宸插彇娑�" }, + { id: 6, name: "寰呮敹璐�" }, + { id: 7, name: "閮ㄥ垎鏀惰揣" }, + { id: 8, name: "寰呰川妫�" }, ] // 璐ㄦ鍗曠姸鎬� const qualityStatus = [ diff --git a/src/api/purchaseManage/purchase.js b/src/api/purchaseManage/purchase.js index 37a8b1e..6e1941b 100644 --- a/src/api/purchaseManage/purchase.js +++ b/src/api/purchaseManage/purchase.js @@ -102,6 +102,14 @@ data }) } +// 纭閲囪喘鍗� +export function newSubmitPurchase(data) { + return request({ + url: "/api/purchase/newSubmit/"+data, + method: "get", + data + }) +} // 鏂板缓閲囪喘绫诲瀷 export function savePurchaseType(data) { return request({ @@ -139,3 +147,35 @@ data }) } +// 鑾峰彇纭鍒楄〃淇℃伅 +export function getPurchaseProductConfirmInfo(data) { + return request({ + url: "/api/purchase/getPurchaseProductConfirmInfo/" + data, + method: "get", + data + }) +} +// 纭鏀惰揣 +export function savePurchaseProductConfirm(data) { + return request({ + url: "/api/purchase/savePurchaseProductConfirm", + method: "post", + data + }) +} +// 鑾峰彇璐ㄦ鍒楄〃淇℃伅 +export function getPurchaseQualityInspectionInfo(data) { + return request({ + url: "/api/purchase/getPurchaseQualityInspectionInfo", + method: "post", + data + }) +} +// 鎵归噺鍚堟牸鍏ュ簱 +export function savePurchaseQualityInspectionInfo(data) { + return request({ + url: "/api/purchase/savePurchaseQualityInspectionInfo", + method: "post", + data + }) +} diff --git a/src/common/untils/request.js b/src/common/untils/request.js index 1c10074..9b3a551 100644 --- a/src/common/untils/request.js +++ b/src/common/untils/request.js @@ -28,7 +28,7 @@ const loginPathMap = { prod:`//${window.location.hostname}:9080`, test:`//192.168.20.119:9080`, - dev: `//192.168.8.107:8080` + dev: `//192.168.20.158:8080` } return loginPathMap[environmentType()] } diff --git a/src/components/layout/components/appHeader/index.vue b/src/components/layout/components/appHeader/index.vue index 038b472..51bd45b 100644 --- a/src/components/layout/components/appHeader/index.vue +++ b/src/components/layout/components/appHeader/index.vue @@ -71,7 +71,7 @@ prod: `//${window.location.hostname}:9080`, test: `//192.168.20.119:9080`, // 鎯宠烦鍒版湰鍦板惎鍔ㄧ殑鐧诲綍椤电殑璇濋渶瑕佹妸dev鏀规垚浣犳湰鍦伴」鐩矾寰� - dev: `//192.168.8.107:8080` + dev: `//192.168.20.158:8080` } return loginPathMap[this.environmentType()] }, diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue index 145cd11..822b967 100644 --- a/src/components/makepager/CommonFormTableView.vue +++ b/src/components/makepager/CommonFormTableView.vue @@ -3,6 +3,7 @@ <el-form ref="form" :model="tableList" :show-message="false" label-position="right"> <el-table ref="fromTable" + :border="isBoder" :data="tableList.tableData" :show-summary="showSummary.show" :summary-method="getSummaries" @@ -11,7 +12,8 @@ @selection-change="handleSelectionChange" :row-key="(row) => row.productId" > - <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center"> + <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center"> + </el-table-column> <el-table-column v-if="tableList.isReturn" type="index" label="#" width="50" align="center"></el-table-column> <el-table-column @@ -27,10 +29,14 @@ <template slot="header"> <span v-if="item.isRequird" style="color: #f56c6c">*</span> <span>{{ item.label }}</span> + <FilterPopover @toFiltering="toFiltering" class="margin_left_3px" v-if="item.isFilter" + :layout="item.prop" :isFilterList="item.isFilterList" + :selectedListDefault="item.selectedListDefault"></FilterPopover> </template> <!-- column鏍峰紡 --> <template slot-scope="scope"> <template v-if="!detailEnter || isOperate"> + <el-form-item v-if="item.input" label=" " @@ -49,6 +55,8 @@ " ></el-input> </el-form-item> + <span v-else-if="item.compute">{{ calculateDifference(scope.row) }}</span> + <el-form-item v-else-if="item.productName" label=" " @@ -173,9 +181,14 @@ " ></el-input-number> </el-form-item> - <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> + <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> + </template> + <!-- <template slot-scope="scope" v-if="item.compute"> + </template> --> </el-table-column> + <!-- <el-table-column label="鍓╀綑鏀惰揣鏁伴噺"> + </el-table-column> --> <el-table-column label="鎿嶄綔" width="40" v-if="!detailEnter" align="center"> <template slot-scope="scope"> <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">鍒犻櫎</el-button> @@ -217,11 +230,16 @@ <script> import { getProductListFromGrpc, getProductList } from "@/api/productManage/product" import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" +import FilterPopover from "@/components/makepager/FilterPopover"; export default { name: "CommmonFormTableView", - components: { SelectCommonDialog }, + components: { SelectCommonDialog ,FilterPopover}, props: { detailEnter: { + type: Boolean, + default: false + }, + isBoder:{ type: Boolean, default: false }, @@ -309,6 +327,17 @@ }, computed: {}, methods: { + calculateDifference(row) { + if (row.notReceiveAmount !== null && row.nowReceiveAmount !== null) { + row.surplusReceiveAmount=row.notReceiveAmount - row.nowReceiveAmount; + return row.surplusReceiveAmount + } else { + return 0; + } + }, + toFiltering(event){ + this.$emit("toFiltering", event); + }, getTableInfo() { this.tableList = this.productTableList }, diff --git a/src/components/makepager/FilterPopover.vue b/src/components/makepager/FilterPopover.vue new file mode 100644 index 0000000..78937d2 --- /dev/null +++ b/src/components/makepager/FilterPopover.vue @@ -0,0 +1,150 @@ +<template> + <span class="filter-popover"> + <el-popover + ref="popoverRef" + placement="bottom" + :width="popoverWidth" + trigger="click" + v-model="popoverVisible" + > + <!--澶氶��--> + <div class="popover-content"> + <el-checkbox + v-if="isFilterList.length" + v-model="checkAll" + :indeterminate="isIndeterminate" + @change="toSelectedAllList" + >鍏ㄩ��</el-checkbox> + <el-checkbox-group + v-if="isFilterList.length" + v-model="selectedList" + @change="toSelectedList" + > + <el-checkbox + v-for="item in isFilterList" + :key="item.name" + :label="item.id" + >{{ item.name }}</el-checkbox> + </el-checkbox-group> + </div> + <div class="btn"> + <el-button size="mini" @click.stop="btnReset">閲嶇疆</el-button> + <el-button size="mini" type="primary" @click.stop="toFiltering">纭畾</el-button> + </div> + <svg slot="reference" class="filter-icon icon" t="1711007988136" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4239" width="200" height="200"><path d="M855.342766 151.46262c-6.056949-11.851932-18.984377-19.393699-33.219589-19.393699L101.903901 132.068921c-14.360056 0-27.412326 7.704472-33.396621 19.744693-5.988388 12.015661-3.845585 26.157753 5.520737 36.192294l255.896134 274.308483 0 309.339324c0 12.847609 7.895831 24.602328 20.389376 30.328749l189.116195 86.432535c5.154393 2.371 10.771321 3.515057 16.33913 3.515057 6.541997 0 13.090133-1.607614 18.926048-4.797259 10.718109-5.945409 17.427928-16.503882 17.809621-28.037567l12.957103-396.767536 245.078765-274.90507C859.543438 177.316451 861.425298 163.313529 855.342766 151.46262zM520.773827 804.275693l-117.384477-53.647851L403.38935 483.628836l127.858016 0L520.773827 804.275693zM550.774095 416.986019c-1.963725-0.299829-3.761674-1.090844-5.809309-1.090844L383.519814 415.895175 181.938726 199.803605l562.427506 0L550.774095 416.986019zM685.454494 524.008498l273.392624 0 0 59.759035-273.392624 0 0-59.759035ZM685.454494 654.104485l273.392624 0 0 59.759035-273.392624 0 0-59.759035ZM685.454494 773.618463l273.392624 0 0 59.759035-273.392624 0 0-59.759035Z" fill="#272636" p-id="4240"></path></svg> + </el-popover> + </span> +</template> + +<script> +export default { + name: "PagerView", + props: { + isFilterList: { + type: Array, + default: () => [], + }, + layout:{ + type:[Number,String], + default:'' + }, + popoverWidth:{ + type:[Number,String], + default:100 + }, + //榛樿鍊� + selectedListDefault: { + type: [Array, String, Number], + default: null + }, + }, + data() { + return { + // 澶氶�夋涓叏閫夋閫変腑涓庡惁鐨勬爣璇� + checkAll: false, + // 琛ㄧず checkbox 鐨勪笉纭畾鐘舵�侊紝涓�鑸敤浜庡疄鐜板叏閫夌殑鏁堟灉 + isIndeterminate: false, + // 绛涢�夊脊绐楀閫夊垪琛ㄩ�変腑鏁版嵁 + selectedList: [], + popoverVisible:false, + }; + }, + mounted() { + this.selectedList = this.selectedListDefault + this.toSelectedList() + }, + watch:{ + selectedListDefault(){ + this.selectedList = this.selectedListDefault + this.toSelectedList() + } + }, + methods: { + // 澶氶�夋鍏ㄩ�夋搷浣� + toSelectedAllList(val) { + this.selectedList = val ? this.isFilterList.map(s => s.id) : [] + if(val){ + this.checkAll = true + }else{ + this.checkAll = false + } + this.isIndeterminate = false + }, + // 澶氶�夋閫夋嫨鎿嶄綔 + toSelectedList() { + if (this.selectedList.length == 0) { + this.checkAll = false + this.isIndeterminate = false + } else if(this.selectedList.length == this.isFilterList.length){ + this.checkAll = true + this.isIndeterminate = false + } else { + this.isIndeterminate = true + this.checkAll = false + } + }, + //閲嶇疆 + btnReset() { + // 绉婚櫎澶氶�夋鐨勫叏閫夌姸鎬� + this.checkAll = false + this.isIndeterminate = false + this.selectedList =[] + this.popoverVisible=false; + this.$emit('toFiltering', { + filterVal: this.selectedList||[], + layout: this.layout || '' + }) + }, + // 纭畾绛涢�� + toFiltering() { + this.popoverVisible=false; + this.$emit('toFiltering', { + filterVal: this.selectedList||[], + layout: this.layout || '' + }) + } + }, +}; +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped> +.filter-popover{ + width:17px; + height:17px; + margin:0; + margin-top:3px; + float:right; + display:inline-block; + .filter-icon{ + width:17px; + height:17px; + display:inline-block; + } +} +.popover-content{ + max-height:130px; + margin-bottom:5px; + overflow-y:auto; +} +</style> diff --git a/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue b/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue new file mode 100644 index 0000000..e2698a9 --- /dev/null +++ b/src/views/purchaseManage/purchase/components/ArrivalConfirmation.vue @@ -0,0 +1,247 @@ +<template> + <div class="add-quotation"> + <el-dialog title="鍒拌揣纭" :visible.sync="editConfig.visible" width="50%" :before-close="handleClose" append-to-body + custom-class="iframe-dialog"> + <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini" + style="height: 60vh; overflow-x: hidden"> + <!-- 淇℃伅 --> + <div class="basic-info"> + <div class="product-view"> + <CommonFormTableView :isBoder="true" :detailEnter="true" :recalculateShow="false" :addTypeIdMultiple="true" + :product-table-list="productTableList" sign="purchase" @rowClick="rowClick" /> + </div> + <!-- <div class="btn-box"> + </div> --> + </div> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button size="small" v-if="this.editConfig.title != '鏌ョ湅'" @click="editConfig.visible = false">鍙栨秷</el-button> + <el-button type="primary" size="small" + @click="saveClick('form')">纭鏀惰揣</el-button> + <!-- <el-button type="primary" size="small" + @click="saveOkClickAll('form')">鍏ㄩ儴鍚堟牸鍏ュ簱</el-button> --> + </div> + </el-dialog> + </div> +</template> + +<script> +import { + getPurchaseProductConfirmInfo, + savePurchaseProductConfirm +} from "@/api/purchaseManage/purchase" +import CommonFormTableView from "@/components/makepager/CommonFormTableView" +export default { + name: "ArrivalConfirmation", + components: { CommonFormTableView }, + props: { + editCommonConfig: { + type: Object, + default: () => { + return { + visible: false, + infomation: {} + } + } + } + }, + data() { + return { + editConfig: this.editCommonConfig, + productTableList: {}, + editSelectSupplierConfig: { + editVisible: false, + title: "", + infomation: {} + }, + tableData: [], + productIndex: 0, + productId: "", + isNoProduct: true, + clientList: [], + plcBrandList: [], + editRow: { + isDefault: "pin" + }, + total: 0, + totalTwo: 0, + productListIdx: 0, + lacks: [], + pickerOptions: { + disabledDate(time) { + return time.getTime() < Date.now() - 8.64e7 + } + }, + pickerOptionsBefore: { + disabledDate(time) { + return time.getTime() > Date.now() + } + }, + receiveWhouseList: [] // 鏀惰揣浠撳簱鍒楄〃 + } + }, + created() { + this.setTableForm() + this.getPurchaseProductConfirmInfo(this.editConfig.infomation.number) + }, + computed: { + // calculateDifference() { + // return this.productTableList.tableData.map(row => ({ + // ...row, + // surplusReceiveAmount: row.notReceiveAmount - row.nowReceiveAmount + // })); + // } + }, + watch: { + "editCommonConfig.visible": { + immediate: true, + handler: function () { + } + } + }, + methods: { + // 纭鏀惰揣 + async saveClick() { + let pipeline=false // 鏄惁鏈夊ぇ浜�0鐨勬敹璐ф暟閲� + // let rule1=false // 鏈鏀惰揣鏄惁澶т簬鏈敹璐ф暟閲� + let arr=[] + this.productTableList.tableData.map((item)=>{ + if(item.nowReceiveAmount>0&&item.nowReceiveAmount<=item.notReceiveAmount){ + pipeline=true + arr.push(item) + } + }) + if(pipeline){ + await savePurchaseProductConfirm(arr).then((res)=>{ + if(res.code===200){ + this.editConfig.visible=false + this.$parent.getData() + this.$message.success("纭鏀惰揣鎴愬姛锛�") + } + }) + }else{ + this.$message.warning("鏈鏀惰揣鏁伴噺涓嶈兘涓�0涓斾笉鑳借秴鍑烘湭鏀惰揣鏁伴噺 ") + } + }, + // 鍏ㄩ儴鍚堟牸鍏ュ簱 + saveOkClickAll(){ + + }, + saveParams() { + let data = JSON.parse(JSON.stringify(this.editConfig.infomation)) + + let params = { + productList: this.tableData, + purchase: { + } + } + if (data.id) { + params.purchase.id = data.id + } + return params + }, + handleClose() { + this.editConfig.visible = false + }, + setTableForm() { + this.productTableList = { + tableProductList: [], + tableData: this.tableData, + disabled: this.editConfig.isDisabled, + isReturn: true, + tableColumn: [ + { label: "浜у搧鍚嶇О", prop: "productName" }, + { label: "浜у搧缂栧彿", prop: "productId" }, + { label: "閲囪喘鏁伴噺", prop: "amount" }, + { label: "宸叉敹璐ф暟閲�", prop: "overReceiveAmount" }, + { label: "鏈敹璐ф暟閲�", prop: "notReceiveAmount" }, + { + label: "鏈鏀惰揣鏁伴噺", + prop: "nowReceiveAmount", + inputFloat: true, + isRequird: true, + }, + { label: "鍓╀綑鏀惰揣鏁伴噺", prop: "surplusReceiveAmount",compute:true} + ] + } + this.toal = this.editConfig.infomation.realTotalPrice + }, + //閫夋嫨琛� + rowClick(row) { + console.log(row, "xuanze") + this.productListIdx = row.productIndex + }, + // 鍒拌揣纭鍒楄〃 + getPurchaseProductConfirmInfo(params){ + getPurchaseProductConfirmInfo(params).then((res)=>{ + console.log(res,"res9") + this.productTableList.tableData=res.data + }) + }, + // 鍓╀綑鏀惰揣璁$畻 + calculateDifference(row) { + if (row.col1 !== null && row.col2 !== null) { + return row.col1 - row.col2; + } else { + return 0; // 鎴栬�呰繑鍥炰綘鎯宠鐨勯粯璁ゅ�� + } + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped> +.table-bottom { + width: 500px; + float: right; + margin-right: 20px; + margin-top: 10px; + height: auto; + line-height: 30px; + font-size: 14px; + font-weight: 700; + margin-bottom: 20px; + color: #333; + + .table-bottom-item { + width: 100%; + text-align: right; + + .table-bottom-l { + width: 250px; + float: left; + } + + .table-bottom-r { + width: calc(100% - 250px); + float: right; + } + } +} + +::v-deep { + .iframe-dialog .el-dialog__body { + .basic-info { + overflow: hidden; + margin-top: 20px; + } + } + .el-dialog__header,.el-dialog__body,.el-dialog__footer{ + padding: 0 20px; + } + .el-dialog__header{ + height: 50px; + line-height: 50px; + } + .dialog-footer { + text-align: right !important; + } + .el-table tr { + background-color: #fff; + } + .el-table th.el-table__cell.is-leaf{ + background-color: #F1F3F8 !important; + } +} +</style> diff --git a/src/views/purchaseManage/purchase/components/TestingAll.vue b/src/views/purchaseManage/purchase/components/TestingAll.vue new file mode 100644 index 0000000..07208f3 --- /dev/null +++ b/src/views/purchaseManage/purchase/components/TestingAll.vue @@ -0,0 +1,335 @@ +<template> + <div class="add-quotation"> + <el-dialog :visible.sync="editConfig.visible" width="70%" append-to-body custom-class="iframe-dialog"> + <el-header> + <el-button type="primary" v-if="this.editConfig.title != '鏌ョ湅'" size="small" + @click="saveClick()">鎵归噺鍚堟牸鍏ュ簱</el-button> + <el-button type="primary" v-if="this.editConfig.title != '鏌ョ湅'" size="small" + @click="saveNoClick()">鎵归噺涓嶅悎鏍�</el-button> + </el-header> + <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini" + style="height: 60vh; overflow-x: hidden"> + <div class="basic-info"> + <div class="product-view"> + <CommonFormTableView :isBoder="true" :selectBox="true" :detailEnter="true" :recalculateShow="false" + :addTypeIdMultiple="true" :product-table-list="productTableList" sign="purchase" @rowClick="rowClick" + @getSelectArray="getSelectArray" @toFiltering="toFiltering"> + + <template slot="tableButton"> + <el-table-column label="鎿嶄綔" width="120" align="center"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="saveClick(scope.row)" + style="margin-right: 5px">鍚堟牸</el-button> + <el-button type="text" size="small" @click="saveNoClick(scope.row)" + style="margin-right: 5px">涓嶅悎鏍�</el-button> + </template> + </el-table-column> + </template> + </CommonFormTableView> + </div> + </div> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button size="small" @click="editConfig.visible = false">鍏抽棴</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { + getPurchaseQualityInspectionInfo, + savePurchaseQualityInspectionInfo +} from "@/api/purchaseManage/purchase" +import CommonFormTableView from "@/components/makepager/CommonFormTableView" +export default { + name: "ArrivalConfirmation", + components: { CommonFormTableView }, + props: { + editCommonConfig: { + type: Object, + default: () => { + return { + visible: false, + infomation: {} + } + } + } + }, + data() { + return { + editConfig: this.editCommonConfig, + productTableList: {}, + editSelectSupplierConfig: { + editVisible: false, + title: "", + infomation: {} + }, + tableData: [], + productIndex: 0, + productId: "", + isNoProduct: true, + clientList: [], + plcBrandList: [], + editRow: { + isDefault: "pin" + }, + total: 0, + totalTwo: 0, + productListIdx: 0, + lacks: [], + pickerOptions: { + disabledDate(time) { + return time.getTime() < Date.now() - 8.64e7 + } + }, + pickerOptionsBefore: { + disabledDate(time) { + return time.getTime() > Date.now() + } + }, + receiveWhouseList: [], // 鏀惰揣浠撳簱鍒楄〃 + timeList: [], + statusList: [ + { id: 7, name: "閮ㄥ垎鏀惰揣" }, + { id: 8, name: "寰呰川妫�" } + ], + thatStatus: [], + thatTimes: [], + selectList: [] + } + }, + created() { + this.setTableForm() + this.getPurchaseQualityInspectionInfo({ + purchaseNumber: this.editConfig.infomation.number, + status: this.thatStatus, + times: this.thatTimes + }) + }, + computed: { + + }, + watch: { + "editCommonConfig.visible": { + immediate: true, + handler: function () { + } + } + }, + methods: { + // 鍚堟牸鍏ュ簱 + saveClick(row) { + if (row) { + this.savePurchaseQualityInspectionInfo({ + purchaseId: Number(this.editConfig.infomation.id), + ids: [Number(row.id)], + status: 2, + }) + + } else { + this.savePurchaseQualityInspectionInfo({ + purchaseId: Number(this.editConfig.infomation.id), + ids: this.selectList, + status: 2, + }) + } + }, + // 涓嶅悎鏍� + saveNoClick(row){ + if (row) { + this.savePurchaseQualityInspectionInfo({ + purchaseId: Number(this.editConfig.infomation.id), + ids: [Number(row.id)], + status: 3, + }) + + } else { + this.savePurchaseQualityInspectionInfo({ + purchaseId: Number(this.editConfig.infomation.id), + ids: this.selectList, + status: 3, + }) + } + }, + async savePurchaseQualityInspectionInfo(params) { + await savePurchaseQualityInspectionInfo(params).then((res) => { + if (res.code === 200) { + this.editConfig.visible = false + if(params.status===2){ + this.$message.success("璐ㄦ鍚堟牸!") + }else if(params.status===3){ + this.$message.success("宸茶缃负涓嶅悎鏍�!") + + } + this.$parent.getData() + } + }) + }, + handleClose() { + this.editConfig.visible = false + }, + setTableForm() { + this.productTableList = { + tableProductList: [], + tableData: this.tableData, + disabled: this.editConfig.isDisabled, + isReturn: true, + tableColumn: [ + { + label: "鏀惰揣鏃堕棿", prop: "createTime", + isFilter: true, + isFilterList: this.timeList, + selectedListDefault: this.getSelectedOperateStatus([], this.timeList), + }, + { label: "鏀惰揣浜�", prop: "principal" }, + { label: "浜у搧鍚嶇О", prop: "productName" }, + { label: "浜у搧缂栫爜", prop: "productId" }, + { label: "瑙勬牸", prop: "specs" }, + { label: "鏁伴噺", prop: "amount" }, + { label: "鍗曚綅", prop: "unit" }, + { + label: "鐘舵��", prop: "status", + isFilter: true, + isFilterList: this.statusList, + selectedListDefault: this.getSelectedOperateStatus([], this.statusList), + }, + ] + } + this.toal = this.editConfig.infomation.realTotalPrice + }, + //閫夋嫨琛� + rowClick(row) { + console.log(row, "xuanze") + this.productListIdx = row.productIndex + }, + // 澶氶�夋 + getSelectArray(val) { + console.log(val, "val") + this.selectList = [] + val.map((item) => { + this.selectList.push(Number(item.id)) + }) + }, + // 鑾峰彇璐ㄦ鍒楄〃淇℃伅 + async getPurchaseQualityInspectionInfo(params) { + await getPurchaseQualityInspectionInfo(params).then((res) => { + this.timeList = [] + res.data.map((item) => { + this.timeList.push({ id: item.createTime, name: item.createTime }) + }) + this.setTableForm() + this.productTableList.tableData = res.data + }) + }, + // 琛ㄥご绛涢�夐」鍒楄〃 + getSelectedOperateStatus(selectArr, allArr) { + let arr = selectArr + if (selectArr.length == 0) { + arr = [] + for (let i in allArr) { + arr.push(allArr[i].id) + } + } else { + arr = [selectArr.join(',')] + } + console.log(arr, "arr") + return arr; + }, + // 琛ㄥご绛涢�変簨浠� + async toFiltering(obj) { + console.log(obj, "obj") + if (obj.layout == 'createTime') { + this.thatTimes = obj.filterVal + } else if (obj.layout == 'status') { + this.thatStatus = obj.filterVal + } + await getPurchaseQualityInspectionInfo({ + purchaseNumber: this.editConfig.infomation.number, + status: this.thatStatus, + times: this.thatTimes + }).then((res) => { + this.timeList = [] + res.data.map((item) => { + this.timeList.push({ id: item.createTime, name: item.createTime }) + }) + this.productTableList.tableData = res.data + }) + + }, + // 鍚堟牸 + trueClick(row) { + console.log(row, "row") + + }, + falseClick(row) { + console.log(row, "row") + + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped> +.table-bottom { + width: 500px; + float: right; + margin-right: 20px; + margin-top: 10px; + height: auto; + line-height: 30px; + font-size: 14px; + font-weight: 700; + margin-bottom: 20px; + color: #333; + + .table-bottom-item { + width: 100%; + text-align: right; + + .table-bottom-l { + width: 250px; + float: left; + } + + .table-bottom-r { + width: calc(100% - 250px); + float: right; + } + } +} + +::v-deep { + .iframe-dialog .el-dialog__body { + padding: 0px 20px; + + .basic-info { + overflow: hidden; + } + } + + .el-header { + padding: 0; + height: 50px; + line-height: 50px; + } + + .el-dialog__header { + display: none; + } + + .dialog-footer { + text-align: right !important; + padding: 0px 20px; + } + + .el-table tr { + background-color: #fff; + } + + .el-table th.el-table__cell.is-leaf { + background-color: #F1F3F8 !important; + } +} +</style> diff --git a/src/views/purchaseManage/purchase/index.vue b/src/views/purchaseManage/purchase/index.vue index 2283fa2..f052302 100644 --- a/src/views/purchaseManage/purchase/index.vue +++ b/src/views/purchaseManage/purchase/index.vue @@ -53,12 +53,13 @@ <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" >鏌ョ湅</el-button > - <!-- <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" + <el-button + v-if="scope.row.status === 6||scope.row.status === 7" type="text" size="small" @click="confirmation(scope.row)" style="margin-right: 5px" >鍒拌揣纭</el-button > - <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" + <el-button v-if="scope.row.status === 7||scope.row.status === 8" type="text" size="small" @click="TestingAllClick(scope.row)" style="margin-right: 5px" >鍘昏川妫�</el-button - > --> + > <el-button v-if="scope.row.status === 1" type="text" @@ -102,6 +103,16 @@ > 鏀惰揣淇℃伅 </div> + <div + class="tab-pane" + @click="getTab(2)" + :style="{ + background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8', + color: TabsIndex == 2 ? '#fff' : '#666' + }" + > + 鍏ュ簱淇℃伅 + </div> </div> <div class="list-view"> <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol"> @@ -123,6 +134,10 @@ <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" /> <!-- 鏂板缓/缂栬緫 --> <AddPurchase ref="addDialog" v-if="editConfig.visible" :edit-common-config="editConfig" /> + <!-- 鍒拌揣閫氱煡 --> + <ArrivalConfirmation v-if="editAffirmConfig.visible" :edit-common-config="editAffirmConfig" /> + <!-- 鎵归噺璐ㄦ --> + <TestingAll v-if="editTestingAllConfig.visible" :edit-common-config="editTestingAllConfig" /> </div> </template> @@ -131,18 +146,20 @@ import { getPurchaseList, getPurchaseInfo, - submitPurchase, + newSubmitPurchase, deletePurchase, getOperationInfo } from "@/api/purchaseManage/purchase" import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier" import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase" +import ArrivalConfirmation from"@/views/purchaseManage/purchase/components/ArrivalConfirmation" +import TestingAll from"@/views/purchaseManage/purchase/components/TestingAll" import { getSupplierList } from "@/api/supplierManage/supplier" import { getDataByType } from "@/api/data" export default { name: "SupplierManage", props: {}, - components: { DetailSupplier, AddPurchase }, + components: { DetailSupplier, AddPurchase,ArrivalConfirmation,TestingAll }, mixins: [pageMixin], computed: {}, data() { @@ -161,6 +178,17 @@ ] // 鏀惰揣淇℃伅 const recriveColumn = [ + { label: "鏀惰揣鏃堕棿", prop: "operationNumber", default: true }, + { label: "鏀惰揣浜�", prop: "principal" }, + { label: "浜у搧鍚嶇О", prop: "name" }, + { label: "浜у搧缂栫爜", prop: "number" }, + { label: "瑙勬牸", prop: "warehouseName" }, + { label: "鏁伴噺", prop: "amount" }, + { label: "鍗曚綅", prop: "overTime" }, + { label: "鐘舵��", prop: "status", isCallMethod: true, getCallMethod: this.getreceiveStatusStatus } + ] + // 鍏ュ簱淇℃伅 + const inLibraryColumn = [ { label: "鍏ュ簱鍗曞彿", prop: "operationNumber", default: true }, { label: "鏀惰揣浠撳簱", prop: "warehouseName" }, { label: "浜у搧鍚嶇О", prop: "name" }, @@ -189,6 +217,23 @@ detailEnter: false, infomation: { supplierList: [] + } + }, + editAffirmConfig: { + visible: false, + isDisabled: false, + detailEnter: false, + infomation: { + + // supplierList: [] + } + }, + editTestingAllConfig:{ + visible: false, + isDisabled: false, + detailEnter: false, + infomation: { + } }, tableColumn: [ @@ -222,7 +267,10 @@ ], // 鏀惰揣淇℃伅 recriveColumn: recriveColumn, - showReceiveCol: ["鍏ュ簱鍗曞彿", "鏀惰揣浠撳簱", "浜у搧鍚嶇О", "浜у搧缂栫爜", "鏁伴噺", "鍏ュ簱鏃堕棿", "鏀惰揣浜�", "鐘舵��"], + // 鍏ュ簱淇℃伅 + inLibraryColumn:inLibraryColumn, + showReceiveCol: ["鏀惰揣鏃堕棿", "鏀惰揣浜�", "浜у搧鍚嶇О", "浜у搧缂栫爜", "瑙勬牸", "鏁伴噺", "鍗曚綅", "鐘舵��"], + inLibraryCol: ["鍏ュ簱鍗曞彿", "鏀惰揣浠撳簱", "浜у搧鍚嶇О", "浜у搧缂栫爜", "鏁伴噺", "鍏ュ簱鏃堕棿", "鏀惰揣浜�", "鐘舵��"], loading: false, selectRow: {} } @@ -425,7 +473,7 @@ if (!row.supplierName) { this.btnEdit(row) } else { - submitPurchase({ id: Number(row.id), status: 2 }).then((response) => { + newSubmitPurchase(row.id).then((response) => { if (response.code === 200) { this.$message.success("鎻愪氦鎴愬姛") this.getData() @@ -448,7 +496,7 @@ type: "warning" }).then( () => { - submitPurchase({ id: Number(row.id), status: 5 }).then((response) => { + newSubmitPurchase(Number(row.id)).then((response) => { if (response.code === 200) { this.$message.success("宸插彇娑�") this.getData() @@ -508,6 +556,17 @@ setTimeout(() => { this.tableLoading = false }, 3000) + }, + // 鍒拌揣纭 + confirmation(row){ + console.log(row,"row") + this.editAffirmConfig.infomation=row + this.editAffirmConfig.visible=true + }, + // 鍘昏川妫� + TestingAllClick(row){ + this.editTestingAllConfig.infomation=row + this.editTestingAllConfig.visible=true }, // 璇︽儏 selCommonClick(row) { @@ -592,11 +651,17 @@ this.showBottomCol = this.showReceiveCol this.setBottomList() this.getProductInventoryInfo(this.selectRow) + } else if (this.TabsIndex == 2) { + // 鍏ュ簱淇℃伅鍒楄〃 + this.tableBottomColumn = this.inLibraryColumn + this.showBottomCol = this.inLibraryCol + this.setBottomList() + this.getProductInventoryInfo(this.selectRow) } }, // 鐘舵�� getStatus(val) { - return val === 1 ? "寰呯‘璁�" : val === 2 ? "寰呭嚭搴�" : val === 3 ? "鍑哄簱瀹屾垚" : val === 4 ? "宸插叧闂�" : "--" + return val === 1 ? "寰呯‘璁�" : val === 2 ? "寰呭叆搴�" : val === 3 ? "宸插叆搴�" : val === 4 ? "宸插畬鎴�" : val === 5 ? "宸插彇娑�" :val === 6 ? "寰呮敹璐�" :val === 7 ? "閮ㄥ垎鏀惰揣" :val === 8 ? "寰呰川妫�" : "--" }, // 鑾峰彇浜у搧/鏀惰揣淇℃伅 async getProductInventoryInfo(row) { diff --git a/vue.config.js b/vue.config.js index d8343db..34f3333 100644 --- a/vue.config.js +++ b/vue.config.js @@ -22,6 +22,7 @@ // target: "http://192.168.20.118:8889", // http://192.168.20.119:8002 http://fai365.com:30150/ // target: "http://192.168.20.120:8004", + // target: "http://192.168.20.119:8004", // http://192.168.20.119:8004 http://fai365.com:30150/ target: "http://192.168.20.119:8004", // http://192.168.20.119:8004 http://fai365.com:30150/ ws: true, changeOrigin: true -- Gitblit v1.8.0