| | |
| | | <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" |
| | | :span-method="arraySpanMethod" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.productId" |
| | | :row-key="getRowKeys" |
| | | > |
| | | <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center"> |
| | | <el-table-column v-if="selectBox" type="selection" :selectable="isDisabled" :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 |
| | |
| | | <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"> |
| | |
| | | " |
| | | ></el-input> |
| | | </el-form-item> |
| | | <span v-else-if="item.compute">{{ calculateDifference(scope.row) }}</span> |
| | | <!-- 调用方法显示文字 --> |
| | | <div v-else-if="item.isCallMethod"> |
| | | <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{ |
| | | item.getCallMethod(scope.row[item.prop], scope.row) |
| | | }}</span> |
| | | </div> |
| | | <el-form-item |
| | | v-else-if="item.productName" |
| | | label=" " |
| | |
| | | " |
| | | ></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> |
| | |
| | | <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 |
| | | }, |
| | | // selection 选择状态 页面 |
| | | name: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | isBoder:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | |
| | | editVisible: false, |
| | | isSelectBox: false, |
| | | title: "", |
| | | infomation: {} |
| | | infomation: {}, |
| | | supplierId:null, |
| | | }, |
| | | productIndex: 0 |
| | | productIndex: 0, |
| | | supplierId:null, |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getTableInfo() |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | supplierId(n,o) { |
| | | this.editSelCommonConfig.supplierId=n |
| | | console.log(n,o,"看看那") |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | // 获取row的key值 |
| | | getRowKeys(row) { |
| | | let string; |
| | | string = row[this.productTableList.key?this.productTableList.key:this.productTableList.productId]; |
| | | return string; |
| | | }, |
| | | isDisabled(row){ |
| | | if (this.name == "rework") { |
| | | if (row.status == 1) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }else { |
| | | return true; |
| | | } |
| | | }, |
| | | 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 |
| | | }, |
| | |
| | | async getProductList() { |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc |
| | | await fn({ |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | page: 1, |
| | | pageSize: 100, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | this.productList = res.data.list |
| | |
| | | }) |
| | | }, |
| | | // 新增 |
| | | selClientClick(scope, prop) { |
| | | console.log(scope, prop) |
| | | selClientClick(scope) { |
| | | this.productIndex = scope.$index |
| | | this.editSelCommonConfig.title = "产品名称" |
| | | this.editSelCommonConfig.isSelectBox = true |