| | |
| | | // 提交采购单 |
| | | export function submitPurchase(data) { |
| | | return request({ |
| | | url: "/api/purchase/submit/"+data.id, |
| | | url: "/api/purchase/submit", |
| | | method: "post", |
| | | data |
| | | }) |
| | |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <el-input |
| | | :disabled="item.disabled" |
| | | v-model.trim="scope.row[item.prop]" |
| | | maxlength="50" |
| | | size="mini" |
| | |
| | | " |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-else-if="item.productName" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> |
| | | <el-form-item v-else-if="item.productName" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | :disabled="item.disabled" |
| | | v-model="scope.row[item.prop]" |
| | | :fetch-suggestions="querySearchAsync" |
| | | value-key="name" |
| | |
| | | } |
| | | " |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick(scope.row, item.prop, scope)"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | <div v-if="!item.disabled" 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 v-if="!item.disabled" 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||!item.disabled" @click="deleteClient(scope.row, scope)"> |
| | | <i class="el-icon-delete" title="删除"></i> |
| | | </div> |
| | | </div> |
| | |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <el-input-number |
| | | :disabled="item.disabled" |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | |
| | | > |
| | | <template v-if="item.multiply"> |
| | | <el-input-number |
| | | :disabled="item.disabled" |
| | | :value="scope.row[showSummary.multiply[0]] * scope.row[showSummary.multiply[1]]" |
| | | placeholder="" |
| | | :disabled="item.disabled" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | |
| | | </template> |
| | | <template v-else> |
| | | <el-input-number |
| | | :disabled="item.disabled" |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | |
| | | </el-table> |
| | | </el-form> |
| | | <div v-if="!detailEnter" style="margin: 10px"> |
| | | <el-button size="small" type="primary" @click="add">新增</el-button> |
| | | <el-button size="small" type="primary" @click="empty">清空</el-button> |
| | | <el-button :disabled="tableList.disabled" size="small" type="primary" @click="add">新增</el-button> |
| | | <el-button :disabled="tableList.disabled" size="small" type="primary" @click="empty">清空</el-button> |
| | | </div> |
| | | <!-- 产品名称 --> |
| | | <SelectCommonDialog |
| | |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | disabled:false, |
| | | tableData: [], // 接口返回数据 |
| | | tableColumn: [ |
| | | // table表单 |
| | |
| | | }, |
| | | actions:{ |
| | | getSupplier(context){ |
| | | getSupplierList({page:1,pageSize:50}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | context.commit("supplierNameList", res.data.data.list) |
| | | getSupplierList({page:1,pageSize:100}).then((res) => { |
| | | if (res.code == 200) { |
| | | context.commit("supplierNameList", res.data.list) |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | |
| | | style="width:100%;" |
| | | > |
| | | <el-select |
| | | :disabled="editConfig.isDisabled" |
| | | placeholder="请选择采购类型" |
| | | v-model="editConfig.infomation.purchaseTypeId" |
| | | clearable |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | <i |
| | | v-if="!editConfig.isDisabled" |
| | | class="el-icon-setting margin_left_10px cursor_pointer" |
| | | style="font-size: 20px; color: #333" |
| | | @click="handleShow" |
| | |
| | | <el-form-item label="供应商名称" prop="supplierName"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | :disabled="editConfig.isDisabled" |
| | | style="width: calc(100% - 40px)" |
| | | v-model="editConfig.infomation.supplierName" |
| | | :fetch-suggestions=" |
| | |
| | | @select="handleSelectClient('client', $event)" |
| | | ></el-autocomplete> |
| | | <div |
| | | v-if="!editConfig.isDisabled" |
| | | class="common-select-btn" |
| | | @click="selClientClick('client')" |
| | | > |
| | |
| | | class="common-select-btn" |
| | | @click="clearupClient('client')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | <i class="el-icon-remove-outline" |
| | | v-if="!editConfig.isDisabled" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="采购单名称" prop="name"> |
| | | <el-input |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.name" |
| | | placeholder="请填写" |
| | | clearable |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="供应商联系人" prop="contact"> |
| | | <el-input |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.contact" |
| | | placeholder="请填写" |
| | | clearable |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话" prop="phone"> |
| | | <el-input |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.phone" |
| | | placeholder="请填写" |
| | | clearable |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="签约日期" prop="signingDate"> |
| | | <el-date-picker |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.signingDate" |
| | | style="width: 100%" |
| | | type="date" |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="交付日期" prop="deliveryDate"> |
| | | <el-date-picker |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.deliveryDate" |
| | | style="width: 100%" |
| | | type="date" |
| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注信息" prop="remark"> |
| | | <el-input |
| | | :disabled="editConfig.isDisabled" |
| | | type="textarea" |
| | | :autosize="{ minRows: 3, maxRows: 4 }" |
| | | maxlength="500" |
| | |
| | | <el-select |
| | | v-model="editConfig.infomation.wholeDiscountType" |
| | | placeholder="请选择" |
| | | :disabled="editConfig.isDisabled" |
| | | filterable |
| | | @change="getTotal" |
| | | > |
| | |
| | | <el-input |
| | | v-model="editConfig.infomation.wholeDiscount" |
| | | size="mini" |
| | | :disabled="editConfig.infomation.wholeDiscountType?false:true" |
| | | :disabled="editConfig.isDisabled" |
| | | @change="getTotal" |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | <div class="table-bottom-l"> |
| | | <el-form-item label="调整" prop="member_id"> |
| | | <el-select |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.priceAdjustmentType" |
| | | placeholder="请选择" |
| | | filterable |
| | |
| | | <div class="table-bottom-r"> |
| | | <el-form-item label="" prop="member_id"> |
| | | <el-input |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.priceAdjustment" |
| | | size="mini" |
| | | :disabled="editConfig.infomation.priceAdjustmentType?false:true" |
| | | @change="getTotal" |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | this.$message.error("产品名称不能为空"); |
| | | } else { |
| | | const params = this.saveParams(); |
| | | console.log(params); |
| | | if (this.editConfig.title === "创建") { |
| | | addPurchase(params).then((res) => { |
| | | console.log(res); |
| | | this.editConfig.visible = false; |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功"); |
| | |
| | | let params = { |
| | | productList:this.tableData, |
| | | purchase:{ |
| | | supplierId:this.supplierId||0, |
| | | supplierId:data.supplierId, |
| | | signingDate:data.signingDate||'', |
| | | remark:data.remark, |
| | | orderSource:data.orderSource||'', |
| | |
| | | }; |
| | | }, |
| | | handleSelectClient(value, item) { |
| | | console.log(value); |
| | | if (value === "client") { |
| | | this.supplierId = item.id; |
| | | this.editConfig.infomation.supplierId=item.ID |
| | | } |
| | | }, |
| | | selClientClick() { |
| | |
| | | } |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | disabled:this.editConfig.isDisabled, |
| | | tableColumn: [ |
| | | { |
| | | label: "产品名称", |
| | |
| | | min: 180, |
| | | productName: true, |
| | | isRequird: true, |
| | | disabled:this.editConfig.isDisabled, |
| | | }, |
| | | { label: "产品编号", prop: "number", min: 150,}, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "规格型号", prop: "specifications" }, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | { label: "规格型号", prop: "specifications",}, |
| | | { label: "数量", prop: "amount", inputNumber: true,disabled:this.editConfig.isDisabled, }, |
| | | { |
| | | label: "采购单价", |
| | | prop: "price", |
| | | inputFloat: true, |
| | | isRequird: true, |
| | | disabled:this.editConfig.isDisabled, |
| | | }, |
| | | { label: "价税合计", prop: "total", inputFloat: true,disabled:true,multiply:true, }, |
| | | { label: "描述", prop: "remark", input: true }, |
| | | { label: "价税合计", prop: "total", inputFloat: true,disabled:this.editConfig.isDisabled,multiply:true, }, |
| | | { label: "描述", prop: "remark", input: true,disabled:this.editConfig.isDisabled}, |
| | | ], |
| | | }; |
| | | this.toal=this.editConfig.infomation.realTotalPrice |
| | |
| | | {{ getpurchaseStatus(scope.row.status) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <el-table-column label="操作" width="220" 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="btnConfirm(scope.row)" style="margin-right: 5px" |
| | | >确认</el-button |
| | | > |
| | | <el-button type="text" size="small" @click="btnEdit(scope.row)" style="margin-right: 5px" |
| | | >编辑</el-button |
| | | > |
| | | <el-button v-if="scope.row.status< 4" @click="submitClick(scope.row)" type="text" size="small">提交</el-button> |
| | | <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" |
| | | >查看</el-button |
| | | > |
| | | <el-button type="text" size="small" @click="btnCancel(scope.row)" style="margin-right: 5px" |
| | | >取消</el-button |
| | | > |
| | | <el-button type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px" |
| | | >删除</el-button |
| | | > |
| | | <!-- <el-button v-if="scope.row.status< 4" @click="submitClick(scope.row)" type="text" size="small">提交</el-button> --> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | <!-- 详情 --> |
| | | <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" /> |
| | | <!-- 新建/编辑 --> |
| | | <AddPurchase v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <AddPurchase ref="addDialog" 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,deletePurchase } 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 { getSupplierList } from "@/api/supplierManage/supplier" |
| | | export default { |
| | | name: "SupplierManage", |
| | |
| | | editConfig: { |
| | | visible: false, |
| | | title: "创建", |
| | | isDisabled:false, |
| | | infomation: { |
| | | supplierList:[] |
| | | } |
| | | }, |
| | | purchaseStatusList: getDataByType("purchaseStatus"), |
| | | tableColumn: [ |
| | | { label: "采购单号", prop: "number", min: 150, isCommonClick: true ,default:true}, |
| | | { label: "采购单名称", prop: "name", min: 130, isCommonClick: true }, |
| | |
| | | }, |
| | | methods: { |
| | | getpurchaseStatus(val) { |
| | | let statusList=[ |
| | | {id:1,name:"待确认"}, |
| | | {id:2,name:"待入库"}, |
| | | {id:3,name:"已入库"}, |
| | | {id:4,name:"已完成"}, |
| | | {id:5,name:"已取消"} |
| | | ] |
| | | if (val) { |
| | | for (let i in this.purchaseStatusList) { |
| | | if (this.purchaseStatusList[i].id == val) { |
| | | return this.purchaseStatusList[i].name |
| | | for (let i in statusList) { |
| | | if (statusList[i].id == val) { |
| | | return statusList[i].name |
| | | } |
| | | } |
| | | } else { |
| | |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.isDisabled=false |
| | | // this.editRow = {}; |
| | | // this.$refs.add.islook = true; |
| | | this.editConfig.visible = true |
| | |
| | | }, |
| | | |
| | | // 编辑 |
| | | editClick(row) { |
| | | btnEdit(row) { |
| | | this.tableLoading = true |
| | | getPurchaseInfo({ id: row.ID }).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | // this.$refs.add.islook = true; |
| | | }, |
| | | // 确认发货 |
| | | submitClick(row) { |
| | | btnConfirm(row) { |
| | | this.$confirm("是否提交?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | submitPurchase({ id: row.ID }).then((response) => { |
| | | submitPurchase({ id: row.ID,status:2 }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("提交成功") |
| | | this.getData() |
| | |
| | | console.error(e) |
| | | }) |
| | | }, |
| | | |
| | | // 取消 |
| | | btnCancel(row){ |
| | | this.$confirm("是否取消?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | submitPurchase({ id: row.ID,status:5 }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("已取消") |
| | | this.getData() |
| | | } else { |
| | | // this.$message.warning("提交失败") |
| | | } |
| | | }) |
| | | },(e)=>{ |
| | | console.error(e) |
| | | }) |
| | | }, |
| | | // 删除 |
| | | btnDelete(row){ |
| | | this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deletePurchase({ id: row.ID }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("删除失败") |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | // 查看 |
| | | btnLook(row){ |
| | | this.editConfig.isDisabled=true |
| | | this.tableLoading = true |
| | | getPurchaseInfo({ id: row.ID }).then((res) => { |
| | | if (res.code == 200) { |
| | | 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 + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | setTimeout(() => { |
| | | this.tableLoading = false |
| | | }, 3000) |
| | | }, |
| | | // 详情 |
| | | selCommonClick(row) { |
| | | console.log(row) |