| | |
| | | outline: 0; |
| | | } |
| | | // 间距 |
| | | .margin_left_3px{ |
| | | margin-left:3px; |
| | | .margin_left_3px { |
| | | margin-left: 3px; |
| | | } |
| | | .margin_left_5px{ |
| | | margin-left:5px; |
| | | .margin_left_5px { |
| | | margin-left: 5px; |
| | | } |
| | | .margin_left_10px{ |
| | | margin-left:10px; |
| | | .margin_left_10px { |
| | | margin-left: 10px; |
| | | } |
| | | .margin_left_15px{ |
| | | margin-left:15px; |
| | | .margin_left_15px { |
| | | margin-left: 15px; |
| | | } |
| | | .margin_left_20px{ |
| | | margin-left:20px; |
| | | .margin_left_20px { |
| | | margin-left: 20px; |
| | | } |
| | | .margin_right_5px{ |
| | | margin-right:5px; |
| | | .margin_right_5px { |
| | | margin-right: 5px; |
| | | } |
| | | .margin_right_10px{ |
| | | margin-right:10px; |
| | | .margin_right_10px { |
| | | margin-right: 10px; |
| | | } |
| | | .margin_right_15px{ |
| | | margin-right:15px!important; |
| | | .margin_right_15px { |
| | | margin-right: 15px !important; |
| | | } |
| | | .margin_right_20px{ |
| | | margin-right:20px; |
| | | .margin_right_20px { |
| | | margin-right: 20px; |
| | | } |
| | | .margin_right_40px{ |
| | | margin-right:40px; |
| | | .margin_right_40px { |
| | | margin-right: 40px; |
| | | } |
| | | .margin_top_10px{ |
| | | margin-top:10px; |
| | | .margin_top_10px { |
| | | margin-top: 10px; |
| | | } |
| | | .margin_top_20px{ |
| | | margin-top:20px; |
| | | .margin_top_20px { |
| | | margin-top: 20px; |
| | | } |
| | | .margin_top_30px{ |
| | | margin-top:30px; |
| | | .margin_top_30px { |
| | | margin-top: 30px; |
| | | } |
| | | .margin_top_35px{ |
| | | margin-top:35px; |
| | | .margin_top_35px { |
| | | margin-top: 35px; |
| | | } |
| | | .margin_top_40px{ |
| | | margin-top:40px; |
| | | .margin_top_40px { |
| | | margin-top: 40px; |
| | | } |
| | | .margin_bottom_2px{ |
| | | margin-bottom:2px; |
| | | .margin_bottom_2px { |
| | | margin-bottom: 2px; |
| | | } |
| | | .margin_bottom_10px{ |
| | | margin-bottom:10px!important; |
| | | .margin_bottom_10px { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | .margin_bottom_15px{ |
| | | margin-bottom:15px!important; |
| | | .margin_bottom_15px { |
| | | margin-bottom: 15px !important; |
| | | } |
| | | .margin_bottom_20px{ |
| | | margin-bottom:20px!important; |
| | | .margin_bottom_20px { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | .margin_bottom_30px{ |
| | | margin-bottom:30px!important; |
| | | .margin_bottom_30px { |
| | | margin-bottom: 30px !important; |
| | | } |
| | | .margin_bottom_40px{ |
| | | margin-bottom:40px!important; |
| | | .margin_bottom_40px { |
| | | margin-bottom: 40px !important; |
| | | } |
| | | .margin_bottom_50px{ |
| | | margin-bottom:50px!important; |
| | | .margin_bottom_50px { |
| | | margin-bottom: 50px !important; |
| | | } |
| | | // |
| | | .float_left{ |
| | | float:left; |
| | | // |
| | | .float_left { |
| | | float: left; |
| | | } |
| | | .float_right{ |
| | | float:right; |
| | | .float_right { |
| | | float: right; |
| | | } |
| | | // |
| | | .line_height_32px{ |
| | | line-height:32px; |
| | | // |
| | | .line_height_32px { |
| | | line-height: 32px; |
| | | } |
| | | .text_indent_20{ |
| | | text-indent:20px; |
| | | .text_indent_20 { |
| | | text-indent: 20px; |
| | | } |
| | | .text_indent_30{ |
| | | text-indent:30px; |
| | | .text_indent_30 { |
| | | text-indent: 30px; |
| | | } |
| | | // 字体大小 |
| | | .font_size_12{ |
| | | font-size:12px; |
| | | .font_size_12 { |
| | | font-size: 12px; |
| | | } |
| | | .font_size_13{ |
| | | font-size:13px; |
| | | .font_size_13 { |
| | | font-size: 13px; |
| | | } |
| | | .font_size_14{ |
| | | font-size:14px; |
| | | .font_size_14 { |
| | | font-size: 14px; |
| | | } |
| | | .font_size_15{ |
| | | font-size:15px; |
| | | .font_size_15 { |
| | | font-size: 15px; |
| | | } |
| | | .font_size_16{ |
| | | font-size:16px; |
| | | .font_size_16 { |
| | | font-size: 16px; |
| | | } |
| | | .font_size_18{ |
| | | font-size:18px; |
| | | .font_size_18 { |
| | | font-size: 18px; |
| | | } |
| | | .font_size_20{ |
| | | font-size:20px!important; |
| | | .font_size_20 { |
| | | font-size: 20px !important; |
| | | } |
| | | .font_size_30{ |
| | | font-size:30px!important; |
| | | .font_size_30 { |
| | | font-size: 30px !important; |
| | | } |
| | | .font_size_40{ |
| | | font-size:40px!important; |
| | | .font_size_40 { |
| | | font-size: 40px !important; |
| | | } |
| | | .cursor_pointer{ |
| | | .cursor_pointer { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |
| | | .btn-pager { |
| | | display: flex; |
| | | margin-top: 10px; |
| | | // background: #fff; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | |
| | | width: calc(100% - 210px); |
| | | .app-main-content { |
| | | width: 100%; |
| | | overflow-y: auto; |
| | | overflow-y: hidden; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | line-height: 55px; |
| | | background-color: #fff; |
| | | margin-bottom: 10px; |
| | | margin-left: -10px; |
| | | .header-title { |
| | | margin-left: 16px; |
| | | font-size: 16px; |
| | |
| | | <template> |
| | | <div class="page-view"> |
| | | <el-form ref="form" :model="tableList" :show-message="false" label-position="right" |
| | | > |
| | | <el-table :data="tableList.tableData" style="width: 100%" |
| | | :show-summary="showSummary.show" |
| | | :summary-method="getSummaries" |
| | | :span-method="arraySpanMethod"> |
| | | <el-table-column type="index" v-if="tableList.tableColumn.length>0" label="编号" width="50" align="center"></el-table-column> |
| | | <el-form ref="form" :model="tableList" :show-message="false" label-position="right"> |
| | | <el-table |
| | | :data="tableList.tableData" |
| | | style="width: 100%" |
| | | :show-summary="showSummary.show" |
| | | :summary-method="getSummaries" |
| | | :span-method="arraySpanMethod" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | v-if="tableList.tableColumn.length > 0" |
| | | label="编号" |
| | | width="50" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, i) in tableList.tableColumn" |
| | | :key="i" |
| | |
| | | v-model="scope.row[item.prop]" |
| | | :fetch-suggestions="querySearchAsync" |
| | | value-key="name" |
| | | style='width:calc(100% - 70px)' |
| | | style="width: calc(100% - 70px)" |
| | | size="mini" |
| | | @select=" |
| | | (val) => { |
| | |
| | | } |
| | | " |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick(scope.row, item.prop,scope)"> |
| | | <div class="common-select-btn" @click="selClientClick(scope.row, item.prop, scope)"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient(scope.row,scope)"> |
| | | <div class="common-select-btn" @click="clearupClient(scope.row, scope)"> |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | <div class="common-select-btn" v-if="scope.$index!=0" @click="deleteClient(scope.row,scope)"> |
| | | <div class="common-select-btn" v-if="scope.$index != 0" @click="deleteClient(scope.row, scope)"> |
| | | <i class="el-icon-delete" title="删除"></i> |
| | | </div> |
| | | </div> |
| | |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <template v-if="item.multiply"> |
| | | <template v-if="item.multiply"> |
| | | <el-input-number |
| | | :value="scope.row[showSummary.multiply[0]]*scope.row[showSummary.multiply[1]]" |
| | | :value="scope.row[showSummary.multiply[0]] * scope.row[showSummary.multiply[1]]" |
| | | placeholder="" |
| | | :disabled="item.disabled" |
| | | :min="0" |
| | |
| | | } |
| | | " |
| | | ></el-input-number> |
| | | </template> |
| | | <template v-else> |
| | | <el-input-number |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | size="mini" |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | | </template> |
| | | <template v-else> |
| | | <el-input-number |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | size="mini" |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | | </template> |
| | | </el-form-item> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getProductListFromGrpc,getProductList } from "@/api/productManage/product" |
| | | import { getProductListFromGrpc, getProductList } from "@/api/productManage/product" |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | export default { |
| | | name: "CommmonFormTableView", |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | sign:{ |
| | | type:String, |
| | | default:'' |
| | | sign: { |
| | | type: String, |
| | | default: "" |
| | | }, |
| | | productTableList: { |
| | | type: Object, |
| | |
| | | total: false, |
| | | refundable: false, |
| | | sumProp: [], |
| | | multiply:[], |
| | | multiply: [], |
| | | titleProp: ["#", "产品名称"], |
| | | mergeNumber: 1 |
| | | } |
| | |
| | | recalculateShow: { |
| | | type: [Boolean], |
| | | defalut: true |
| | | }, |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | this.tableList = this.productTableList |
| | | }, |
| | | computed: {}, |
| | | watch:{ |
| | | productTableList(){ |
| | | watch: { |
| | | productTableList() { |
| | | this.tableList = this.productTableList |
| | | } |
| | | }, |
| | | methods: { |
| | | // 产品名称 |
| | | async getProductList() { |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc; |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc |
| | | await fn({ |
| | | page: 1, |
| | | pageSize: 100 |
| | |
| | | } |
| | | if (column.property === "total") { |
| | | this.total = sums[index] |
| | | this.$emit('getSummaries',this.total) |
| | | this.$emit("getSummaries", this.total) |
| | | } |
| | | }) |
| | | return sums |
| | |
| | | } |
| | | this.$emit("selCommonName", selRow) |
| | | }, |
| | | selClientClick(row, prop,scope) { |
| | | selClientClick(row, prop, scope) { |
| | | console.log(row, prop) |
| | | this.productIndex = scope.$index |
| | | this.editSelCommonConfig.title = "产品名称" |
| | |
| | | ite.unit = item.unit |
| | | ite.deliveryTime = item.deliveryTime |
| | | ite.shippingDuration = item.shippingDuration |
| | | this.$set(this.tableList.tableData,index,ite) |
| | | this.$set(this.tableList.tableData, index, ite) |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | |
| | | |
| | | console.log(this.tableList.tableData,'=====chanp') |
| | | |
| | | console.log(this.tableList.tableData, "=====chanp") |
| | | } |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient(row,scope) { |
| | | clearupClient(row, scope) { |
| | | this.productIndex = scope.$index |
| | | this.tableList.tableData.map((ite, index) => { |
| | | console.log(scope.$index) |
| | | if (scope.$index && scope.$index >= 0) { |
| | | if (scope.$index && scope.$index >= 0) { |
| | | if (index === this.productIndex) { |
| | | ite.name = "" |
| | | ite.amount = 1 |
| | |
| | | }) |
| | | this.$emit("clearupProduct", this.tableList.tableData) |
| | | }, |
| | | deleteClient(row,scope){ |
| | | if(this.tableList.tableData.length==1){ |
| | | this.$message.error('至少保留一条,不能刪除了!') |
| | | return true; |
| | | deleteClient(row, scope) { |
| | | if (this.tableList.tableData.length == 1) { |
| | | this.$message.error("至少保留一条,不能刪除了!") |
| | | return true |
| | | } |
| | | this.tableList.tableData.splice(scope.$index,1) |
| | | }, |
| | | |
| | | this.tableList.tableData.splice(scope.$index, 1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .page-view { |
| | | min-width:100px; |
| | | min-width: 100px; |
| | | .el-form-item { |
| | | margin-bottom: 0; |
| | | .custom-name { |
| | |
| | | :data="tableList.tableInfomation" |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | :height="'calc(100% - 0px)'" |
| | | :max-height="tableList.maxHeight" |
| | | :lazy="tableList.lazy" |
| | | :show-summary="showSummary.show" |
| | | :summary-method="getSummaries" |
| | | :span-method="arraySpanMethod" |
| | | @selection-change="handleSelectionChange" |
| | | :header-cell-style="{ background: '#ECF4FF', color: '#666' }" |
| | | :header-cell-style="{ background: '#f1f3f8', color: '#000009' }" |
| | | :highlight-current-row="tableList.highlight" |
| | | :row-class-name="tableRowClassName" |
| | | @row-click="tableRowClick" |
| | | :row-key="tableList.key" |
| | | :default-expand-all="tableList.isDefaultExpandAll" |
| | | :tree-props="{ children: 'child', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column v-if="tableList.selectBox" type="selection" width="40"> </el-table-column> |
| | | <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"> </el-table-column> |
| | |
| | | totalName: "本页总计" |
| | | } |
| | | } |
| | | }, |
| | | // 选中的样式 |
| | | selectClassRow: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | computed: {}, |
| | | mounted() {}, |
| | | methods: { |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.$emit("tableRowClick", row) |
| | | }, |
| | | handleReserve(row) { |
| | | return row._id ? row._id : row.id |
| | | }, |
| | |
| | | // 公共详情 |
| | | selCommonClick(row) { |
| | | this.$emit("selCommonClick", row) |
| | | }, |
| | | // 单选行相关 |
| | | tableRowClassName({ row }) { |
| | | if (Object.keys(this.selectClassRow).length > 0) { |
| | | if (row.id == this.selectClassRow.id) { |
| | | return "onSelect" |
| | | } |
| | | } |
| | | this.$emit("tableRowClassName", row) |
| | | }, |
| | | tableRowClick(row) { |
| | | this.$emit("tableRowClick", row) |
| | | } |
| | | } |
| | | } |
| | |
| | | // margin-top: 20px; |
| | | margin-right: 10px; |
| | | // margin-bottom: 40px; |
| | | height: 100%; |
| | | .blue { |
| | | width: 70px; |
| | | text-align: center; |
| | |
| | | } |
| | | } |
| | | ::v-deep { |
| | | .el-table__footer-wrapper { |
| | | tbody td.el-table__cell{ |
| | | .el-table__footer-wrapper { |
| | | tbody td.el-table__cell { |
| | | background-color: #fff; |
| | | font-weight: bold; |
| | | } |
| | |
| | | <template> |
| | | <div class="page-view"> |
| | | <el-pagination |
| | | background |
| | | :current-page="pagerOptions.currPage" |
| | | :page-sizes="pageSizes" |
| | | :page-size="pagerOptions.pageSize" |
| | |
| | | v-on="$listeners" |
| | | > |
| | | </el-pagination> |
| | | <!-- :current-page.sync="searchParam.page" |
| | | :page-size="searchParam.pageSize" |
| | | background |
| | | :page-sizes="[15, 30]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @current-change="changePage" |
| | | @size-change="handleSizeChange" |
| | | @prev-click="prevPage" |
| | | @next-click="nextPage" --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | layout: { |
| | | type: String, |
| | | default: "total, sizes, prev, pager, next" |
| | | default: "total, sizes, prev, pager, next, jumper" |
| | | }, |
| | | pagerOptions: { |
| | | type: Object, |
| | |
| | | </div> |
| | | <template> |
| | | <TableCommonView |
| | | class="content-table" |
| | | class="content-table" |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | |
| | | <template slot="tableButton"> |
| | | <el-table-column label="状态" width="120"> |
| | | <template slot-scope="scope"> |
| | | {{ getpurchaseStatus(scope.row.status) }} |
| | | {{ getpurchaseStatus(scope.row.status) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="editClick(scope.row)" style="margin-right: 5px" |
| | | <el-button type="text" size="small" @click="editClick(scope.row)" style="margin-right: 5px" |
| | | >编辑</el-button |
| | | > |
| | | <el-button @click="submitClick(scope.row)" type="text" size="small">提交</el-button> |
| | | <el-button @click="submitClick(scope.row)" type="text" size="small">提交</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | </div> |
| | | </template> |
| | | </div> |
| | | |
| | | |
| | | <!-- 新建/编辑销售线索 --> |
| | | <!-- <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-rightContent-config="editSalesLeadConfig" /> --> |
| | | <!-- 详情 --> |
| | | <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" /> |
| | | <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" /> |
| | | <!-- 新建/编辑 --> |
| | | <AddPurchase v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { |
| | | getPurchaseList,getPurchaseInfo,submitPurchase, |
| | | } from "@/api/purchaseManage/purchase"; |
| | | import { getPurchaseList, getPurchaseInfo, submitPurchase } from "@/api/purchaseManage/purchase" |
| | | import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier" |
| | | import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase" |
| | | import { getDataByType } from "@/api/data"; |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "SupplierManage", |
| | | props: {}, |
| | | components: { DetailSupplier,AddPurchase }, |
| | | components: { DetailSupplier, AddPurchase }, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | tableLoading:false, |
| | | tableLoading: false, |
| | | tableList: {}, // 列表 |
| | | selValueList: [], |
| | | commonDetail: { |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | search:'', |
| | | editRow:{}, |
| | | search: "", |
| | | editRow: {}, |
| | | editConfig: { |
| | | visible: false, |
| | | title: "创建", |
| | | infomation: {} |
| | | }, |
| | | purchaseStatusList:getDataByType('purchaseStatus'), |
| | | purchaseStatusList: getDataByType("purchaseStatus") |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | if (val) { |
| | | for (let i in this.purchaseStatusList) { |
| | | if (this.purchaseStatusList[i].id == val) { |
| | | return this.purchaseStatusList[i].name; |
| | | return this.purchaseStatusList[i].name |
| | | } |
| | | } |
| | | } else { |
| | | return "--"; |
| | | return "--" |
| | | } |
| | | }, |
| | | setTable() { |
| | |
| | | selectIndex: true, |
| | | tableColumn: [ |
| | | { label: "采购单号", prop: "number", min: 150, isCommonClick: true }, |
| | | { label: "采购单名称", prop: "name", min: 130, isCommonClick: true}, |
| | | { label: "采购单名称", prop: "name", min: 130, isCommonClick: true }, |
| | | { label: "单据类型", prop: "orderType", min: 130 }, |
| | | { label: "供应商名称", prop: "contact", min: 130 }, |
| | | { label: "采购数量", prop: "quantity", min: 130 }, |
| | | { label: "收货仓库", prop: "warehouse", min: 130 }, |
| | | { label: "经办人", prop: "handledBy", min: 130 }, |
| | | { label: "制单人", prop: "creator", min: 130 }, |
| | | { label: "制单人", prop: "creator", min: 130 } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | // 搜索 |
| | | searchClick(val, content) { |
| | | console.log(val, content) |
| | | this.search = content |
| | | this.search = content |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.search = '' |
| | | this.search = "" |
| | | this.getData() |
| | | }, |
| | | // 新建 |
| | |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "创建" |
| | | this.editConfig.infomation = { |
| | | productList:[], |
| | | purchaseTypeId:'', |
| | | supplierId:'', |
| | | supplierName:'', |
| | | orderSource:'手动创建', |
| | | name:'', |
| | | contact:'', |
| | | phone:'', |
| | | signingDate:'', |
| | | deliveryDate:'', |
| | | remark:'', |
| | | wholeDiscountType:null, |
| | | wholeDiscount:0, |
| | | priceAdjustmentType:null, |
| | | priceAdjustment:0, |
| | | realTotalPrice:0, |
| | | } |
| | | productList: [], |
| | | purchaseTypeId: "", |
| | | supplierId: "", |
| | | supplierName: "", |
| | | orderSource: "手动创建", |
| | | name: "", |
| | | contact: "", |
| | | phone: "", |
| | | signingDate: "", |
| | | deliveryDate: "", |
| | | remark: "", |
| | | wholeDiscountType: null, |
| | | wholeDiscount: 0, |
| | | priceAdjustmentType: null, |
| | | priceAdjustment: 0, |
| | | realTotalPrice: 0 |
| | | } |
| | | }, |
| | | |
| | | |
| | | // 编辑 |
| | | editClick(row){ |
| | | this.tableLoading=true |
| | | getPurchaseInfo({id:row.ID}).then((res) => { |
| | | editClick(row) { |
| | | this.tableLoading = true |
| | | getPurchaseInfo({ id: row.ID }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.tableLoading=false |
| | | this.tableLoading = false |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { |
| | | productList:res.data.productList, |
| | | supplierName:res.data.purchase.supplier.name, |
| | | ...res.data.purchase, |
| | | } |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg+',':''+'获取信息失败!') |
| | | this.editConfig.infomation = { |
| | | productList: res.data.productList, |
| | | supplierName: res.data.purchase.supplier.name, |
| | | ...res.data.purchase |
| | | } |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | setTimeout(()=>{ |
| | | this.tableLoading=false |
| | | },3000) |
| | | setTimeout(() => { |
| | | this.tableLoading = false |
| | | }, 3000) |
| | | // this.editRow = row; |
| | | // this.$refs.add.islook = true; |
| | | |
| | | }, |
| | | // 确认发货 |
| | | submitClick(row) { |
| | | this.$confirm("是否提交?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | submitPurchase({ id: row.ID }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("提交成功") |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("提交失败") |
| | | } |
| | | }) |
| | | this.$confirm("是否提交?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | submitPurchase({ id: row.ID }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("提交成功") |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("提交失败") |
| | | } |
| | | }) |
| | | .catch(() => {}) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | |
| | | |
| | | // 详情 |
| | | selCommonClick(row) { |
| | | console.log(row) |
| | | this.tableLoading=true |
| | | getPurchaseInfo({id:row.ID}).then((res) => { |
| | | this.tableLoading = true |
| | | getPurchaseInfo({ id: row.ID }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.tableLoading=false |
| | | this.tableLoading = false |
| | | this.commonDetail.visible = true |
| | | this.commonDetail.infomation = { |
| | | productList:res.data.productList, |
| | | this.commonDetail.infomation = { |
| | | productList: res.data.productList, |
| | | ...res.data.purchase |
| | | } |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg+',':''+'获取信息失败!') |
| | | } |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | setTimeout(()=>{ |
| | | this.tableLoading=false |
| | | },3000) |
| | | setTimeout(() => { |
| | | this.tableLoading = false |
| | | }, 3000) |
| | | } |
| | | } |
| | | } |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .rightContent { |
| | | width:100%; |
| | | height:calc(100% - 10px); |
| | | width: 100%; |
| | | height: calc(100% - 10px); |
| | | .content-box { |
| | | height:100%; |
| | | height: 100%; |
| | | .supplier-search { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | .content-table{ |
| | | .content-table { |
| | | // height:calc(100% - 60px - 42px); |
| | | } |
| | | .btn-pager { |
| | | display: flex; |
| | | // background: #fff; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | |
| | | <div class="basic-info-title">产品信息</div> |
| | | <div class="basic-info-view"> |
| | | <CommonFormTableView |
| | | ref="productTable" |
| | | :product-table-list="productTableList" |
| | | :detail-enter="detailEnter" |
| | | @inputContent="inputContent" |
| | |
| | | }, |
| | | // 保存 |
| | | saveClick() { |
| | | console.log(this.editConfig.infomation) |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].name.length === 0) { |
| | | this.isNoProduct = true |
| | | break |
| | | } else { |
| | | this.isNoProduct = false |
| | | } |
| | | } |
| | | if (this.isNoProduct) { |
| | | this.$message.error("产品名称不能为空") |
| | | } else { |
| | | if (this.editConfig.title === "添加") { |
| | | createProduct({ |
| | | list: this.tableData |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getProductList() |
| | | this.$refs.productTable.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].name.length === 0) { |
| | | this.isNoProduct = true |
| | | break |
| | | } else { |
| | | this.isNoProduct = false |
| | | } |
| | | }) |
| | | } else { |
| | | const params = this.saveParams() |
| | | updateProduct(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | if (this.isNoProduct) { |
| | | this.$message.error("产品名称不能为空") |
| | | } else { |
| | | if (this.editConfig.title === "添加") { |
| | | createProduct({ |
| | | list: this.tableData |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | }) |
| | | } else { |
| | | const params = this.saveParams() |
| | | updateProduct(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | |
| | | </div> |
| | | </div> |
| | | <template> |
| | | <el-table |
| | | ref="tableSupplier" |
| | | border |
| | | :data="tableList.tableInfomation" |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | :lazy="tableList.lazy" |
| | | highlight-current-row |
| | | @row-click="tableRowClick" |
| | | :header-cell-style="{ background: '#ECF4FF', color: '#666' }" |
| | | > |
| | | <el-table-column type="index" label="序号" width="50"> </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, i) in tableList.tableColumn" |
| | | :key="i" |
| | | :prop="item.prop" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | :min-width="item.min" |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable" |
| | | <div class="list-view"> |
| | | <TableCommonView |
| | | ref="tableSupplier" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @tableRowClick="tableRowClick" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <div v-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div> |
| | | <span |
| | | v-else-if="item.isCommonClick && scope.row[item.prop]" |
| | | class="sel-name" |
| | | @click="selCommonClick(scope.row)" |
| | | >{{ scope.row[item.prop] }}</span |
| | | > |
| | | <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span> |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.status === 0" |
| | | @click="enableClick(scope.row, '启用')" |
| | | type="text" |
| | | size="small" |
| | | >启用</el-button |
| | | > |
| | | <el-button v-else @click="enableClick(scope.row, '停用')" type="text" size="small">停用</el-button> |
| | | <el-button @click="modifyClick(scope.row)" type="text" size="small">修改</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button v-if="scope.row.status === 0" @click="enableClick(scope.row, '启用')" type="text" size="small" |
| | | >启用</el-button |
| | | > |
| | | <el-button v-else @click="enableClick(scope.row, '停用')" type="text" size="small">停用</el-button> |
| | | <el-button @click="modifyClick(scope.row)" type="text" size="small">修改</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </TableCommonView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <template> |
| | | <TableCommonView |
| | | ref="tableListProduct" |
| | | :table-list="productTableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="170"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="raleteClick(scope.row)" type="text" size="small">相关供应商</el-button> |
| | | <el-button @click="editClick(scope.row)" type="text" size="small">修改</el-button> |
| | | <el-button @click="delClick(scope.row)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCommonView> |
| | | <div class="list-view"> |
| | | <TableCommonView |
| | | ref="tableListProduct" |
| | | :table-list="productTableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="170"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="raleteClick(scope.row)" type="text" size="small">相关供应商</el-button> |
| | | <el-button @click="editClick(scope.row)" type="text" size="small">修改</el-button> |
| | | <el-button @click="delClick(scope.row)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCommonView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="productPagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectIndex: true, |
| | | highlight: true, |
| | | ref: "tableListRef", |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | |
| | | this.supplierId = 0 |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.tableSupplier.setCurrentRow(this.tableList.tableInfomation[0]) |
| | | this.$refs.tableSupplier.$refs.table.setCurrentRow(this.tableList.tableInfomation[0]) |
| | | }) |
| | | this.getProductList() |
| | | } |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .rightContent { |
| | | height: 100%; |
| | | background: #f0f2f5; |
| | | padding: 10px; |
| | | .top { |
| | | margin-bottom: 20px; |
| | | height: 55%; |
| | | background: #fff; |
| | | .list-view { |
| | | height: calc(100% - 120px); |
| | | } |
| | | .supplier-search { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | color: $color-primary; |
| | | cursor: pointer; |
| | | } |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | // .btn-pager { |
| | | // display: flex; |
| | | // .page { |
| | | // margin-left: auto; |
| | | // } |
| | | // } |
| | | } |
| | | .bottom { |
| | | margin-top: 20px; |
| | | height: calc(40% - 0px); |
| | | background: #fff; |
| | | .list-view { |
| | | height: calc(100% - 120px); |
| | | } |
| | | .product-search { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | .add-view { |
| | | margin-left: 20px; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |