Browse Source

详情页

1018653686@qq.com 1 year ago
parent
commit
e3fd988e44
2 changed files with 87 additions and 30 deletions
  1. 9 2
      src/components/headerBar/header-bar.vue
  2. 78 28
      src/views/WDLY/jd/order/index.vue

+ 9 - 2
src/components/headerBar/header-bar.vue

@@ -244,8 +244,15 @@
             class="jdTokenStatus"
             style="display: flex; align-items: center; justify-content: center"
         >
-          <img v-if="tokenStatus" :src="'/img/jd-on.jpg'" style="width: 40px"/>
-          <img v-if="!tokenStatus" :src="'/img/jd-off.jpg'" style="width: 40px" @click="changeJdLoginModal"/>
+
+          <div v-if="tokenStatus" style="width: 40px;text-align: center; cursor: pointer;">
+            <img :src="'/img/jd-on.jpg'" style="width: 25px;display: block;margin: 0 auto"/>
+            <span style="color: white;font-size: 12px;display: block;">在线</span>
+          </div>
+          <div v-if="!tokenStatus" style="width: 40px;text-align: center; cursor: pointer;"  @click="changeJdLoginModal">
+            <img :src="'/img/jd-off.jpg'" style="width: 25px;display: block;margin: 0 auto"/>
+            <span style="color: white;font-size: 12px;display: block;">离线</span>
+          </div>
         </div>
       <jdStatus v-model="jdLoginModal" :iframeUrl="jdLoginUrl"></jdStatus>
         <div class="fr">

+ 78 - 28
src/views/WDLY/jd/order/index.vue

@@ -14,8 +14,9 @@
                 @get-list="getList">
         </byTable>
 
-        <el-dialog z-index="1500" title="采购单详情" v-if="dialogVisible" v-model="dialogVisible" width="1500px" v-loading="loading">
-            <el-form label-width="auto">
+        <el-dialog :z-index="1500" :title="formData.data.businessStatus=='1'?'采购单回告':'采购单详情'" v-if="dialogVisible" v-model="dialogVisible" width="1500px" v-loading="loading">
+            <el-descriptions title="基础信息" />
+            <el-form label-width="auto" :rules="rules">
                 <el-row>
                     <el-col :span="8">
                         <el-form-item label="京东订单号:" :span="8">
@@ -50,18 +51,52 @@
                         </el-form-item>
                     </el-col>
                 </el-row>
