|
@@ -15,30 +15,21 @@
|
|
|
}"
|
|
|
:action-list="[
|
|
|
{
|
|
|
- text: '添加订单',
|
|
|
+ text: '质检',
|
|
|
action: () => openModal('add'),
|
|
|
},
|
|
|
]"
|
|
|
@get-list="getList"
|
|
|
>
|
|
|
<template #code="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickCode(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="getDtl(item)">
|
|
|
{{ item.code }}
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #address="{ item }">
|
|
|
- <div>
|
|
|
- {{ item.countryName }}, {{ item.provinceName }} ,
|
|
|
- {{ item.cityName }}, {{ item.detailedAddress }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
- :title="modalType == 'add' ? '添加订单' : '调仓接收'"
|
|
|
+ :title="modalType == 'add' ? '京东退货质检' : '质检详情'"
|
|
|
v-model="dialogVisible"
|
|
|
width="800"
|
|
|
v-loading="loading"
|
|
@@ -50,129 +41,81 @@
|
|
|
:rules="rules"
|
|
|
ref="byform"
|
|
|
>
|
|
|
- <template #address>
|
|
|
- <el-row style="width: 100%">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="countryId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.countryId"
|
|
|
- placeholder="国家"
|
|
|
- @change="(val) => getCityData(val, '20', true)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in countryData"
|
|
|
- :label="item.chineseName"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="provinceId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.provinceId"
|
|
|
- placeholder="省/洲"
|
|
|
- @change="(val) => getCityData(val, '30', true)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in provinceData"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="cityId">
|
|
|
- <el-select v-model="formData.data.cityId" placeholder="城市">
|
|
|
- <el-option
|
|
|
- v-for="item in cityData"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row style="margin-top: 20px; width: 100%">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item prop="detailedAddress">
|
|
|
- <el-input
|
|
|
- v-model="formData.data.detailedAddress"
|
|
|
- type="textarea"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </template>
|
|
|
<template #products>
|
|
|
<div style="width: 100%">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
- @click="openProduct = true"
|
|
|
+ @click="handleOpen"
|
|
|
style="margin-bottom: 10px"
|
|
|
+ v-if="modalType == 'add'"
|
|
|
>
|
|
|
- 添加物品
|
|
|
+ 选择产品
|
|
|
</el-button>
|
|
|
- <el-table :data="formData.data.orderDetailsList">
|
|
|
- <el-table-column prop="productCode" label="产品编码" />
|
|
|
- <el-table-column prop="productName" label="产品名称" />
|
|
|
- <el-table-column prop="price" label="单价" min-width="150">
|
|
|
+ <el-table :data="formData.data.list">
|
|
|
+ <el-table-column
|
|
|
+ prop="productType"
|
|
|
+ label="物品类型"
|
|
|
+ :formatter="
|
|
|
+ (row) => (row.productType == '1' ? '成品' : '半成品')
|
|
|
+ "
|
|
|
+ />
|
|
|
+ <el-table-column prop="productCode" label="物品编码" />
|
|
|
+ <el-table-column prop="productName" label="物品名称" />
|
|
|
+ <el-table-column prop="productSpec" label="规格型号" />
|
|
|
+ <el-table-column prop="productUnit" label="单位" />
|
|
|
+ <el-table-column
|
|
|
+ prop="quantity"
|
|
|
+ label="待质检数量"
|
|
|
+ v-if="modalType == 'add'"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="qualifiedQuantity"
|
|
|
+ label="质检合格"
|
|
|
+ min-width="150"
|
|
|
+ >
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="'orderDetailsList.' + $index + '.price'"
|
|
|
- :rules="rules.price"
|
|
|
+ :prop="'list.' + $index + '.qualifiedQuantity'"
|
|
|
+ :rules="rules.qualifiedQuantity"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
<el-input-number
|
|
|
- v-model="row.price"
|
|
|
+ v-model="row.qualifiedQuantity"
|
|
|
:precision="4"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- @change="totalAmount"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="quantity" label="数量" min-width="150">
|
|
|
+ <el-table-column
|
|
|
+ prop="disqualificationQuantity"
|
|
|
+ label="质检不合格"
|
|
|
+ min-width="150"
|
|
|
+ >
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="'orderDetailsList.' + $index + '.quantity'"
|
|
|
- :rules="rules.quantity"
|
|
|
+ :prop="'list.' + $index + '.disqualificationQuantity'"
|
|
|
+ :rules="rules.disqualificationQuantity"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
<el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
+ v-model="row.disqualificationQuantity"
|
|
|
:precision="4"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- @change="totalAmount"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="total" label="小计" />
|
|
|
- <el-table-column prop="remark" label="备注" min-width="200">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'orderDetailsList.' + $index + '.remark'"
|
|
|
- :rules="rules.remark"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input v-model="row.remark" placeholder="请输入" />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
prop="zip"
|
|
|
label="操作"
|
|
|
width="60"
|
|
|
fixed="right"
|
|
|
align="center"
|
|
|
+ v-if="modalType == 'add'"
|
|
|
>
|
|
|
<template #default="{ $index }">
|
|
|
<el-button type="primary" link @click="handleRemove($index)"
|
|
@@ -184,7 +127,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
- <template #footer>
|
|
|
+ <template #footer v-if="modalType == 'add'">
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
@@ -202,30 +145,23 @@
|
|
|
width="70%"
|
|
|
append-to-body
|
|
|
>
|
|
|
- <SelectProduct @handleSelect="handleSelect"></SelectProduct>
|
|
|
+ <byTable
|
|
|
+ :hideSearch="true"
|
|
|
+ :source="sourceList.dataOne"
|
|
|
+ :pagination="sourceList.paginationOne"
|
|
|
+ :config="configOne"
|
|
|
+ highlight-current-row
|
|
|
+ :selectConfig="[]"
|
|
|
+ :table-events="{}"
|
|
|
+ :action-list="[]"
|
|
|
+ >
|
|
|
+ </byTable>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="openProduct = false">取消</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
- <el-dialog
|
|
|
- v-model="openDetails"
|
|
|
- title="订单详情"
|
|
|
- width="40%"
|
|
|
- append-to-body
|
|
|
- >
|
|
|
- <OrderDetails
|
|
|
- :orderData="formData.orderData"
|
|
|
- :key="formData.orderData.id"
|
|
|
- ></OrderDetails>
|
|
|
- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button @click="openDetails = false">取消</el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -243,11 +179,17 @@ const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
|
+ dataOne: [],
|
|
|
pagination: {
|
|
|
total: 3,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
+ paginationOne: {
|
|
|
+ total: 3,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
});
|
|
|
let dialogVisible = ref(false);
|
|
|
let openProduct = ref(false);
|
|
@@ -256,214 +198,148 @@ let openDetails = ref(false);
|
|
|
let roomDialogVisible = ref(false);
|
|
|
let modalType = ref("add");
|
|
|
let rules = ref({
|
|
|
- customerInfoId: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择客户",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- type: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择订单类型",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- countryId: [
|
|
|
+ qualifiedQuantity: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择国家",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- provinceId: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择省/洲",
|
|
|
- trigger: "change",
|
|
|
+ message: "请输入质检合格数量",
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- cityId: [
|
|
|
+ disqualificationQuantity: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择城市",
|
|
|
- trigger: "change",
|
|
|
+ message: "请输入质检合格数量",
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
+});
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const selectConfig = reactive([]);
|
|
|
|
|
|
- contacts: [
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
{
|
|
|
- required: true,
|
|
|
- message: "请输入姓名",
|
|
|
- trigger: "blur",
|
|
|
+ attrs: {
|
|
|
+ label: "质检单号",
|
|
|
+ prop: "code",
|
|
|
+ slot: "code",
|
|
|
+ },
|
|
|
},
|
|
|
- ],
|
|
|
- phone: [
|
|
|
{
|
|
|
- required: true,
|
|
|
- message: "请输入联系电话",
|
|
|
- trigger: "blur",
|
|
|
+ attrs: {
|
|
|
+ label: "物品编码",
|
|
|
+ prop: "productCode",
|
|
|
+ },
|
|
|
},
|
|
|
- ],
|
|
|
- detailedAddress: [
|
|
|
{
|
|
|
- required: true,
|
|
|
- message: "请输入详细地址",
|
|
|
- trigger: "blur",
|
|
|
+ attrs: {
|
|
|
+ label: "物品名称",
|
|
|
+ prop: "productName",
|
|
|
+ },
|
|
|
},
|
|
|
- ],
|
|
|
- price: [
|
|
|
{
|
|
|
- required: true,
|
|
|
- message: "请输入单价",
|
|
|
- trigger: "blur",
|
|
|
+ attrs: {
|
|
|
+ label: "规格型号",
|
|
|
+ prop: "productSpec",
|
|
|
+ },
|
|
|
},
|
|
|
- ],
|
|
|
- quantity: [
|
|
|
{
|
|
|
- required: true,
|
|
|
- message: "请输入数量",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
-});
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
-const selectConfig = reactive([
|
|
|
- {
|
|
|
- label: "订单类型",
|
|
|
- prop: "type",
|
|
|
- data: [],
|
|
|
- },
|
|
|
- {
|
|
|
- label: "订单状态",
|
|
|
- prop: "status",
|
|
|
- data: [
|
|
|
- {
|
|
|
- label: "进行中",
|
|
|
- value: "1",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "已完成",
|
|
|
- value: "2",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "已取消",
|
|
|
- value: "3",
|
|
|
+ attrs: {
|
|
|
+ label: "单位",
|
|
|
+ prop: "productUnit",
|
|
|
},
|
|
|
- ],
|
|
|
- },
|
|
|
-]);
|
|
|
-
|
|
|
-const config = computed(() => {
|
|
|
- return [
|
|
|
+ },
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "订单类型",
|
|
|
- prop: "type",
|
|
|
+ label: "合格数量",
|
|
|
+ prop: "qualifiedQuantity",
|
|
|
},
|
|
|
- render(type) {
|
|
|
- return proxy.dictDataEcho(type, salesType.value);
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "不合格数量",
|
|
|
+ prop: "disqualificationQuantity",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "订单编号",
|
|
|
- prop: "code",
|
|
|
- slot: "code",
|
|
|
+ label: "质检人员",
|
|
|
+ prop: "qualityUserName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "客户名称",
|
|
|
- prop: "customerName",
|
|
|
+ label: "质检日期",
|
|
|
+ prop: "createTime",
|
|
|
},
|
|
|
},
|
|
|
+ ];
|
|
|
+});
|
|
|
+const configOne = computed(() => {
|
|
|
+ return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "订单金额",
|
|
|
- prop: "amountMoney",
|
|
|
+ label: "物品类型",
|
|
|
+ prop: "productType",
|
|
|
},
|
|
|
- render(money) {
|
|
|
- return proxy.moneyFormat(money, 4);
|
|
|
+ render(type) {
|
|
|
+ return type == 1 ? "成品" : "半成品";
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "收件人",
|
|
|
- prop: "contacts",
|
|
|
+ label: "物品编码",
|
|
|
+ prop: "productCode",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "联系电话",
|
|
|
- prop: "phone",
|
|
|
+ label: "物品名称",
|
|
|
+ prop: "productName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "收件城市",
|
|
|
- prop: "address",
|
|
|
- slot: "address",
|
|
|
+ label: "规格型号",
|
|
|
+ prop: "productSpec",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "下单时间",
|
|
|
- prop: "createTime",
|
|
|
+ label: "单位",
|
|
|
+ prop: "productUnit",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "订单状态",
|
|
|
- prop: "status",
|
|
|
- },
|
|
|
- render(status) {
|
|
|
- return status == 1 ? "进行中" : status == 2 ? "已完成" : "已取消";
|
|
|
+ label: "待质检数量",
|
|
|
+ prop: "quantity",
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
- width: "200",
|
|
|
+ width: "100",
|
|
|
align: "right",
|
|
|
},
|
|
|
- // 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
- row.status == 1
|
|
|
- ? {
|
|
|
- attrs: {
|
|
|
- label: "结束",
|
|
|
- type: "primary",
|
|
|
- text: true,
|
|
|
- },
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- getDtl(row, 2);
|
|
|
- },
|
|
|
- }
|
|
|
- : {},
|
|
|
- row.status == 1
|
|
|
- ? {
|
|
|
- attrs: {
|
|
|
- label: "取消",
|
|
|
- type: "primary",
|
|
|
- text: true,
|
|
|
- },
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- getDtl(row, 3);
|
|
|
- },
|
|
|
- }
|
|
|
- : {},
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "选择",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ handleSelect(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
];
|
|
|
},
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
-
|
|
|
let formData = reactive({
|
|
|
data: {},
|
|
|
treeData: [],
|
|
@@ -479,141 +355,92 @@ const byform = ref(null);
|
|
|
const treeData = ref([]);
|
|
|
const formConfig = reactive([
|
|
|
{
|
|
|
- type: "select",
|
|
|
- prop: "customerInfoId",
|
|
|
- label: "客户名称",
|
|
|
- isLoad: {
|
|
|
- url: "/customer/page",
|
|
|
- req: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 9999,
|
|
|
- },
|
|
|
- labelKey: "name",
|
|
|
- labelVal: "id",
|
|
|
- method: "post",
|
|
|
- resUrl: "rows",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- prop: "type",
|
|
|
- label: "订单类型",
|
|
|
- itemWidth: 100,
|
|
|
- data: [],
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "contacts",
|
|
|
- label: "收件人",
|
|
|
- itemWidth: 20,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "phone",
|
|
|
- label: " ",
|
|
|
- itemWidth: 30,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "slot",
|
|
|
- slotName: "address",
|
|
|
- prop: "countryId",
|
|
|
- label: "收件地址",
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
type: "title",
|
|
|
- title: "订单明细",
|
|
|
+ title: "质检明细",
|
|
|
},
|
|
|
{
|
|
|
type: "slot",
|
|
|
slotName: "products",
|
|
|
},
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "amountMoney",
|
|
|
- label: "订单金额",
|
|
|
- disabled: true,
|
|
|
- itemWidth: 20,
|
|
|
- },
|
|
|
]);
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
- proxy.post("/orderInfo/page", sourceList.value.pagination).then((message) => {
|
|
|
- console.log(message);
|
|
|
- sourceList.value.data = message.rows;
|
|
|
- sourceList.value.pagination.total = message.total;
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false;
|
|
|
- }, 200);
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .post("/jdBackQualityDetails/page", sourceList.value.pagination)
|
|
|
+ .then((message) => {
|
|
|
+ console.log(message);
|
|
|
+ sourceList.value.data = message.rows;
|
|
|
+ sourceList.value.pagination.total = message.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
};
|
|
|
const openModal = () => {
|
|
|
dialogVisible.value = true;
|
|
|
modalType.value = "add";
|
|
|
formData.data = {
|
|
|
- orderDetailsList: [],
|
|
|
+ list: [],
|
|
|
countryId: "China",
|
|
|
};
|
|
|
getCityData(formData.data.countryId, "20");
|
|
|
};
|
|
|
|
|
|
const submitForm = () => {
|
|
|
- console.log(byform.value);
|
|
|
byform.value.handleSubmit((valid) => {
|
|
|
- const list = formData.data.orderDetailsList;
|
|
|
+ const list = formData.data.list;
|
|
|
if (!list.length > 0)
|
|
|
return ElMessage({
|
|
|
- message: `请添加订单明细!`,
|
|
|
+ message: `请添加质检明细!`,
|
|
|
type: "info",
|
|
|
});
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
const e = list[i];
|
|
|
- if (e.quantity == 0) {
|
|
|
+ if (e.qualifiedQuantity + e.disqualificationQuantity == 0) {
|
|
|
return ElMessage({
|
|
|
- message: `数量不能为0!`,
|
|
|
+ message: `质检数量不能为0!`,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ e.qualifiedQuantity + e.disqualificationQuantity >
|
|
|
+ Number(e.quantity)
|
|
|
+ ) {
|
|
|
+ return ElMessage({
|
|
|
+ message: `质检合格数量加不合格数量不能大于待质检数量!`,
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
submitLoading.value = true;
|
|
|
- proxy.post("/orderInfo/" + modalType.value, formData.data).then(
|
|
|
- (res) => {
|
|
|
- ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- dialogVisible.value = false;
|
|
|
- submitLoading.value = false;
|
|
|
- getList();
|
|
|
- },
|
|
|
- (err) => (submitLoading.value = false)
|
|
|
- );
|
|
|
+ proxy
|
|
|
+ .post("/jdBackQualityDetails/" + modalType.value, formData.data.list)
|
|
|
+ .then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => (submitLoading.value = false)
|
|
|
+ );
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const getDtl = (row, status) => {
|
|
|
- const statusNmae = status == 2 ? "结束" : "取消";
|
|
|
- // 弹窗提示是否删除
|
|
|
- ElMessageBox.confirm(`您确定执行${statusNmae}操作吗?`, "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- // 删除
|
|
|
- proxy
|
|
|
- .post("/orderInfo/edit", {
|
|
|
- id: row.id,
|
|
|
- status,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- ElMessage({
|
|
|
- message: "操作成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- getList();
|
|
|
- });
|
|
|
- });
|
|
|
+const getDtl = (row) => {
|
|
|
+ modalType.value = "edit";
|
|
|
+ proxy
|
|
|
+ .post("/jdBackQualityDetails/detail", {
|
|
|
+ code: row.code,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ formData.data.list = res;
|
|
|
+ dialogVisible.value = true;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const warehouseList = ref([]);
|
|
@@ -660,30 +487,30 @@ getDict();
|
|
|
|
|
|
const totalAmount = () => {
|
|
|
let sum = 0;
|
|
|
- for (let i = 0; i < formData.data.orderDetailsList.length; i++) {
|
|
|
- const e = formData.data.orderDetailsList[i];
|
|
|
- e.total = (e.price * 1000000 * e.quantity) / 1000000;
|
|
|
+ for (let i = 0; i < formData.data.list.length; i++) {
|
|
|
+ const e = formData.data.list[i];
|
|
|
+ e.total = (e.qualifiedQuantity * 1000000 * e.quantity) / 1000000;
|
|
|
sum += e.total;
|
|
|
}
|
|
|
formData.data.amountMoney = sum;
|
|
|
};
|
|
|
|
|
|
const handleSelect = (row) => {
|
|
|
- const flag = formData.data.orderDetailsList.some(
|
|
|
- (x) => x.productId === row.id
|
|
|
- );
|
|
|
+ const flag = formData.data.list.some((x) => x.productId === row.productId);
|
|
|
if (flag)
|
|
|
return ElMessage({
|
|
|
message: "该物品已选择",
|
|
|
type: "info",
|
|
|
});
|
|
|
- formData.data.orderDetailsList.push({
|
|
|
- productName: row.name,
|
|
|
- productCode: row.code,
|
|
|
- productId: row.id,
|
|
|
- total: "",
|
|
|
- quantity: null,
|
|
|
- price: null,
|
|
|
+ formData.data.list.push({
|
|
|
+ productId: row.productId,
|
|
|
+ productName: row.productName,
|
|
|
+ productCode: row.productCode,
|
|
|
+ productSpec: row.productSpec,
|
|
|
+ productUnit: row.productUnit,
|
|
|
+ quantity: row.quantity,
|
|
|
+ qualifiedQuantity: null,
|
|
|
+ disqualificationQuantity: null,
|
|
|
});
|
|
|
return ElMessage({
|
|
|
message: "选择成功",
|
|
@@ -692,7 +519,7 @@ const handleSelect = (row) => {
|
|
|
};
|
|
|
|
|
|
const handleRemove = (index) => {
|
|
|
- formData.data.orderDetailsList.splice(index, 1);
|
|
|
+ formData.data.list.splice(index, 1);
|
|
|
totalAmount();
|
|
|
return ElMessage({
|
|
|
message: "删除成功",
|
|
@@ -704,6 +531,16 @@ const handleClickCode = (row) => {
|
|
|
formData.orderData = row;
|
|
|
openDetails.value = true;
|
|
|
};
|
|
|
+
|
|
|
+const handleOpen = () => {
|
|
|
+ proxy
|
|
|
+ .post("/jdBackQualityWait/page", { pageNum: 1, pageSize: 9999 })
|
|
|
+ .then((res) => {
|
|
|
+ sourceList.value.dataOne = res.rows;
|
|
|
+ sourceList.value.paginationOne.total = res.total;
|
|
|
+ openProduct.value = true;
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|