|
@@ -23,7 +23,7 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
|
|
+ <el-col :span="8">
|
|
<el-form-item label="备注:" prop="remark" size="normal">
|
|
<el-form-item label="备注:" prop="remark" size="normal">
|
|
<el-input
|
|
<el-input
|
|
v-model="form.remark"
|
|
v-model="form.remark"
|
|
@@ -33,7 +33,7 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
|
|
+ <el-col :span="8">
|
|
<el-form-item label="出库日期:" prop="remark" size="normal">
|
|
<el-form-item label="出库日期:" prop="remark" size="normal">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="form.outStockDate"
|
|
v-model="form.outStockDate"
|
|
@@ -44,6 +44,35 @@
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="批次:" prop="batchNumber" size="normal">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="form.batchNumber"
|
|
|
|
+ clearable
|
|
|
|
+ filterable
|
|
|
|
+ @change="batchChangeHandler"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in batchOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button
|
|
|
|
+ :disabled="isCanRecordBatch"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="myRecordBatchHandler"
|
|
|
|
+ >记录批次</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
</el-form>
|
|
</el-form>
|
|
</el-row>
|
|
</el-row>
|
|
<el-table ref="tableRef" v-if="tableShow" :data="tableData" border stripe>
|
|
<el-table ref="tableRef" v-if="tableShow" :data="tableData" border stripe>
|
|
@@ -79,6 +108,11 @@
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column label="单价" prop="productUnitPrice"></el-table-column>
|
|
<el-table-column label="单价" prop="productUnitPrice"></el-table-column>
|
|
<el-table-column label="金额" prop="productAmounts"></el-table-column>
|
|
<el-table-column label="金额" prop="productAmounts"></el-table-column>
|
|
|
|
+ <el-table-column label="批次状态" prop="batchState">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{ scope.row.batchState == 0 ? "正常" : "撤销登账" }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -88,6 +122,7 @@ import {
|
|
productInvoiceInfo,
|
|
productInvoiceInfo,
|
|
outboundOrderInfo,
|
|
outboundOrderInfo,
|
|
printOutsourceOrderList,
|
|
printOutsourceOrderList,
|
|
|
|
+ printOutsourceOrder,
|
|
} from "@/api/tablelist/commonTable";
|
|
} from "@/api/tablelist/commonTable";
|
|
import { listOldRecord } from "@/api/system/oldRecord.js";
|
|
import { listOldRecord } from "@/api/system/oldRecord.js";
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
@@ -97,12 +132,14 @@ export default {
|
|
components: {},
|
|
components: {},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ batchOptions: [], //批号选项数据
|
|
isRetail: false,
|
|
isRetail: false,
|
|
tableShow: true,
|
|
tableShow: true,
|
|
form: {
|
|
form: {
|
|
unitName: "",
|
|
unitName: "",
|
|
remark: "",
|
|
remark: "",
|
|
outStockDate: new Date(),
|
|
outStockDate: new Date(),
|
|
|
|
+ batchNumber: "",
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
// unitName: [
|
|
// unitName: [
|
|
@@ -136,6 +173,7 @@ export default {
|
|
label: "名称",
|
|
label: "名称",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
|
|
+ allTableData: [], //所有表格数据
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -143,6 +181,13 @@ export default {
|
|
username: (state) => state.user.name,
|
|
username: (state) => state.user.name,
|
|
nickName: (state) => state.user?.nickName,
|
|
nickName: (state) => state.user?.nickName,
|
|
}),
|
|
}),
|
|
|
|
+ isCanRecordBatch() {
|
|
|
|
+ return (
|
|
|
|
+ (this.form.batchNumber != "" ||
|
|
|
|
+ this.tableData.some((item) => item.batchState == "1")) &&
|
|
|
|
+ !this.tableData.length
|
|
|
|
+ );
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
isRetail(val) {
|
|
isRetail(val) {
|
|
@@ -153,6 +198,58 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 记录批次回调
|
|
|
|
+ async myRecordBatchHandler(row, btnData) {
|
|
|
|
+ let payload = this.tableData.map((item) => {
|
|
|
|
+ let { saleNo } = this.currentRow;
|
|
|
|
+ return {
|
|
|
|
+ accountingType: "1",
|
|
|
|
+ accountsReceivableDate: new Date(),
|
|
|
|
+ saleNo,
|
|
|
|
+ noticeNumber: item.noticeNumber,
|
|
|
|
+ // saleProductNo: item.saleProductNo,
|
|
|
|
+ productId: item.productId,
|
|
|
|
+ productName: item.productName,
|
|
|
|
+ productSpecifications: item.productSpecifications,
|
|
|
|
+ productColour: item.productColour,
|
|
|
|
+ productId: item.productId,
|
|
|
|
+ lotNumber: item.lotNumber,
|
|
|
|
+ weight: item.productNumber,
|
|
|
|
+ productPrice: item.productUnitPrice,
|
|
|
|
+ amountReceivable: Number(
|
|
|
|
+ (
|
|
|
|
+ Number(item.productNumber) * Number(item.productUnitPrice)
|
|
|
|
+ ).toFixed(2)
|
|
|
|
+ ),
|
|
|
|
+ billingType: "1",
|
|
|
|
+ accountsReceivableRemark: this.form.remark,
|
|
|
|
+ receivedAmount: 0,
|
|
|
|
+ status: 1,
|
|
|
|
+ boxNum: item.boxNum,
|
|
|
|
+ productLevel: item.productLevel,
|
|
|
|
+ returnReceipt: "0",
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ let result = await printOutsourceOrder(payload);
|
|
|
|
+ if (result.code == 200) {
|
|
|
|
+ this.$message.success("记录成功");
|
|
|
|
+ } else {
|
|
|
|
+ throw new Error(result.msg);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 批次改变回调
|
|
|
|
+ batchChangeHandler(val) {
|
|
|
|
+ // if (val) {
|
|
|
|
+ this.tableData = JSON.parse(
|
|
|
|
+ JSON.stringify(
|
|
|
|
+ this.allTableData.filter((v) => v.batchNumber == val) || []
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ // }
|
|
|
|
+ // else {
|
|
|
|
+ // this.tableData = JSON.parse(JSON.stringify(this.allTableData));
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
// 重置表单
|
|
// 重置表单
|
|
resetForm() {
|
|
resetForm() {
|
|
Object.assign(this.form, {
|
|
Object.assign(this.form, {
|
|
@@ -201,10 +298,32 @@ export default {
|
|
item.unit = "";
|
|
item.unit = "";
|
|
});
|
|
});
|
|
this.tableData = res.data;
|
|
this.tableData = res.data;
|
|
|
|
+ this.allTableData = JSON.parse(JSON.stringify(res.data));
|
|
|
|
+ this.getBatchOptions(res.data); //获取批号选项数据
|
|
|
|
+ this.batchChangeHandler(""); //默认显示当前批次数据
|
|
this.isRetail = isRetail;
|
|
this.isRetail = isRetail;
|
|
}
|
|
}
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
|
|
+ // 获取批号选项数据
|
|
|
|
+ getBatchOptions(rows) {
|
|
|
|
+ let batchOptions = [];
|
|
|
|
+ rows.forEach((row) => {
|
|
|
|
+ if (
|
|
|
|
+ !batchOptions.find((item) => item.value == row.batchNumber)?.value
|
|
|
|
+ ) {
|
|
|
|
+ batchOptions.push({
|
|
|
|
+ value: row.batchNumber,
|
|
|
|
+ label: row.batchNumber,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ batchOptions.push({
|
|
|
|
+ value: "",
|
|
|
|
+ label: "当前批次",
|
|
|
|
+ });
|
|
|
|
+ this.batchOptions = batchOptions;
|
|
|
|
+ },
|
|
// 获取打印数据
|
|
// 获取打印数据
|
|
async getPrintData() {
|
|
async getPrintData() {
|
|
let res = {
|
|
let res = {
|