| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <el-dialog
- v-dialogDrag
- title="送货通知单"
- :visible.sync="open"
- width="1200px"
- append-to-body
- @close="dialogClose"
- @open="dialogOpen"
- >
- <!-- 搜索工作栏 -->
- <!-- <el-form
- v-show="showSearch"
- ref="queryForm"
- :model="queryParams"
- size="small"
- label-width="68px"
- >
- <SearchBar :show-more="false" :collapse-span="6">
- <template #header>
- <el-col :span="6">
- <el-form-item label="出货日期" prop="deliveryTime">
- <el-date-picker
- v-model="queryParams.deliveryTime"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="datetime"
- placeholder="请选择出货日期"
- />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="备注" prop="remark" label-width="88px">
- <el-input
- v-model="queryParams.remark"
- placeholder="请输入备注"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- </el-col>
- </template>
- </SearchBar>
- </el-form> -->
- <!-- 列表 -->
- <el-table v-loading="loading" :data="list" border size="mini">
- <el-table-column
- label="物料编码"
- align="center"
- prop="materialNo"
- width="160"
- show-overflow-tooltip
- />
- <el-table-column
- label="物料名称"
- align="center"
- prop="materialName"
- width="150"
- show-overflow-tooltip
- />
- <el-table-column
- label="客户编码"
- align="center"
- prop="customerCode"
- width="150"
- show-overflow-tooltip
- />
- <el-table-column
- label="客户名称"
- align="center"
- prop="customerName"
- width="160"
- show-overflow-tooltip
- />
- <el-table-column
- label="本次出货数量"
- align="center"
- prop="nowDeliveredQty"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.nowDeliveredQty"
- @change="deliverChange"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="已出货数量"
- align="center"
- prop="deliveredQty"
- width="120"
- />
- <el-table-column
- label="应出货数量"
- align="center"
- prop="shouldDeliveredQty"
- width="120"
- />
- <el-table-column
- label="单位"
- align="center"
- prop="unitName"
- width="150"
- show-overflow-tooltip
- />
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancel">取消</el-button>
- <el-button
- v-hasPermi="['wms:sale-out-order-master:create']"
- type="primary"
- :loading="ensureLoading"
- @click="submitForm"
- >确定</el-button
- >
- </div>
- </el-dialog>
- </template>
- <script>
- import { createSaleOutOrderMaster } from "@/api/wms/orders/sale";
- export default {
- name: "DeliveryConfimation",
- props: {
- currentRows: {
- type: Array,
- default: () => [],
- },
- model: {
- type: Object,
- default: () => {},
- },
- },
- data() {
- return {
- // 遮罩层
- loading: false,
- // 导出遮罩层
- exportLoading: false,
- // 显示搜索条件
- showSearch: true,
- ensureLoading: false,
- // 总条数
- total: 0,
- // ERP采购订单明细列表
- list: [],
- // 弹出层标题
- title: "",
- tokens: "",
- baseUrl: "",
- reportId: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNo: 1,
- pageSize: 10,
- remark: null,
- noticeDate: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {},
- };
- },
- methods: {
- /** 取消按钮 */
- cancel() {
- this.open = false;
- this.reset();
- },
- /** 表单重置 */
- reset() {
- this.form = {
- id: undefined,
- detailErpId: undefined,
- inStockId: undefined,
- erpInStockOrderId: undefined,
- erpInStockOrderNo: undefined,
- detailNumber: undefined,
- materialNo: undefined,
- materialName: undefined,
- materialQty: undefined,
- materialModels: undefined,
- unitName: undefined,
- shouldReceiveAmount: undefined,
- receiveQty: undefined,
- returnQty: undefined,
- materialStatus: undefined,
- supplierCode: undefined,
- supplierName: undefined,
- batch: undefined,
- price: undefined,
- taxPrice: undefined,
- allAmount: undefined,
- taxRate: undefined,
- comment: undefined,
- deliveryTime: undefined,
- erpMark: undefined,
- };
- this.resetForm("form");
- },
- dialogClose() {
- this.queryParams.remark = null;
- this.queryParams.noticeDate = null;
- this.$emit("notificationClose", this.queryParams.remark);
- },
- dialogOpen() {
- console.log(this.model);
- this.list = this.model.list;
- // this.list = this.currentRows.map(item => {
- // item.nowDeliveredQty = item.shouldDeliveredQty - item.deliveredQty
- // return item
- // })
- },
- // 创建送货通知单
- submitForm() {
- const { deliveryTime, remark } = this.queryParams;
- if (
- (deliveryTime === undefined || deliveryTime === null) &&
- (remark === null || remark === undefined)
- ) {
- this.$modal.msgWarning("请选择出货日期和填写备注");
- return;
- }
- const noticeList = this.currentRows.map((item) => {
- const {
- customerCode,
- customerName,
- nowDeliveredQty,
- id: saleOrderDetailId,
- materialName,
- materialNo,
- } = item;
- return {
- customerCode,
- customerName,
- nowDeliveredQty,
- saleOrderDetailId,
- materialName,
- materialNo,
- };
- });
- const params = {
- deliveryTime: this.queryParams.deliveryTime,
- remark: this.queryParams.remark,
- list: noticeList,
- };
- this.ensureLoading = true;
- createSaleOutOrderMaster(params)
- .then((res) => {
- this.$modal.msgSuccess("创建成功!");
- this.open = false;
- this.$emit("createComplete");
- })
- .finally(() => {
- this.ensureLoading = false;
- });
- },
- deliverChange(v) {
- if (typeof v === "string") {
- v = parseFloat(v);
- }
- },
- },
- };
- </script>
|