+                <el-row>
+                    <el-descriptions title="采购单明细" />
+                    <el-table :data="formData.data.jdOrderDetailsList" stripe style="width: 100%">
+        <!--            <el-table stripe style="width: 100%">-->
+                        <el-table-column prop="wareId" label="商品编号" width="180" />
+                        <el-table-column prop="deliverCenterName" label="配送中心名称" width="180" />
+                        <el-table-column prop="wareName" label="商品名称" />
+                        <el-table-column prop="purchasePrice" label="采购价" />
+                        <el-table-column prop="originalNum" label="原始采购数量" />
+                        <el-table-column v-if="formData.data.businessStatus!='0'" prop="confirmNum" label="确认数量" >
+                            <template v-slot="scope">
+                                <el-form-item :rules="rules['confirmNum']">
+                                    <el-input-number v-if="formData.data.businessStatus=='1'" :min="1" :step="1" :max="scope.row.originalNum" v-model="scope.row.confirmNum" placeholder="请输入确认数量"/>
+                                </el-form-item>
+                                <span v-if="formData.data.businessStatus=='2'">{{scope.row.confirmNum}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column v-if="formData.data.businessStatus!='0'" prop="nonDeliveryReason" label="不满足发货原因">
+                            <template v-slot="scope">
+                                <el-form-item :rules="rules['nonDeliveryReason']">
+                                    <el-input v-if="formData.data.businessStatus=='1'" v-model="scope.row.nonDeliveryReason" placeholder="请输入不满足发货原因" />
+                                </el-form-item>
+                                <span v-if="formData.data.businessStatus=='2'">{{scope.row.nonDeliveryReason}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column v-if="formData.data.businessStatus!='0'" prop="deliverCenterId" label="配送中心">
+                            <template v-slot="scope">
+                                <el-form-item :rules="rules['deliverCenterId']">
+                                    <el-select v-if="formData.data.businessStatus=='1'" v-model="scope.row.deliverCenterId" placeholder="请选择" >
+                                        <el-option
+                                                v-for="item in deliveryCenter"
+                                                :label="item.dictValue"
+                                                :value="item.dictKey"
+                                        >
+                                        </el-option>
+                                    </el-select>
+                                </el-form-item>
+                                <span v-if="formData.data.businessStatus=='2'">{{scope.row.deliverCenterName}}</span>
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                </el-row>
             </el-form>
-            <el-table :data="formData.data.jdOrderDetailsList" stripe style="width: 100%">
-<!--            <el-table stripe style="width: 100%">-->
-                <el-table-column prop="wareId" label="商品编号" width="180" />
-                <el-table-column prop="deliverCenterName" label="配送中心名称" width="180" />
-                <el-table-column prop="wareName" label="商品名称" />
-                <el-table-column prop="purchasePrice" label="采购价" />
-                <el-table-column prop="originalNum" label="原始采购数量" />
-            </el-table>
             <template #footer>
                 <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-                <el-button type="primary" v-if="formData.data.businessStatus == 1" @click="submitForm" size="large" :loading="submitLoading">确 定</el-button>
+                <el-button type="primary" v-if="formData.data.businessStatus == 1" @click="submitForm" size="large" :loading="submitLoading">采购单回告</el-button>
             </template>
         </el-dialog>
     </div>
@@ -76,6 +111,7 @@ const { proxy } = getCurrentInstance();
 
 const router = useRouter();
 const loading = ref(false);
+const deliveryCenter = ref([]);
 const blessingTypeList = ref([]);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -88,6 +124,9 @@ const sourceList = ref({
 });
 
 let rules = ref({
+    deliverCenterId: [{ required: true, message: "请选择配送中心", trigger: "blur" }],
+    nonDeliveryReason: [{ required: true, message: "请输入不满足发货原因", trigger: "blur" }],
+    confirmNum: [{ required: true, message: "请输入确认数量", trigger: "blur" }]
 });
 let dialogVisible = ref(false);
 let modalType = ref("add");
@@ -166,7 +205,13 @@ const config = computed(() => {
                 align: "center",
             },
             render(value) {
-                return value == '1' ? "已确认" : "未确认";
+                let label = "未确认";
+                if(value == '1'){
+                    label = "已确认";
+                }else if (value == '2'){
+                    label = "已回告";
+                }
+                return label;
             },
         },
         {
@@ -179,7 +224,7 @@ const config = computed(() => {
                 return [
                     {
                         attrs: {
-                            label: "详情",
+                            label: row.businessStatus=='1'?"采购单回告":"详情",
                             type: "primary",
                             text: true,
                         },
@@ -197,7 +242,7 @@ const config = computed(() => {
                             },
                             el: "button",
                             click() {
-                                ElMessageBox.confirm("是否确认当前采购单?", "提示", {
+                                ElMessageBox.confirm("是否确认当前采购单状态?", "提示", {
                                     confirmButtonText: "确定",
                                     cancelButtonText: "取消",
                                     type: "warning",
@@ -250,16 +295,12 @@ const formConfig = computed(() => {
 });
 
 const getDictlist = async () => {
-    // proxy
-    //     .getDictOne([
-    //         "blessing_type"
-    //     ])
-    //     .then((res) => {
-    //         blessingTypeList.value = res["blessing_type"].map((x) => ({
-    //             label: x.dictValue,
-    //             value: x.dictKey,
-    //         }));
-    //     });
+    proxy.getDictOne(["delivery_center"]).then((res) => {
+        deliveryCenter.value = res["delivery_center"].map((x) => ({
+            label: x.dictValue,
+            value: x.dictKey,
+        }));
+    });
 };
 
 const getList = async (req) => {
@@ -297,9 +338,12 @@ const getDtl = (row) => {
 };
 
 
+/**
+ * 确认采购单状态
+ * @param row
+ */
 const confirmBusinessStatus = (row) => {
     let businessStatus = row.businessStatus=='1' ? 0 : 1;
-
     proxy.post("/jdOrder/confirmBusinessStatus", { id: row.id, businessStatus: businessStatus }).then(
         () => {
             ElMessage({
@@ -317,14 +361,19 @@ const confirmBusinessStatus = (row) => {
     );
 }
 
+//订单回告
 const submitForm = () => {
-    byform.value.handleSubmit(() => {
+    ElMessageBox.confirm("是否确认回告当前采购单?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+    }).then(() => {
         submitLoading.value = true;
         //TODO 这里应该是订单回告
-        proxy.post("/jdOrder/" + modalType.value, formData.data).then(
+        proxy.post("/jdOrder/tellBackOrer", formData.data).then(
             () => {
                 ElMessage({
-                    message: modalType.value == "add" ? "添加成功" : "编辑成功",
+                    message: "回告成功",
                     type: "success",
                 });
                 dialogVisible.value = false;
@@ -337,6 +386,7 @@ const submitForm = () => {
             }
         );
     });
+
 };