|
@@ -7,16 +7,53 @@
|
|
|
:loading="loading"
|
|
|
:searchConfig="searchConfig"
|
|
|
highlight-current-row
|
|
|
+ :action-list="[
|
|
|
+ {
|
|
|
+ text: '同步万里牛售后单',
|
|
|
+ action: () => clickSynchronousOrder(),
|
|
|
+ loading: btnLoading,
|
|
|
+ },
|
|
|
+ ]"
|
|
|
@get-list="getList"
|
|
|
@clickReset="clickReset"
|
|
|
:spanMethod="spanMethod"
|
|
|
:borderStatus="true">
|
|
|
</byTable>
|
|
|
+
|
|
|
+ <el-dialog title="质检" v-if="openQualityTesting" v-model="openQualityTesting" width="500px">
|
|
|
+ <el-form :model="rowData" ref="submit" :rules="rules" v-loading="loadingQualityTesting">
|
|
|
+ <div style="margin: 10px 0; font-weight: 700; font-size: 18px; color: black">请根据质检结果选择,此裸垫是否可二次销售</div>
|
|
|
+ <template v-if="rowData.orderExchangeDetailList && rowData.orderExchangeDetailList.length > 0">
|
|
|
+ <div v-for="(item, index) in rowData.orderExchangeDetailList" :key="index" style="margin-top: 20px">
|
|
|
+ <div style="margin-bottom: 10px">SKU品号:{{ item.skuSpecCode }}</div>
|
|
|
+ <el-form-item
|
|
|
+ label="质检通过数量"
|
|
|
+ :prop="'orderExchangeDetailList.' + index + '.checkPassesQuantity'"
|
|
|
+ :rules="rules.checkPassesQuantity"
|
|
|
+ :inline-message="true">
|
|
|
+ <el-input-number
|
|
|
+ onmousewheel="return false;"
|
|
|
+ v-model="item.checkPassesQuantity"
|
|
|
+ placeholder="数量"
|
|
|
+ style="width: 100%"
|
|
|
+ :controls="false"
|
|
|
+ :min="0"
|
|
|
+ :precision="0" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openQualityTesting = false" size="large" v-preReClick>取 消</el-button>
|
|
|
+ <el-button type="primary" @click="clickSubmit()" size="large" v-preReClick>质检完成</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</el-card>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import byTable from "/src/components/byTable/index";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const departmentList = ref([]);
|
|
@@ -30,9 +67,20 @@ const sourceList = ref({
|
|
|
orderCode: "",
|
|
|
orderWlnCode: "",
|
|
|
departmentId: "",
|
|
|
+ status: 0,
|
|
|
},
|
|
|
});
|
|
|
const loading = ref(false);
|
|
|
+const status = ref([
|
|
|
+ {
|
|
|
+ dictKey: 0,
|
|
|
+ dictValue: "待质检",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 1,
|
|
|
+ dictValue: "已质检入库",
|
|
|
+ },
|
|
|
+]);
|
|
|
const searchConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -56,6 +104,12 @@ const searchConfig = computed(() => {
|
|
|
data: departmentList.value,
|
|
|
label: "事业部",
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "status",
|
|
|
+ data: status.value,
|
|
|
+ label: "质检状态",
|
|
|
+ },
|
|
|
];
|
|
|
});
|
|
|
const config = computed(() => {
|
|
@@ -114,6 +168,16 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "质检状态",
|
|
|
+ prop: "status",
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ render(val) {
|
|
|
+ return proxy.dictKeyValue(val, status.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "操作人",
|
|
|
prop: "createUserName",
|
|
|
},
|
|
@@ -121,12 +185,25 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
- width: 100,
|
|
|
+ width: 140,
|
|
|
align: "center",
|
|
|
fixed: "right",
|
|
|
},
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
+ row.status === 0
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "质检",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ clickQualityTesting(row);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "查看详情",
|
|
@@ -204,6 +281,8 @@ const getList = async (req, status) => {
|
|
|
returnAmount: res.rows[i].orderExchangeDetailList[j].returnAmount,
|
|
|
createTime: res.rows[i].createTime,
|
|
|
createUserName: res.rows[i].createUserName,
|
|
|
+ status: res.rows[i].status,
|
|
|
+ orderExchangeDetailList: res.rows[i].orderExchangeDetailList,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -240,6 +319,62 @@ const spanMethod = ({ rowIndex, columnIndex }) => {
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
+const rowData = ref({});
|
|
|
+const openQualityTesting = ref(false);
|
|
|
+const loadingQualityTesting = ref(false);
|
|
|
+const rules = ref({
|
|
|
+ checkPassesQuantity: [{ required: true, message: "请输入质检通过数量", trigger: "blur" }],
|
|
|
+});
|
|
|
+const clickQualityTesting = (item) => {
|
|
|
+ rowData.value = proxy.deepClone(item);
|
|
|
+ if (rowData.value.orderExchangeDetailList && rowData.value.orderExchangeDetailList.length > 0) {
|
|
|
+ rowData.value.orderExchangeDetailList = rowData.value.orderExchangeDetailList.map((row) => {
|
|
|
+ return {
|
|
|
+ ...row,
|
|
|
+ checkPassesQuantity: row.quantity,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ loadingQualityTesting.value = false;
|
|
|
+ openQualityTesting.value = true;
|
|
|
+};
|
|
|
+const clickSubmit = () => {
|
|
|
+ proxy.$refs.submit.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ loadingQualityTesting.value = true;
|
|
|
+ proxy.post("/orderExchange/orderExchangeCheck", rowData.value).then(
|
|
|
+ () => {
|
|
|
+ ElMessage({ message: "质检完成", type: "success" });
|
|
|
+ openQualityTesting.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err);
|
|
|
+ loadingQualityTesting.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+const btnLoading = ref(false);
|
|
|
+const clickSynchronousOrder = () => {
|
|
|
+ btnLoading.value = true;
|
|
|
+ proxy.post("/orderHandle/resynchronizationReturnOrder", {}).then(
|
|
|
+ () => {
|
|
|
+ ElMessage.success("同步完成成功");
|
|
|
+ btnLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ ElMessage.error(`同步失败: ${err} !`);
|
|
|
+ btnLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep(.el-input-number .el-input__inner) {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+</style>
|