sakura 1 rok temu
rodzic
commit
2fc00b5308

+ 10 - 0
manager-admin/src/api/basicSetting.js

@@ -384,3 +384,13 @@ export function deleteCustomer(id) {
     method: 'delete'
   })
 }
+
+/* 获取销售人员 /admin/systems/manager/admin-users/getUserByDept*/
+export function getUserByDept(params) {
+  return request({
+    url: '/admin/systems/manager/admin-users/getUserByDept',
+    method: 'get',
+    loading: false,
+    params
+  })
+}

+ 5 - 3
manager-admin/src/api/order.js

@@ -259,7 +259,7 @@ export function payment(id) {
 /* 快递鸟发货 /admin/erp/order/kdShip */
 export function getKdShip(id,order) {
   return request({
-    url: `/admin/erp/order/kdShip/${id}`,
+    url: `/admin/erp/kdn/kdShip/${id}`,
     method: 'post',
     headers: { 'Content-Type': 'application/json' },
     data: order
@@ -267,9 +267,11 @@ export function getKdShip(id,order) {
 }
 
 /* 发货 /admin/erp/order/orderSend/{orderId} */
-export function outOrderSend(id) {
+export function outOrderSend(id,param) {
   return request({
     url: `/admin/erp/order/orderSend/${id}`,
-    method: 'post'
+    method: 'post',
+    headers: { 'Content-Type': 'application/json' },
+    data:param
   })
 }

+ 1 - 1
manager-admin/src/components/SkuEditor/src/helper.js

@@ -208,7 +208,7 @@ export const makeTableForm = (selectedSpecs, params, skuList, haveSpec,hire_or_s
     if(hire_or_sail=="sail" && param.name!=='日租金'){
        return tableHead.push(param)
     }else{
-      let arr1=['sku','日租金','条码','序列号']
+      let arr1=['sku','日租金','条码','序列号','单位']
       arr1.map(el=>{
         el==param.name? tableHead.push(param):''
       })

+ 1 - 0
manager-admin/src/router/index.js

@@ -108,6 +108,7 @@ const asyncRouters = [
       { path: 'goods-inventory-check/:id?', component: () => import('@/views/stock/goodsInventory/goodsInventoryAdd'), name: 'goodsInventoryCheck', meta: { title: 'goodsInventoryCheck', noCache: true }, hidden: true },
       { path: 'goods-understock', component: () => import('@/views/stock/goodsUnderstock'), name: 'goodsUnderstock', meta: { title: 'goodsUnderstock' } },
       { path: 'goods-understock-add', component: () => import('@/views/stock/goodsUnderstockAdd'), name: 'goodsUnderstockAdd', meta: { title: 'goodsUnderstockAdd', noCache: true }, hidden: true },
+      { path: 'goods-understock-detail/:id?', component: () => import('@/views/stock/goodsUnderstockAdd'), name: 'goodsUnderstockDetail', meta: { title: 'goodsUnderstockDetail', noCache: true }, hidden: true },
       { path: 'warehouseList', component: () => import('@/views/stock/warehouseList'), name: 'warehouseList', meta: { title: 'warehouseList' } },
       { path: 'goods-exchange-add', component: () => import('@/views/stock/goodsExchange/goodsExchangeAdd'), name: 'goodsExchangeOut', meta: { title: 'goodsExchangeOut', noCache: true }, hidden: true },
       // { path: 'push-record', component: () => import('@/views/stock/pushRecord'), name: 'pushRecord', meta: { title: 'pushRecord' }}addInventory

+ 43 - 24
manager-admin/src/views/stock/goodsExchange/addInventory.vue

@@ -95,32 +95,42 @@
           >
             <el-table-column label="商品编号">
               <template slot-scope="scope">
-                {{ scope.row.sn }}
+                {{ scope.row.goods_vo.sn }}
               </template>
             </el-table-column>
             <el-table-column label="商品名称">
               <template slot-scope="scope">
-                {{ scope.row.name }}
+                {{ scope.row.goods_vo.name }}
               </template>
             </el-table-column>
             <el-table-column label="条码">
               <template slot-scope="scope">
-                {{ scope.row.product_barcode }}
+                <!-- {{ scope.row.bar_code }} -->
+                <span v-if="id">{{ scope.row.product_vo.bar_code }}</span>
+              <span v-else>{{ scope.row.bar_code }}</span>
               </template>
             </el-table-column>
             <el-table-column label="序列号">
               <template slot-scope="scope">
-                {{ scope.row.sn_code }}
+                <!-- {{ scope.row.sn_code }} -->
+                <span v-if="id">{{ scope.row.product_vo.sn_code }}</span>
+              <span v-else>{{ scope.row.sn_code }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="规格型号">
+            <el-table-column label="规格型号" v-if="id">
               <template slot-scope="scope">
-                {{ scope.row.goods_style }}
+                {{ scope.row.product_vo.spec_name.join('/') }}
+              </template>
+            </el-table-column>
+            <el-table-column label="规格型号" v-else>
+              <template slot-scope="scope">
+                {{ scope.row.spec_name.join('/') }}
               </template>
             </el-table-column>
             <el-table-column label="单位">
               <template slot-scope="scope">
-                {{ scope.row.goods_unit }}
+              <span v-if="id">{{ scope.row.product_vo.unit }}</span>
+              <span v-else>{{ scope.row.unit }}</span>
               </template>
             </el-table-column>
            <!--  <el-table-column label="订单数量">
@@ -128,26 +138,25 @@
             </el-table-column> -->
             <el-table-column label="入库数量">
               <template slot-scope="scope">
-                <el-input
+                <el-input-number
                   v-model="scope.row.num"
                   type="number"
                   :min="0"
                   :maxlength="20"
                   :disabled="type === 'detail' || type === 'audit'"
-                ></el-input>
+                ></el-input-number>
               </template>
             </el-table-column>
-            <el-table-column label="库存数量">
+            <!-- <el-table-column label="库存数量">
               <template slot-scope="scope">
                 {{ scope.row.usable_stock }}
               </template>
             </el-table-column>
             <el-table-column label="差异">
               <template slot-scope="scope">
-                <!-- 入库减去库存  -->
                 {{ scope.row.num - scope.row.usable_stock || 0 }}
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               label="操作"
               v-if="type !== 'detail' && type !== 'audit'"
@@ -260,15 +269,23 @@
         <el-table-column type="selection" width="55" />
         <el-table-column prop="" label="商品编号">
           <template slot-scope="scope">
-            {{scope.goods_vo.sn}}
+            {{scope.row.goods_vo.sn}}
           </template>
         </el-table-column>
         <el-table-column prop="bar_code" label="商品条码">
            </el-table-column>
-        <el-table-column prop="sn_code" label="序列号"> </el-table-column>
-        <el-table-column prop="name" label="商品名称"> </el-table-column>
-        <el-table-column prop="goods_style" label="规格型号"> </el-table-column>
-        <el-table-column prop="goods_unit" label="单位"> </el-table-column>
+        <el-table-column prop="bar_code" label="序列号"></el-table-column>
+        <el-table-column prop="" label="商品名称">
+          <template slot-scope="scope">
+            {{scope.row.goods_vo.name}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="goods_style" label="规格型号">
+          <template slot-scope="scope">
+            {{scope.row.spec_name.join('/')}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="unit" label="单位"> </el-table-column>
         <!-- <el-table-column prop="product_list.stock_num" label="库存数量"> </el-table-column> -->
       </el-table>
       <span slot="footer" class="dialog-footer">
@@ -504,7 +521,7 @@ export default {
     // 保存已选商品
     submitGoosData() {
       if (this.goodsList.length >= 1) {
-        let ids=[]
+        /* let ids=[]
         const param_list={
           warehouse_id:this.goodsExchangeAddForm.warehouse_id,
           good_ids:ids
@@ -520,8 +537,11 @@ export default {
           this.goodsExchangeAddForm.product_list = res;
           this.goodsExchangeAddForm.contract_product_list = res;
           console.log(res);
+
+         }) */
+         this.goodsExchangeAddForm.product_list = this.goodsList;
+         console.log(this.goodsExchangeAddForm.product_list);
           this.goodsVisible = false;
-         })
 
       } else {
         this.$message.error("请选择商品信息");
@@ -650,7 +670,6 @@ export default {
           const params = this.MixinClone(this.goodsExchangeAddForm);
           params.handled_by = this.deptListAll;
           API_order.getOrderList({sn:this.goodsExchangeAddForm.sn}).then(res=>{
-              console.log(res.data);
               params.order_id= Number(res.data[0].id)
             })
           params.staff_name = this.goodsExchangeAddForm.distribution_name;
@@ -908,7 +927,7 @@ export default {
           );
           this.goodsExchangeAddForm.distribution_name = response.staff_name;
           this.goodsExchangeAddForm.product_list =
-            response.product_list.map((item) => {
+            response.product_list/* .map((item) => {
               //change_list
               item.name=item.goods_do.name
               item.sn=item.goods_do.sn
@@ -919,8 +938,8 @@ export default {
               item.product_unit = item.unit;
               item.warehouse_entry_sn = item.stock_sn;
               return item;
-            });
-          this.goodsExchangeAddForm.return_list = response.return_list.map(
+            }); */
+         /*  this.goodsExchangeAddForm.return_list = response.return_list.map(
             (item) => {
               item.product_price = item.amount;
               item.product_specification = item.specification;
@@ -929,7 +948,7 @@ export default {
               item.warehouse_entry_sn = item.stock_sn;
               return item;
             }
-          );
+          ); */
           // this.GET_WarehouseOutProduct()
         });
       });

+ 24 - 13
manager-admin/src/views/stock/goodsExchange/checkInventory.vue

@@ -35,15 +35,16 @@
           {{ warehouseName(goodsExchangeAddForm.warehouse_id) }}
         </el-form-item>
         <el-form-item label="类型:" prop="type" class="change-form-item">
-          {{warehouseType(goodsExchangeAddForm.type)  }}
+          {{ warehouseType(goodsExchangeAddForm.type) }}
         </el-form-item>
         <el-form-item
           label="备注:"
-          prop="change_desc"
+          prop="memo"
           class="change-form-item"
           style="width: 61%"
         >
-          {{ goodsExchangeAddForm.notes }}
+        <span v-if="checkType == 'first'">{{ goodsExchangeAddForm.notes}}</span>
+         <span v-else>{{ goodsExchangeAddForm.memo }}</span>
         </el-form-item>
         <div class="mx">
           <h3>商品明细</h3>
@@ -61,39 +62,48 @@
             >
               <el-table-column label="商品编号">
                 <template slot-scope="scope">
-                  {{ scope.row.sn }}
+                  {{ scope.row.goods_vo.sn }}
                 </template>
               </el-table-column>
               <el-table-column label="商品名称">
                 <template slot-scope="scope">
-                  {{ scope.row.name }}
+                  {{ scope.row.goods_vo.name }}
                 </template>
               </el-table-column>
               <el-table-column label="条码">
                 <template slot-scope="scope">
-                  {{ scope.row.bar_code }}
+                  <!-- {{ scope.row.bar_code }} -->
+                  <span v-if="id">{{ scope.row.product_vo.bar_code }}</span>
+                  <span v-else>{{ scope.row.bar_code }}</span>
                 </template>
               </el-table-column>
               <el-table-column label="序列号">
                 <template slot-scope="scope">
-                  {{ scope.row.sn_code }}
+                  <span v-if="id">{{ scope.row.product_vo.sn_code }}</span>
+                  <span v-else>{{ scope.row.sn_code }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="规格型号">
+              <el-table-column label="规格型号" v-if="id">
                 <template slot-scope="scope">
-                  {{ scope.row.specification }}
+                  {{ scope.row.product_vo.spec_name.join("/") }}
+                </template>
+              </el-table-column>
+              <el-table-column label="规格型号" v-else>
+                <template slot-scope="scope">
+                  {{ scope.row.spec_name.join("/") }}
                 </template>
               </el-table-column>
               <el-table-column label="单位">
                 <template slot-scope="scope">
-                  {{ scope.row.goods_unit }}
+                  <span v-if="id">{{ scope.row.product_vo.unit }}</span>
+                  <span v-else>{{ scope.row.unit }}</span>
                 </template>
               </el-table-column>
               <!-- <el-table-column label="订单数量"> </el-table-column> -->
               <el-table-column v-if="checkType == 'first'" label="出库数量">
                 <template slot-scope="scope">
                   <el-input
-                    v-model="scope.row.num"
+                    v-model="scope.row.out_num"
                     type="number"
                     :min="0"
                     :maxlength="20"
@@ -379,7 +389,8 @@ export default {
             this.goodsExchangeAddForm = response;
             this.barcodeValue = response.sn;
             this.goodsExchangeAddForm.distribution_name = response.staff_name;
-            this.goodsExchangeAddForm.product_list = response.product_list.map(
+            this.goodsExchangeAddForm.product_list =
+              response.product_list; /* .map(
               (item) => {
                 item.name = item.goods_vo.name;
                 item.sn = item.goods_vo.sn;
@@ -392,7 +403,7 @@ export default {
                 item.usable_stock = item.goods_vo.usable_stock;
                 return item;
               }
-            );
+            ); */
           });
         } else {
           API_GoodsExchange.getGoodsExchangeInfo(this.id).then((response) => {

+ 6 - 1
manager-admin/src/views/stock/goodsExchange/goodsExchange.vue

@@ -127,7 +127,12 @@
           </template>
         </el-table-column>
         <el-table-column prop="order_id" label="订单编号" />
-        <el-table-column prop="notes" label="备注" />
+        <el-table-column prop="memo" label="备注">
+          <template slot-scope="scope">
+            <span v-if="activeName=='first'">{{  scope.row.notes  }}</span>
+            <span v-else>{{  scope.row.memo  }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" width="450">
           <template slot-scope="scope">
             <el-button

+ 61 - 42
manager-admin/src/views/stock/goodsExchange/goodsExchangeAdd.vue

@@ -154,32 +154,42 @@
           >
             <el-table-column label="商品编号">
               <template slot-scope="scope">
-                {{ scope.row.sn }}
+                {{ scope.row.goods_vo.sn }}
               </template>
             </el-table-column>
             <el-table-column label="商品名称">
               <template slot-scope="scope">
-                {{ scope.row.name }}
+                {{ scope.row.goods_vo.name }}
               </template>
             </el-table-column>
             <el-table-column label="条码">
               <template slot-scope="scope">
-                {{ scope.row.bar_code }}
+                <!-- {{ scope.row.bar_code }} -->
+                <span v-if="id">{{ scope.row.product_vo.bar_code }}</span>
+                <span v-else>{{ scope.row.bar_code }}</span>
               </template>
             </el-table-column>
             <el-table-column label="序列号">
               <template slot-scope="scope">
-                {{ scope.row.sn_code }}
+                <!-- {{ scope.row.sn_code }} -->
+                <span v-if="id">{{ scope.row.product_vo.sn_code }}</span>
+                <span v-else>{{ scope.row.sn_code }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="规格型号">
+            <el-table-column label="规格型号" v-if="id">
+              <template slot-scope="scope">
+                {{ scope.row.product_vo.spec_name.join("/") }}
+              </template>
+            </el-table-column>
+            <el-table-column label="规格型号" v-else>
               <template slot-scope="scope">
-                {{ scope.row.goods_style }}
+                {{ scope.row.spec_name.join("/") }}
               </template>
             </el-table-column>
             <el-table-column label="单位">
               <template slot-scope="scope">
-                {{ scope.row.goods_unit }}
+                <span v-if="id">{{ scope.row.product_vo.unit }}</span>
+                <span v-else>{{ scope.row.unit }}</span>
               </template>
             </el-table-column>
             <el-table-column label="出库数量">
@@ -201,7 +211,7 @@
             <el-table-column label="差异">
               <template slot-scope="scope">
                 <!-- 入库减去库存  -->
-                {{ scope.row.usable_stock - scope.row.out_num   || 0 }}
+                {{ scope.row.usable_stock - scope.row.out_num || 0 }}
               </template>
             </el-table-column>
             <el-table-column
@@ -212,7 +222,9 @@
                 <el-button
                   size="mini"
                   type="danger"
-                  @click="goodsExchangeAddForm.product_list.splice(scope.$index, 1)"
+                  @click="
+                    goodsExchangeAddForm.product_list.splice(scope.$index, 1)
+                  "
                   >删除</el-button
                 >
               </template>
@@ -378,7 +390,7 @@ export default {
       goodsExchangeAddForm: {
         order_list: [
           {
-            order_id:"1752156400898293761",
+            order_id: "1752156400898293761",
             order_item_list: [
               {
                 batch_list: [
@@ -402,7 +414,7 @@ export default {
             order_sn: "",
           },
         ],
-         product_list: [],
+        product_list: [],
         type: "",
       },
       /** 校验规则 */
@@ -410,9 +422,9 @@ export default {
         warehouse_id: [
           { required: true, message: "请选择出库仓库", trigger: "change" },
         ],
-        type:[
-        { required: true, message: "请选择出库类型", trigger: "change" },
-        ]
+        type: [
+          { required: true, message: "请选择出库类型", trigger: "change" },
+        ],
         // change_amount: [
         //   { required: true, message: '请输入换货金额', trigger: 'blur' },
         //   { validator: checkPrice, trigger: 'blur' }
@@ -437,7 +449,7 @@ export default {
     this.sttorageType = this.$route.params.type;
     this.GET_WarehouseList();
     this.GET_DeptList();
-    this.outType()
+    this.outType();
   },
   watch: {
     $route: {
@@ -483,17 +495,17 @@ export default {
   },
   methods: {
     //获取出库类型字典
-    outType(){
-      API_Setting.getPage({dictType:"out_warehouse_type"}).then(res=>{
-        this.typeList=res.data.filter(el=>{
-          if(el.value!=='SALE_OUT' && el.value!=='HAIL_OUT'){
-            return el
+    outType() {
+      API_Setting.getPage({ dictType: "out_warehouse_type" }).then((res) => {
+        this.typeList = res.data.filter((el) => {
+          if (el.value !== "SALE_OUT" && el.value !== "HAIL_OUT") {
+            return el;
           }
-        })
-        console.log( this.typeList);
-      })
+        });
+        console.log(this.typeList);
+      });
     },
-     /*//商品对应字段
+    /*//商品对应字段
      handleSelectionChange(val) {
       this.goodsList = val.map((el) => {
         el.product_id = el.id;
@@ -630,13 +642,13 @@ export default {
       });
     },
     //保存
-    saveGoodsExchangeAddForm(){
+    saveGoodsExchangeAddForm() {
       this.$refs["goodsExchangeAddForm"].validate((valid) => {
         if (valid) {
           const { id } = this.goodsExchangeAddForm;
           const params = this.MixinClone(this.goodsExchangeAddForm);
           //保存类型
-          params.save_or_submit="save"
+          params.save_or_submit = "save";
           params.warehouse_consignee_id = this.deptListAll.id;
           params.out_time = Date.parse(new Date());
           params.staff_name = this.goodsExchangeAddForm.distribution_name;
@@ -656,8 +668,11 @@ export default {
             this.$message.error("请选择商品!");
             return;
           }
+          params.product_list.map((el) => {
+            return (el.product_id = el.id);
+          });
           if (this.$route.name === "goodsExchangeEdit") {
-            API_GoodsExchange.editWarehouseOut(id,params).then((response) => {
+            API_GoodsExchange.editWarehouseOut(id, params).then((response) => {
               this.$message.success("修改成功!");
               const { callback } = this.$route.params;
               if (typeof callback === "function") callback();
@@ -690,7 +705,7 @@ export default {
           const { id } = this.goodsExchangeAddForm;
           const params = this.MixinClone(this.goodsExchangeAddForm);
           //保存类型
-          params.save_or_submit="submit"
+          params.save_or_submit = "submit";
           params.warehouse_consignee_id = this.deptListAll.id;
           params.out_time = Date.parse(new Date());
           params.staff_name = this.goodsExchangeAddForm.distribution_name;
@@ -709,8 +724,11 @@ export default {
             this.$message.error("请选择商品!");
             return;
           }
+          params.product_list.map((el) => {
+            return (el.product_id = el.id);
+          });
           if (this.$route.name === "goodsExchangeEdit") {
-            API_GoodsExchange.editWarehouseOut(id,params).then((response) => {
+            API_GoodsExchange.editWarehouseOut(id, params).then((response) => {
               this.$message.success("修改成功!");
               const { callback } = this.$route.params;
               if (typeof callback === "function") callback();
@@ -739,15 +757,15 @@ export default {
     },
     // 选择出库单
     async handleSelectWarehouseEntryBatch() {
-    /*   API_GoodsExchange.getProductStock().then((res) => {
+      /*   API_GoodsExchange.getProductStock().then((res) => {
         this.goodsData = res.data;
         this.goodsVisible = true;
       });*/
-     if (!this.goodsExchangeAddForm.warehouse_id) {
-        this.$message.error('请先选择仓库!')
-        return
+      if (!this.goodsExchangeAddForm.warehouse_id) {
+        this.$message.error("请先选择仓库!");
+        return;
       }
-       const goodsData = await this.$EnwarehouseEntryBatch({
+      const goodsData = await this.$EnwarehouseEntryBatch({
         goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/${this.goodsExchangeAddForm.warehouse_id}`,
         warehouseList: this.warehouseList,
         //change_list
@@ -755,15 +773,15 @@ export default {
           ? this.goodsExchangeAddForm.product_list &&
             this.goodsExchangeAddForm.product_list.map((item) => item.id)
           : this.goodsExchangeAddForm.product_list.map((item) => item.id),
-         purchasePlanApiParams: {
+        purchasePlanApiParams: {
           warehouse_id: this.goodsExchangeAddForm.warehouse_id,
-          },
+        },
       });
       this.goodsExchangeAddForm.warehouse_id = goodsData.warehouse_id;
-      this.goodsExchangeAddForm.product_list = goodsData.purchasePlans.map(
+      this.goodsExchangeAddForm.product_list = goodsData.purchasePlans; /*.map(
         (item) => {
           //
-          /* item.amount = item.entry_price;
+           item.amount = item.entry_price;
           item.product_sn = item.product_sn;
           item.product_name = item.product_name;
           item.specification = item.product_specification;
@@ -773,11 +791,11 @@ export default {
           item.stock_id = item.warehouse_entry_id;
           item.stock_batch_sn = item.sn;
           item.stock_batch_id = item.id;
-          item.cost_price = item.product_cost_price; */
+          item.cost_price = item.product_cost_price;
           item.goods_id=item.id
           return item;
         }
-      );
+      );*/
       this.goodsExchangeAddForm.change_amount =
         this.goodsExchangeAddForm.product_list.reduce(
           (sum, obj) => sum + obj.entry_price,
@@ -839,7 +857,8 @@ export default {
             this.goodsExchangeAddForm.change_time * 1000
           );
           this.goodsExchangeAddForm.distribution_name = response.staff_name;
-          this.goodsExchangeAddForm.product_list = response.product_list.map((item) => {
+          this.goodsExchangeAddForm.product_list =
+            response.product_list; /*.map((item) => {
               item.name=item.goods_vo.name
               item.sn=item.goods_vo.sn
               item.sn_code=item.goods_vo.sn_code
@@ -851,7 +870,7 @@ export default {
               item.usable_stock=item.goods_vo.usable_stock
             return item;
           });
-          /* this.goodsExchangeAddForm.return_list = response.return_list.map(
+         this.goodsExchangeAddForm.return_list = response.return_list.map(
             (item) => {
               item.product_price = item.amount;
               item.product_specification = item.specification;

+ 14 - 11
manager-admin/src/views/stock/goodsInventory/goodsInventoryAdd.vue

@@ -54,32 +54,36 @@
             :header-cell-style="{ textAlign: 'center' }" style="width: 100%; margin-top: 20px;">
             <el-table-column label="商品编号">
               <template slot-scope="scope">
-                {{ scope.row.sn }}
+                {{ scope.row.goods_vo.sn }}
               </template>
             </el-table-column>
             <el-table-column label="商品名称">
               <template slot-scope="scope">
-                {{ scope.row.name }}
+                {{ scope.row.goods_vo.name }}
               </template>
             </el-table-column>
             <el-table-column label="条码">
               <template slot-scope="scope">
-                {{ scope.row.bar_code }}
+                <span v-if="!id"> {{ scope.row.bar_code }}</span>
+              <span v-else> {{ scope.row.product_vo.bar_code }}</span>
               </template>
             </el-table-column>
             <el-table-column label="序列号">
               <template slot-scope="scope">
-                {{ scope.row.sn_code }}
+                <span v-if="!id"> {{ scope.row.sn_code }}</span>
+              <span v-else> {{ scope.row.product_vo.sn_code }}</span>
               </template>
             </el-table-column>
             <el-table-column label="规格型号">
               <template slot-scope="scope">
-                {{ scope.row.goods_style }}
+                <span v-if="!id">{{ scope.row.spec_name.join("/") }}</span>
+              <span v-else>{{ scope.row.product_vo.spec_name.join("/") }}</span>
               </template>
             </el-table-column>
             <el-table-column label="单位">
               <template slot-scope="scope">
-                {{ scope.row.goods_unit }}
+                <span v-if="!id"> {{ scope.row.unit }}</span>
+              <span v-else> {{ scope.row.product_vo.unit }}</span>
               </template>
             </el-table-column>
             <el-table-column label="库存数量">
@@ -296,12 +300,11 @@ export default {
             const query = {
               diff_num: item.usable_stock - item.inventory_num,
               inventory_num: item.inventory_num * 1,
-              product_id: item.product_id,
               product_name: item.product_name,
               product_sn: item.product_sn,
               specification: item.product_specification,
               unit: item.product_unit,
-              goods_id: item.id,
+              product_id: item.id,
               remark: item.remark
             }
             return query
@@ -352,6 +355,7 @@ export default {
         }
         return query
       })
+      console.log(goodsData);
       this.goodsInventoryAddForm.product_list = goodsData.purchasePlans
       /* this.getlistProductLendNum(ProductLendNum, goodsData.purchasePlans) */
     },
@@ -385,7 +389,7 @@ export default {
     GET_goodsInventoryAddDetail() {
       API_GoodsInventory.getGoodsInventoryInfo(this.id).then(response => {
         console.log(response);
-        response.product_list.map(el => {
+        /* response.product_list.map(el => {
             el.allow_sn=el.goods_vo.allow_sn
             el.bar_code=el.goods_vo.bar_code
             el.brand_id=el.goods_vo.brand_id
@@ -404,7 +408,6 @@ export default {
             el.goods_unit=el.goods_vo.goods_unit
             el.have_spec=el.goods_vo.have_spec
             el.hire_or_sail=el.goods_vo.hire_or_sail
-            /* el.id=el.goods_vo.id */
             el.image=el.goods_vo.image
             el.image_list=el.goods_vo.image_list
             el.label_names=el.goods_vo.label_names
@@ -421,7 +424,7 @@ export default {
             el.usable_stock=el.goods_vo.usable_stock
             el.video=el.goods_vo.video
             return el
-          })
+          }) */
         this.goodsInventoryAddForm = response
         this.GET_WarehouseList({ dept_id: response.dept_id })
         this.goodsInventoryAddForm.distribution_name = response.staff_name

+ 11 - 10
manager-admin/src/views/stock/goodsInventoryLoss/goodsInventoryLossAdd.vue

@@ -57,22 +57,24 @@
             </el-table-column> -->
             <el-table-column label="商品编号">
               <template slot-scope="scope">
-                {{ scope.row.sn }}
+                {{ scope.row.goods_vo.sn }}
               </template>
             </el-table-column>
             <el-table-column label="商品名称">
               <template slot-scope="scope">
-                {{ scope.row.name }}
+                {{ scope.row.goods_vo.name }}
               </template>
             </el-table-column>
             <el-table-column label="规格型号">
               <template slot-scope="scope">
-                {{ scope.row.goods_style }}
+                <span v-if="!id">{{ scope.row.spec_name.join("/") }}</span>
+              <span v-else>{{ scope.row.product_vo.spec_name.join("/") }}</span>
               </template>
             </el-table-column>
             <el-table-column label="单位">
               <template slot-scope="scope">
-                {{ scope.row.goods_unit }}
+                <span v-if="!id"> {{ scope.row.unit }}</span>
+              <span v-else> {{ scope.row.product_vo.unit }}</span>
               </template>
             </el-table-column>
             <el-table-column label="库存数量">
@@ -302,7 +304,7 @@ export default {
           params.product_list = params.product_list.map(item => {
             const query = {
               report_num:item.report_num,
-              goods_id: item.id,
+              product_id: item.id,
             }
             return query
           })
@@ -383,10 +385,10 @@ export default {
         this.GET_WarehouseList({ dept_id: response.dept_id })
         /* this.goodsInventoryAddForm.report_time = Math.floor(this.goodsInventoryAddForm.report_time * 1000) */
         this.goodsInventoryAddForm.distribution_name = response.staff_name
-        this.goodsInventoryAddForm.product_list = this.goodsInventoryAddForm.product_list.map(el => {
-         /*  item.product_specification = item.specification
+          /*this.goodsInventoryAddForm.product_list = this.goodsInventoryAddForm.product_list.map(el => {
+         item.product_specification = item.specification
           item.product_unit = item.unit
-          item.remain_num = item.stock_num */
+          item.remain_num = item.stock_num
 
             el.allow_sn=el.goods_vo.allow_sn
             el.bar_code=el.goods_vo.bar_code
@@ -406,7 +408,6 @@ export default {
             el.goods_unit=el.goods_vo.goods_unit
             el.have_spec=el.goods_vo.have_spec
             el.hire_or_sail=el.goods_vo.hire_or_sail
-            /* el.id=el.goods_vo.id */
             el.image=el.goods_vo.image
             el.image_list=el.goods_vo.image_list
             el.label_names=el.goods_vo.label_names
@@ -424,7 +425,7 @@ export default {
             el.video=el.goods_vo.video
 
           return el
-        })
+        })*/
       })
     }
   }

+ 6 - 7
manager-admin/src/views/stock/goodsUnderstock.vue

@@ -104,10 +104,9 @@
           <template slot-scope="scope">
              <el-button size="mini" v-if="scope.row.status!=='ROLLBACK_HANDLE'"
               @click="handleSuccessGoodsTransfer(scope.row)" type="success">撤销</el-button>
-         <!--    <el-button type="success" size="mini"
-              v-if="scope.row.allowable.submit && checkPermission(['goodsTransfer:submit'])"
-              @click="handleSubmitGoodsTransfer(scope.row)">提交</el-button>
-            <el-button type="danger" size="mini"
+             <el-button  size="mini"
+              @click="handleSubmitGoodsTransfer(scope.row)">查看</el-button>
+          <!--  <el-button type="danger" size="mini"v-if="scope.row.allowable.submit && checkPermission(['goodsTransfer:submit'])"
               v-else-if="scope.row.allowable.withdraw && checkPermission(['goodsTransfer:withdraw'])"
               @click="handleWithdrawGoodsTransfer(scope.row)">撤回</el-button>
             <el-button size="mini" v-if="scope.row.allowable.edit && checkPermission(['goodsTransfer:edit'])"
@@ -239,9 +238,9 @@ export default {
       })
     },
     handleSubmitGoodsTransfer(row) {
-      API_GoodsTransfer.submitGoodsTransfer(row.id).then(() => {
-        this.$message.success('提交成功!')
-        this.GET_GoodsTransferList()
+      this.$router.push({
+        name: 'goodsUnderstockDetail',
+        params: { id: row.id }
       })
     },
     handleWithdrawGoodsTransfer(row) {

+ 26 - 15
manager-admin/src/views/stock/goodsUnderstockAdd.vue

@@ -50,7 +50,11 @@
         </el-select>
       </el-form-item>
       <el-form-item label="配送方式" prop="send_type">
-        <el-select v-model="GoodsTransferForm.send_type" clearable>
+        <el-select
+          v-model="GoodsTransferForm.send_type"
+          clearable
+          :disabled="type === 'detail'"
+        >
           <el-option
             v-for="item in deliveryTypeList"
             :key="item.id"
@@ -59,8 +63,9 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="备注" prop="remark">
+      <el-form-item label="备注" prop="remark" >
         <el-input
+        :disabled="type === 'detail'"
           type="textarea"
           :rows="2"
           placeholder="请输入内容"
@@ -96,37 +101,42 @@
         >
           <el-table-column label="商品编号">
             <template slot-scope="scope">
-              {{ scope.row.sn }}
+              {{ scope.row.goods_vo.sn }}
             </template>
           </el-table-column>
           <el-table-column label="商品名称">
             <template slot-scope="scope">
-              {{ scope.row.name }}
+              {{ scope.row.goods_vo.name }}
             </template>
           </el-table-column>
           <el-table-column label="条码">
             <template slot-scope="scope">
-              {{ scope.row.bar_code }}
+              <span v-if="!id"> {{ scope.row.bar_code }}</span>
+              <span v-else> {{ scope.row.product_vo.bar_code }}</span>
             </template>
           </el-table-column>
           <el-table-column label="序列号">
             <template slot-scope="scope">
-              {{ scope.row.sn_code }}
+              <span v-if="!id"> {{ scope.row.sn_code }}</span>
+              <span v-else> {{ scope.row.product_vo.sn_code }}</span>
             </template>
           </el-table-column>
           <el-table-column label="规格型号">
             <template slot-scope="scope">
-              {{ scope.row.goods_style }}
+              <span v-if="!id">{{ scope.row.spec_name.join("/") }}</span>
+              <span v-else>{{ scope.row.product_vo.spec_name.join("/") }}</span>
             </template>
           </el-table-column>
           <el-table-column label="单位">
             <template slot-scope="scope">
-              {{ scope.row.goods_unit }}
+              <span v-if="!id"> {{ scope.row.unit }}</span>
+              <span v-else> {{ scope.row.product_vo.unit }}</span>
             </template>
           </el-table-column>
           <el-table-column label="库存数量">
             <template slot-scope="scope">
-              {{ scope.row.usable_stock }}
+              <span v-if="!id">{{ scope.row.usable_stock }}</span>
+              <span v-else>{{ scope.row.use_able_num }}</span>
             </template>
           </el-table-column>
           <el-table-column label="调拨数量">
@@ -199,7 +209,7 @@ export default {
       type: "",
       deliveryTypeList: [],
       GoodsTransferFormRule: {
-        transfer_time:{
+        transfer_time: {
           required: true,
           message: "请选择调整时间",
           trigger: "change",
@@ -230,7 +240,8 @@ export default {
       this.GoodsTransferForm.out_handled_by_id = this.user.uid;
       this.GoodsTransferForm.dept_id = this.user.dept_id;
       /* this.$set(this.GoodsTransferForm, "transfer_time", new Date().getTime()); */
-    } else if (this.$route.name === "goodsTransferDetail") {
+    } else if (this.$route.name === "goodsUnderstockDetail") {
+      this.id=this.$route.params.id
       this.type = "detail";
     }
     if (this.$route.params.id) {
@@ -308,7 +319,7 @@ export default {
           const { id } = this.GoodsTransferForm;
           const params = this.MixinClone(this.GoodsTransferForm);
           /*       params.transfer_time = Math.floor(params.transfer_time / 1000); */
-          if(params.product_list.length==0){
+          if (params.product_list.length == 0) {
             this.$message.error("请选择商品!");
           }
           if (params.in_warehouse_id == params.out_warehouse_id) {
@@ -319,7 +330,7 @@ export default {
             const query = {
               num: item.num,
               use_able_num: Number(item.usable_stock),
-              goods_id: item.id,
+              product_id: item.id,
             };
             return query;
           });
@@ -381,9 +392,9 @@ export default {
     GET_GoodsTransferDetail() {
       API_GoodsTransfer.getGoodsTransferInfo(this.id).then((response) => {
         this.GoodsTransferForm = response;
-        this.fileList = response.attachment
+        /* this.fileList = response.attachment
           ? [{ name: "附件", url: response.attachment }]
-          : [];
+          : []; */
         /* this.GoodsTransferForm.transfer_time = Math.floor(
           this.GoodsTransferForm.transfer_time * 1000
         ); */

+ 2 - 2
manager-admin/src/views/stock/order.vue

@@ -152,8 +152,8 @@
             {{warehouseName(scope.row.warehouse_id) }}
           </template>
         </el-table-column>
-        <el-table-column prop="delivery_type" label="配送方式">
-          <template slot-scope="scope">{{ deliveryType(scope.row.delivery_type) }}</template>
+        <el-table-column prop="send_type" label="配送方式">
+          <template slot-scope="scope">{{ deliveryType(scope.row.send_type) }}</template>
         </el-table-column>
         <el-table-column prop="pay_type" label="付款方式">
           <template slot-scope="scope">{{payType(scope.row.pay_type)  }}</template>

+ 372 - 236
manager-admin/src/views/stock/orderAdd.vue

@@ -16,7 +16,7 @@
         <el-col :span="10">
           <el-form-item label="订单类型" prop="type" :rules="rules.type">
             <!-- @change="cleanGoodsList" -->
-            <el-select v-model="OrderForm.type"  clearable>
+            <el-select v-model="OrderForm.type" clearable>
               <el-option
                 v-for="(item, index) in orderTypeList"
                 :key="index"
@@ -30,37 +30,38 @@
           <el-form-item
             label="租赁时间"
             prop="time"
-            v-if="OrderForm.type=='TO_C'"
             :rules="rules.time"
+            v-if="OrderForm.type == 'TO_C'"
           >
-          <el-date-picker
-                v-model="time"
-                type="daterange"
-                align="center"
-                :editable="false"
-                unlink-panels
-                :clearable="false"
-                :default-time="['00:00:00', '23:59:59']"
-                range-separator="-"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                value-format="yyyy-MM-dd hh:mm:ss"
-                :picker-options="{
-                  disabledDate(time) {
-                    return (
-                      time.getTime()<=
-                      new Date(
-                        new Date().getFullYear(),
-                        new Date().getMonth(),
-                        new Date().getDate()
-                      ).getTime() -
-                        86400000
-                    );
-                  },
-                  shortcuts: MixinPickerShortcuts,
-                }"
-              >
-              </el-date-picker>
+            <!--  -->
+            <el-date-picker
+              v-model="time"
+              type="daterange"
+              align="center"
+              :editable="false"
+              unlink-panels
+              :clearable="false"
+              :default-time="['00:00:00', '23:59:59']"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              value-format="yyyy-MM-dd hh:mm:ss"
+              :picker-options="{
+                disabledDate(time) {
+                  return (
+                    time.getTime() <=
+                    new Date(
+                      new Date().getFullYear(),
+                      new Date().getMonth(),
+                      new Date().getDate()
+                    ).getTime() -
+                      86400000
+                  );
+                },
+                shortcuts: MixinPickerShortcuts,
+              }"
+            >
+            </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :span="10">
@@ -98,16 +99,22 @@
         </el-col>
         <el-col :span="10">
           <el-form-item
-            label="付金额:"
+            label="付金额:"
             prop="pay_price"
             :rules="rules.pay_price"
           >
-          <span>{{ '¥'+3340 }}</span>
-          <span>实付价格:</span>
-          <!-- <span>折扣:<el-input placeholder="请输入"></el-input>
-          </span> -->
+            <span>{{ "¥" + price }}</span>
+            <span
+              >折扣:<el-input
+                placeholder="请输入"
+                v-model="discount"
+                onKeyUp="value=value.replace(/^((0\.[1-9]{1})|(([1-9]{1})(\.\d{1})?))$/,'')"
+                style="width: 70px"
+              ></el-input>
+            </span>
+            <span>实付金额:</span>
             <el-input
-              v-model="OrderForm.pay_price"
+              v-model="OrderForm.real_price"
               placeholder="请输入"
             ></el-input>
           </el-form-item>
@@ -226,42 +233,46 @@
           <el-table-column type="selection" width="40" align="center" />
           <el-table-column label="商品编号">
             <template slot-scope="scope">
-              {{ scope.row.sn }}
+              {{ scope.row.goods_vo.sn }}
             </template>
           </el-table-column>
           <el-table-column label="商品名称">
             <template slot-scope="scope">
-              {{ scope.row.name }}
+              {{ scope.row.goods_vo.name }}
             </template>
           </el-table-column>
           <el-table-column label="条码">
             <template slot-scope="scope">
-              {{ scope.row.bar_code }}
+              <span v-if="!id"> {{ scope.row.bar_code }}</span>
+              <span v-else> {{ scope.row.product_vo.bar_code }}</span>
             </template>
           </el-table-column>
           <el-table-column label="序列号">
             <template slot-scope="scope">
-              {{ scope.row.sn_code }}
+              <span v-if="!id"> {{ scope.row.sn_code }}</span>
+              <span v-else> {{ scope.row.product_vo.sn_code }}</span>
             </template>
           </el-table-column>
           <el-table-column label="规格型号">
             <template slot-scope="scope">
-              {{ scope.row.goods_style }}
+              <span v-if="!id">{{ scope.row.spec_name.join("/") }}</span>
+              <span v-else>{{ scope.row.product_vo.spec_name.join("/") }}</span>
             </template>
           </el-table-column>
           <el-table-column label="单位">
             <template slot-scope="scope">
-              {{ scope.row.goods_unit }}
+              <span v-if="!id"> {{ scope.row.unit }}</span>
+              <span v-else> {{ scope.row.product_vo.unit }}</span>
             </template>
           </el-table-column>
           <el-table-column label="订单数量">
             <template slot-scope="scope">
               <el-input
-                  v-model="scope.row.num"
-                  type="number"
-                  :min="0"
-                  :maxlength="20"
-                ></el-input>
+                v-model="scope.row.num"
+                type="number"
+                :min="0"
+                :maxlength="20"
+              ></el-input>
             </template>
           </el-table-column>
           <el-table-column label="库存数量">
@@ -271,7 +282,7 @@
           </el-table-column>
           <el-table-column label="差异">
             <template slot-scope="scope">
-              {{scope.row.usable_stock - scope.row.num  || 0 }}
+              {{ scope.row.usable_stock - scope.row.num || 0 }}
             </template>
           </el-table-column>
           <!-- <el-table-column label="数量">
@@ -403,44 +414,84 @@
         <el-button @click="roBack()" :disabled="false">返回</el-button>
       </div>
     </el-form>
-    <el-dialog title="添加客户信息" :visible.sync="customer.dialogVisible" width="1100px"
-      @open="handleDialogOpen" :modal-append-to-body="false" :close-on-click-modal="false" :close-on-press-escape="false">
-      <el-form :model="customer.supplierForm" :rules="customer.supplierRules" ref="supplierForm" label-width="120px" inline>
-         <el-form-item label="公司名称" prop="name">
-          <el-input v-model="customer.supplierForm.name" :minlength="2" :maxlength="20" clearable
-            placeholder="请输入公司名称"></el-input>
+    <el-dialog
+      title="添加客户信息"
+      :visible.sync="customer.dialogVisible"
+      width="1100px"
+      @open="handleDialogOpen"
+      :modal-append-to-body="false"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <el-form
+        :model="customer.supplierForm"
+        :rules="customer.supplierRules"
+        ref="supplierForm"
+        label-width="120px"
+        inline
+      >
+        <el-form-item label="公司名称" prop="name">
+          <el-input
+            v-model="customer.supplierForm.name"
+            :minlength="2"
+            :maxlength="20"
+            clearable
+            placeholder="请输入公司名称"
+          ></el-input>
         </el-form-item>
         <el-form-item label="客户联系人" prop="contact ">
-          <el-input v-model="customer.supplierForm.contact " :minlength="2" :maxlength="20" clearable
-            placeholder="请输入客户联系人"></el-input>
+          <el-input
+            v-model="customer.supplierForm.contact"
+            :minlength="2"
+            :maxlength="20"
+            clearable
+            placeholder="请输入客户联系人"
+          ></el-input>
         </el-form-item>
         <el-form-item label="性别" prop="gender">
-            <el-radio v-model="customer.supplierForm.gender" label="男">男</el-radio>
-            <el-radio v-model="customer.supplierForm.gender" label="女">女</el-radio>
+          <el-radio v-model="customer.supplierForm.gender" label="男"
+            >男</el-radio
+          >
+          <el-radio v-model="customer.supplierForm.gender" label="女"
+            >女</el-radio
+          >
         </el-form-item>
         <el-form-item label="手机号码" prop="mobile">
-                <el-input v-model="customer.supplierForm.mobile" :minlength="2" :maxlength="20" clearable
-                  placeholder="请输入手机号码"></el-input>
-          </el-form-item>
+          <el-input
+            v-model="customer.supplierForm.mobile"
+            :minlength="2"
+            :maxlength="20"
+            clearable
+            placeholder="请输入手机号码"
+          ></el-input>
+        </el-form-item>
         <el-form-item label="邮件" prop="email">
-          <el-input v-model="customer.supplierForm.email" :minlength="2" :maxlength="20" clearable
-            placeholder="请输入电子邮件"></el-input>
+          <el-input
+            v-model="customer.supplierForm.email"
+            :minlength="2"
+            :maxlength="20"
+            clearable
+            placeholder="请输入电子邮件"
+          ></el-input>
         </el-form-item>
         <el-form-item label="客户类别" prop="type">
-            <el-select v-model="customer.supplierForm.type" placeholder="请选择客户类别">
-              <el-option
-                v-for="item in customer.options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-              </el-option>
-            </el-select>
+          <el-select
+            v-model="customer.supplierForm.type"
+            placeholder="请选择客户类别"
+          >
+            <el-option
+              v-for="item in customer.options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
         </el-form-item>
         <!-- <el-form-item label="状态" prop="status">
           <el-input v-model="customer.supplierForm.status" :minlength="2" :maxlength="20" clearable
             placeholder="请输入客户状态"></el-input>
         </el-form-item> -->
-
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="customer.dialogVisible = false">取 消</el-button>
@@ -455,7 +506,7 @@ import { mapGetters } from "vuex";
 import * as API_Order from "@/api/order";
 import * as API_BasicSetting from "@/api/basicSetting";
 import * as API_Member from "@/api/member";
-import * as API_Setting from '@/api/setting'
+import * as API_Setting from "@/api/setting";
 import * as API_CollectingAccount from "@/api/collectingAccount";
 import { RegExp } from "~/ui-utils";
 import {
@@ -485,7 +536,7 @@ export default {
     return {
       brcode: false,
       options: regionData,
-      selectedOptions: [''],
+      selectedOptions: [""],
       warehouseList: [], // 仓库列表
       memberList: [], // 会员列表
       marketingList: [], // 销售经理列表
@@ -505,11 +556,11 @@ export default {
       id: "",
       /** 订单表单*/
       OrderForm: {
-       //省市区地址
-       province_city_area:"",
+        //省市区地址
+        province_city_area: "",
         //详细信息
-        address:"",
-        province_city_area_address:"",
+        address: "",
+        province_city_area_address: "",
       },
       formLoading: false,
       isDetail: undefined,
@@ -532,7 +583,7 @@ export default {
         order_time: [this.MixinRequired("下单时间不能为空", "change")],
         payment_status: [this.MixinRequired("支付状态不能为空", "change")],
         payment_time: [this.MixinRequired("支付时间不能为空", "change")],
-       // delivery_type: [this.MixinRequired("请选择配送方式", "change")],
+        // delivery_type: [this.MixinRequired("请选择配送方式", "change")],
         product_list: {
           num: [
             this.MixinRequired("数量不能为空", "change"),
@@ -622,59 +673,67 @@ export default {
       orderTypeList: [],
       // 条形码
       barcodeValue: "",
-      time:[],
+      time: [],
       //新增客户
-      customer:{
-        dialogVisible:false,
+      customer: {
+        dialogVisible: false,
         supplierRules: {
-        custom_sn: [
-          this.MixinRequired('请输入客户编号!'),
-          { min: 2, max: 20, message: '长度在 2 到 20 个字符' },
-          {
-            validator: (rule, value, callback) => {
-              if (value && !RegExp.userName.test(value)) {
-                callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
-              } else {
-                callback()
-              }
-            }
-          }
-        ],
-        postal_address: [this.MixinRequired('请输入通讯地址!')],
-        telephone: [
-          this.MixinRequired('请输入联系电话!'),
-          {
-            validator: (rule, value, callback) => {
-              if (!RegExp.mobile.test(value)) {
-                callback(new Error('联系电话格式有误!'))
-              } else {
-                callback()
-              }
+          custom_sn: [
+            this.MixinRequired("请输入客户编号!"),
+            { min: 2, max: 20, message: "长度在 2 到 20 个字符" },
+            {
+              validator: (rule, value, callback) => {
+                if (value && !RegExp.userName.test(value)) {
+                  callback(
+                    new Error("只支持汉字、字母、数字、“-”、“_”的组合!")
+                  );
+                } else {
+                  callback();
+                }
+              },
             },
-            trigger: ['change', 'blur']
-          }
-        ],
-        name: [this.MixinRequired('请输入联系人!')],
-        mobile: [
-          this.MixinRequired('请输入手机号码!'),
-          {
-            validator: (rule, value, callback) => {
-              if (!RegExp.mobile.test(value)) {
-                callback(new Error('手机号码格式有误!'))
-              } else {
-                callback()
-              }
+          ],
+          postal_address: [this.MixinRequired("请输入通讯地址!")],
+          telephone: [
+            this.MixinRequired("请输入联系电话!"),
+            {
+              validator: (rule, value, callback) => {
+                if (!RegExp.mobile.test(value)) {
+                  callback(new Error("联系电话格式有误!"));
+                } else {
+                  callback();
+                }
+              },
+              trigger: ["change", "blur"],
             },
-            trigger: ['change', 'blur']
-          }
-        ],
-        gender:[{required: true, message: '请选择性别', trigger: 'change' }],
-        type:[{ required: true, message: '请选择客户类别', trigger: 'change' }],
-        contact:[{ required: true, message: '请输入客户联系人', trigger: 'blur' }],
+          ],
+          name: [this.MixinRequired("请输入联系人!")],
+          mobile: [
+            this.MixinRequired("请输入手机号码!"),
+            {
+              validator: (rule, value, callback) => {
+                if (!RegExp.mobile.test(value)) {
+                  callback(new Error("手机号码格式有误!"));
+                } else {
+                  callback();
+                }
+              },
+              trigger: ["change", "blur"],
+            },
+          ],
+          gender: [
+            { required: true, message: "请选择性别", trigger: "change" },
+          ],
+          type: [
+            { required: true, message: "请选择客户类别", trigger: "change" },
+          ],
+          contact: [
+            { required: true, message: "请输入客户联系人", trigger: "blur" },
+          ],
         },
-        supplierForm:{},
-        options:[
-         /*  {
+        supplierForm: {},
+        options: [
+          /*  {
               value: '全部',
               label: '全部'
             },{
@@ -684,8 +743,10 @@ export default {
               value: '租赁客户',
               label: '租赁客户'
             }, */
-          ]
-      }
+        ],
+      },
+      //折扣
+      discount: 0,
     };
   },
   computed: {
@@ -703,35 +764,37 @@ export default {
   methods: {
     /** dialog打开后重置form表单校验结果 */
     handleDialogOpen() {
-      setTimeout(() => { this.$refs['supplierForm'].clearValidate() })
-      this.customer.supplierForm={}
+      setTimeout(() => {
+        this.$refs["supplierForm"].clearValidate();
+      });
+      this.customer.supplierForm = {};
     },
     submitSupplierForm() {
-      this.$refs['supplierForm'].validate((valid) => {
+      this.$refs["supplierForm"].validate((valid) => {
         if (valid) {
-          const { id } = this.customer.supplierForm
-          const params = this.MixinClone(this.customer.supplierForm)
-            API_BasicSetting.addCustomer(params).then(() => {
-              this.customer.dialogVisible = false
-              this.$message.success('添加成功!')
-              this.GET_CustomerList()
-            })
+          const { id } = this.customer.supplierForm;
+          const params = this.MixinClone(this.customer.supplierForm);
+          API_BasicSetting.addCustomer(params).then(() => {
+            this.customer.dialogVisible = false;
+            this.$message.success("添加成功!");
+            this.GET_CustomerList();
+          });
         } else {
-          this.$message.error('表单填写有误,请核对!')
-          return false
+          this.$message.error("表单填写有误,请核对!");
+          return false;
         }
-      })
+      });
     },
     // 添加客户
-    addCust(){
-      this.customer.dialogVisible=true
+    addCust() {
+      this.customer.dialogVisible = true;
     },
     handleChange(value) {
-      this.OrderForm.province_city_area=value.join(",")
+      this.OrderForm.province_city_area = value.join(",");
       console.log(this.OrderForm.province_city_area);
       /**/
 
-       //打印区域码所对应的属性值即中文地址
+      //打印区域码所对应的属性值即中文地址
     },
     /** 初始化 */
     init() {
@@ -762,9 +825,9 @@ export default {
           console.log(this.customerList);
         })
         .catch(() => {});
-        API_Setting.getPage({dictType:"order_type"}).then(res=>{
-          this.orderTypeList=res.data
-        })
+      API_Setting.getPage({ dictType: "order_type" }).then((res) => {
+        this.orderTypeList = res.data;
+      });
     },
     /** 获取会员列表 */
     GET_MemberList() {
@@ -778,12 +841,15 @@ export default {
     },
     /** 获取销售经理列表 */
     GET_MarketingList() {
-      API_BasicSetting.getMarketingManagerList({
+      /*  API_BasicSetting.getMarketingManagerList({
         page_no: 1,
         page_size: -1,
         disable_flag: 0,
       }).then((response) => {
         this.marketingList = response.data;
+      }); */
+      API_BasicSetting.getUserByDept().then((res) => {
+        this.marketingList = res;
       });
     },
     /** 获取自提门店列表 */
@@ -822,12 +888,13 @@ export default {
       }
 
       const goodsData = await this.$EnPickerGoods({
-        goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/${this.OrderForm.warehouse_id}`,
+        goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/${this.OrderForm.warehouse_id}/${this.OrderForm.type}`,
         selectedIds: this.OrderForm.product_list.map((item) => item.product_id),
-        goodsApiParams: { warehouse_id: this.OrderForm.warehouse_id },
+        goodsApiParams: { order_type: this.OrderForm.type },
       });
 
-      this.OrderForm.product_list = goodsData.map((item) => {
+      this.OrderForm.product_list = goodsData;
+      /* .map((item) => {
         // 初始化字段,和订单的item字段名保持一致
         item.product_id = item.id;
         item.product_name = item.name;
@@ -843,14 +910,14 @@ export default {
         // 合计
 
         return item;
-      });
+      }); */
     },
     /** 添加支付方式 */
     handleInsertPayment() {
       const defaultCollectingAccount = this.collectingAccountList.findLast(
         (item) => item.default_flag === true
       );
-     /*  this.OrderForm.payment_list.push({
+      /*  this.OrderForm.payment_list.push({
         collecting_account_id: defaultCollectingAccount
           ? defaultCollectingAccount.id
           : null,
@@ -954,21 +1021,32 @@ export default {
       delete this.OrderForm.start_time;
       delete this.OrderForm.end_time;
       if (this.time) {
-        this.OrderForm.start_time = this.time[0]
-        this.OrderForm.end_time = this.time[1]
+        this.OrderForm.start_time = this.time[0];
+        this.OrderForm.end_time = this.time[1];
       }
       delete this.time;
       var loc = "";
-        for (let i = 0; i < this.selectedOptions.length; i++) {
-            loc += codeToText[this.selectedOptions[i]]+',';
-        }
-      this.OrderForm.province_city_area_address=loc+this.OrderForm.address
+      for (let i = 0; i < this.selectedOptions.length; i++) {
+        loc += codeToText[this.selectedOptions[i]] + ",";
+      }
+      this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
       const params = this.MixinClone(this.OrderForm);
-      params.item_list=params.product_list
-      /**/ params.product_list.map(el=>{
-        el.goods_id=el.id
-        el.id=""
-      })
+      params.product_list = params.product_list.map((el) => {
+        el.product_id = el.id;
+        el.id = "";
+        return el;
+      });
+      /*  params.item_list = params.product_list;
+      params.product_list.map((el) => {
+        el.goods_id = el.id;
+        el.id = "";
+      });*/
+      params.price = this.price;
+      params.real_price = Number(params.real_price);
+      /*  params.product_list.map((el) => {
+        return (el.product_id = el.id);
+      }); */
+      params.item_list = params.product_list;
       params.order_time = Math.floor(params.order_time / 1000);
       params.payment_time = Math.floor(params.payment_time / 1000);
       this.formLoading = true;
@@ -993,9 +1071,9 @@ export default {
       }
     },
     //确认并保存订单
-   async saveSubmitOrderForm(){
-       // 校验商品明细数据
-       const valid = await this.$refs.orderFormRef
+    async saveSubmitOrderForm() {
+      // 校验商品明细数据
+      const valid = await this.$refs.orderFormRef
         .validate()
         .catch((err) => err);
       if (valid !== true) {
@@ -1007,22 +1085,28 @@ export default {
       delete this.OrderForm.start_time;
       delete this.OrderForm.end_time;
       if (this.time) {
-        this.OrderForm.start_time = this.time[0]
-        this.OrderForm.end_time = this.time[1]
+        this.OrderForm.start_time = this.time[0];
+        this.OrderForm.end_time = this.time[1];
       }
       delete this.time;
       var loc = "";
-        for (let i = 0; i < this.selectedOptions.length; i++) {
-            loc += codeToText[this.selectedOptions[i]]+',';
-        }
-      this.OrderForm.province_city_area_address=loc+this.OrderForm.address
+      for (let i = 0; i < this.selectedOptions.length; i++) {
+        loc += codeToText[this.selectedOptions[i]] + ",";
+      }
+      this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
       const params = this.MixinClone(this.OrderForm);
-      console.log(params);
-      params.item_list=params.product_list
-      /**/ params.product_list.map(el=>{
-        el.goods_id=el.id
-        el.id=""
-      })
+      params.product_list = params.product_list.map((el) => {
+        el.product_id = el.id;
+        el.id = "";
+        return el;
+      });
+      params.price = this.price;
+      params.real_price = Number(params.real_price);
+      params.item_list = params.product_list;
+      /* params.product_list.map((el) => {
+        el.goods_id = el.id;
+        el.id = "";
+      });*/
       params.order_time = Math.floor(params.order_time / 1000);
       params.payment_time = Math.floor(params.payment_time / 1000);
       this.formLoading = true;
@@ -1030,10 +1114,10 @@ export default {
         API_Order.editOrder(id, params)
           .then((response) => {
             this.$message.success("修改成功!");
-            API_Order.submit(id).then(res=>{
-              this.$message.success("订单已确认")
+            API_Order.submit(id).then((res) => {
+              this.$message.success("订单已确认");
               this.backOrderList();
-            })
+            });
           })
           .finally(() => {
             this.formLoading = false;
@@ -1043,9 +1127,10 @@ export default {
           .then((res) => {
             this.$message.success("添加成功!");
             console.log(res);
-            /**/API_Order.submit(res).then(res=>{
-              this.$message.success("订单已确认") })
-              this.backOrderList();
+            /**/ API_Order.submit(res).then((res) => {
+              this.$message.success("订单已确认");
+            });
+            this.backOrderList();
           })
           .finally(() => {
             this.formLoading = false;
@@ -1057,9 +1142,9 @@ export default {
       API_BasicSetting.getWarehouseListAll({}).then((response) => {
         this.warehouseList = response;
       });
-      API_Setting.getPage({ dictType: "customer_type"}).then(res=>{
-        this.customer.options=res.data
-      })
+      API_Setting.getPage({ dictType: "customer_type" }).then((res) => {
+        this.customer.options = res.data;
+      });
     },
     /** 审核 */
     async handleAudit(isPass, remark) {
@@ -1087,53 +1172,58 @@ export default {
     /** 获取订单详情 */
     GET_OrderDetail() {
       API_Order.getOrderDetail(this.id).then((response) => {
-        response.product_list=response.item_list.map(el=>{
-          el.allow_sn=el.goods_vo.allow_sn
-          el.bar_code=el.goods_vo.bar_code
-          el.brand_id=el.goods_vo.brand_id
-          el.brand_name=el.goods_vo.brand_name
-          el.category_id=el.goods_vo.category_id
-          el.category_ids=el.goods_vo.category_ids
-          el.category_name=el.goods_vo.category_name
-          el.cost_price=el.goods_vo.cost_price
-          el.create_time=el.goods_vo.create_time
-          el.creator=el.goods_vo.creator
-          el.description=el.goods_vo.description
-          el.en_name=el.goods_vo.en_name
-          el.freight_template_id=el.goods_vo.freight_template_id
-          el.goods_style=el.goods_vo.goods_style
-          el.goods_unit=el.goods_vo.goods_unit
-          el.goods_unit=el.goods_vo.goods_unit
-          el.have_spec=el.goods_vo.have_spec
-          el.hire_or_sail=el.goods_vo.hire_or_sail
-          el.id=el.goods_vo.id
-          el.image=el.goods_vo.image
-          el.image_list=el.goods_vo.image_list
-          el.label_names=el.goods_vo.label_names
-          el.market_enable=el.goods_vo.market_enable
-          el.mkt_price=el.goods_vo.mkt_price
-          el.name=el.goods_vo.name
-          el.params_list=el.goods_vo.params_list
-          el.price=el.goods_vo.price
-          el.sn=el.goods_vo.sn
-          el.sn_code=el.goods_vo.sn_code
-          el.sort=el.goods_vo.sort
-          el.update_time=el.goods_vo.update_time
-          el.updater=el.goods_vo.updater
-          el.usable_stock=el.goods_vo.usable_stock
-          el.video=el.goods_vo.video
-          return el
-        })
+        /**/ this.price = response.price;
+        response.product_list = response.item_list; /* .map((el) => {
+          el.allow_sn = el.goods_vo.allow_sn;
+          el.bar_code = el.goods_vo.bar_code;
+          el.brand_id = el.goods_vo.brand_id;
+          el.brand_name = el.goods_vo.brand_name;
+          el.category_id = el.goods_vo.category_id;
+          el.category_ids = el.goods_vo.category_ids;
+          el.category_name = el.goods_vo.category_name;
+          el.cost_price = el.goods_vo.cost_price;
+          el.create_time = el.goods_vo.create_time;
+          el.creator = el.goods_vo.creator;
+          el.description = el.goods_vo.description;
+          el.en_name = el.goods_vo.en_name;
+          el.freight_template_id = el.goods_vo.freight_template_id;
+          el.goods_style = el.goods_vo.goods_style;
+          el.goods_unit = el.goods_vo.goods_unit;
+          el.goods_unit = el.goods_vo.goods_unit;
+          el.have_spec = el.goods_vo.have_spec;
+          el.hire_or_sail = el.goods_vo.hire_or_sail;
+          el.id = el.goods_vo.id;
+          el.image = el.goods_vo.image;
+          el.image_list = el.goods_vo.image_list;
+          el.label_names = el.goods_vo.label_names;
+          el.market_enable = el.goods_vo.market_enable;
+          el.mkt_price = el.goods_vo.mkt_price;
+          el.name = el.goods_vo.name;
+          el.params_list = el.goods_vo.params_list;
+          el.price = el.goods_vo.price;
+          el.sn = el.goods_vo.sn;
+          el.sn_code = el.goods_vo.sn_code;
+          el.sort = el.goods_vo.sort;
+          el.update_time = el.goods_vo.update_time;
+          el.updater = el.goods_vo.updater;
+          el.usable_stock = el.goods_vo.usable_stock;
+          el.video = el.goods_vo.video;
+          return el;
+        }); */
 
-        this.selectedOptions=response.province_city_area.split(",")
+        this.selectedOptions = response.province_city_area.split(",");
         this.OrderForm = response;
-           console.log( this.OrderForm);
-       /*  this.fileList = response.attachment
+        console.log(this.OrderForm.product_list);
+        /* this.fileList = response.attachment
           ? [{ name: "附件", url: response.attachment }]
-          : []; */
+          : [];
         this.OrderForm.order_time = Math.floor(
           this.OrderForm.order_time * 1000
-        );
+        );*/
+        if (response.type == "TO_C") {
+          this.time.push(response.start_time);
+          this.time.push(response.end_time);
+        }
         if (this.OrderForm.payment_time) {
           this.OrderForm.payment_time = Math.floor(
             this.OrderForm.payment_time * 1000
@@ -1142,19 +1232,65 @@ export default {
       });
     },
   },
+  computed: {
+    price() {
+      let total = 0;
+      if(!this.OrderForm.product_list) return
+      if (!this.id) {
+        if (this.OrderForm.type == "TO_C") {
+          var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
+          var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
+          var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
+          var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
+          this.OrderForm.product_list.map((item) => {
+            total += item.day_price * item.num * monthDiff;
+          });
+          return total;
+        } else {
+          this.OrderForm.product_list.map((item) => {
+            total += item.price * item.num;
+          });
+          return total;
+        }
+      } else {
+        if (this.OrderForm.type == "TO_C") {
+          var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
+          var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
+          var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
+          var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
+          this.OrderForm.product_list.map((item) => {
+            total += item.product_vo.day_price * item.num * monthDiff;
+          });
+          return total;
+        } else {
+          this.OrderForm.product_list.map((item) => {
+            total += item.product_vo.price * item.num;
+          });
+          return total;
+        }
+      }
+    },
+  },
   watch: {
+    discount: {
+      deep: true,
+      handler(newVal) {
+        this.OrderForm.pay_price = this.price * newVal;
+      },
+    },
     "OrderForm.product_list": {
       deep: true,
       handler(newVal) {
         newVal.forEach((item) => {
-          // 税额(总)
-          item.tax_price = item.total_price * item.tax_rate * 0.01;
-          // 合计
+          /* item.sum=item.price*item.num
+          return console.log(item.sum+=); */
         });
         /* this.OrderForm.total_price = newVal.reduce(
           (sum, item) => sum + item.total_price,
           0
-        );
+        );    // 税额(总)
+          item.tax_price = item.total_price * item.tax_rate * 0.01;
+          // 合计
         this.OrderForm.discount_price = newVal.reduce(
           (sum, item) => sum + item.discount_price * 1,
           0

+ 33 - 20
manager-admin/src/views/stock/orderOutbound.vue

@@ -25,7 +25,11 @@
               </el-form-item>
             </el-col>
             <el-col>
-              <el-form-item label="预约时间:" prop="" v-if="deliveryForms.appointment_type!=0">
+              <el-form-item
+                label="预约时间:"
+                prop=""
+                v-if="deliveryForms.appointment_type != 0"
+              >
                 <el-date-picker
                   v-model="deliveryForms.appointment_time"
                   type="datetime"
@@ -62,7 +66,7 @@
                 ></el-input> </el-form-item
             ></el-col>
             <el-col :span="12">
-              <el-form-item label="配送地址:" prop="sender.address">
+              <el-form-item label="发货地址:" prop="sender.address">
                 <el-cascader
                   size="large"
                   :options="options"
@@ -172,32 +176,32 @@
             <el-table-column type="selection" width="40" align="center" />
             <el-table-column label="商品编号">
               <template slot-scope="scope">
-                {{ scope.row.sn }}
+                {{ scope.row.goods_vo.sn }}
               </template>
             </el-table-column>
             <el-table-column label="商品名称">
               <template slot-scope="scope">
-                {{ scope.row.name }}
+                {{ scope.row.goods_vo.name }}
               </template>
             </el-table-column>
             <el-table-column label="条码">
               <template slot-scope="scope">
-                {{ scope.row.bar_code }}
+                {{ scope.row.product_vo.bar_code }}
               </template>
             </el-table-column>
             <el-table-column label="序列号">
               <template slot-scope="scope">
-                {{ scope.row.sn_code }}
+                {{ scope.row.product_vo.sn_code }}
               </template>
             </el-table-column>
             <el-table-column label="规格型号">
               <template slot-scope="scope">
-                {{ scope.row.goods_style }}
+                {{ scope.row.product_vo.spec_name.join("/") }}
               </template>
             </el-table-column>
             <el-table-column label="单位">
               <template slot-scope="scope">
-                {{ scope.row.goods_unit }}
+                {{ scope.row.product_vo.unit }}
               </template>
             </el-table-column>
             <el-table-column label="订单数量">
@@ -486,6 +490,8 @@ export default {
         ],
       },
       outType: "",
+      send_address:'',
+      receive_address:''
       /* nameToCodeMap:{} */
     };
   },
@@ -511,18 +517,19 @@ export default {
     this.GET_WarehouseOutDetail();
     this.GET_AdministratorList();
     this.outType = this.$route.params.type;
-    console.log(this.kdnCode);
+    console.log(this.outType);
     /* this.generateMap(regionData); */
   },
   methods: {
     /* 收获地址 */
-    receiverChange() {
+    receiverChange(val) {
       this.deliveryForms.receiver.province_name =
         codeToText[this.receiverOptions[0]];
       this.deliveryForms.receiver.city_name =
         codeToText[this.receiverOptions[1]];
       this.deliveryForms.receiver.area_name =
         codeToText[this.receiverOptions[2]];
+        this.receive_address=val.join(",")
     },
     /* 发货地址 */
     sendHandleChange(val) {
@@ -530,7 +537,7 @@ export default {
         codeToText[this.selectedOptions[0]];
       this.deliveryForms.sender.city_name = codeToText[this.selectedOptions[1]];
       this.deliveryForms.sender.area_name = codeToText[this.selectedOptions[2]];
-      console.log(val);
+      this.send_address=val.join(",")
     },
 
     obtainOrder() {
@@ -552,10 +559,10 @@ export default {
           //商品信息
           const item = {};
           this.product_list.map((el) => {
-            item.goods_name = el.name;
-            item.goods_price = el.price;
+            item.goods_name = el.goods_vo.name;
+            /* item.goods_price = el.product_vo.price; */
             item.quantity = el.num;
-            item.unit = el.goods_unit;
+            item.unit = el.product_vo.unit;
             return params.goods_list.push(item);
           });
           params.goods_num = this.product_list.reduce(
@@ -569,7 +576,7 @@ export default {
           params.order_code = this.id;
           API_order.getKdShip(this.id, params).then((res) => {
             this.kdnCode = res;
-          })
+          });
         } else {
           console.log("error submit!!");
           return false;
@@ -590,7 +597,7 @@ export default {
       });
     },
     saveErpWarehouseOut() {
-      API_order.outOrderSend(this.id).then((res) => {
+      API_order.outOrderSend(this.id,{send_address:this.send_address,receive_address:this.receive_address}).then((res) => {
         this.$router.push({ name: "warehouseOut" });
       });
       return;
@@ -649,7 +656,7 @@ export default {
     /** 获取发货单详情*/
     GET_WarehouseOutDetail() {
       API_order.getOrderDetail(this.id).then((res) => {
-        res.product_list = res.item_list.map((el) => {
+        res.product_list = res.item_list; /* .map((el) => {
           el.allow_sn = el.goods_vo.allow_sn;
           el.bar_code = el.goods_vo.bar_code;
           el.brand_id = el.goods_vo.brand_id;
@@ -685,8 +692,9 @@ export default {
           el.usable_stock = el.goods_vo.usable_stock;
           el.video = el.goods_vo.video;
           return el;
-        });
+        }); */
         this.product_list = res.item_list;
+        console.log(this.outType);
         if (this.outType !== undefined) {
           this.deliveryForms.appointment_type = res.appointment_type;
           this.deliveryForms.appointment_time = res.appointment_time;
@@ -702,12 +710,17 @@ export default {
           this.receiverOptions.push(this.findCode(res.receiver_province_name));
           this.receiverOptions.push(this.findCode(res.receiver_city_name));
           this.receiverOptions.push(this.findCode(res.receiver_area_name)); */
-          this.deliveryForms.total_weight = res.total_weight;
           this.deliveryForms.total_volume = res.total_volume;
-          this.deliveryForms.declared_value = res.declared_value;
+          /* this.deliveryForms.declared_value = res.real_price; */
           this.deliveryForms.remark = res.remark;
           this.kdnCode = res.kdn_order_code;
         }
+        this.deliveryForms.total_weight = res.item_list.map(el=>{
+          return Number(el.product_vo.weight*el.num)
+        });
+        this.deliveryForms.declared_value =Number(res.real_price)
+        this.selectedOptions=res.send_address.split(',')
+        this.receiverOptions=res.receive_address.split(',')
         console.log(this.deliveryForms);
         /* this.deliveryForms.sender=res.sender_province_name */
       });

+ 0 - 2
manager-admin/src/views/stock/orderReturn.vue

@@ -246,10 +246,8 @@ export default {
     },
     statusFilter(val) {
       let name = "";
-      console.log(this.orderType);
       this.orderType.map((el) => {
         if (el.value == val) {
-          console.log(el.label);
           return (name = el.label);
         }
       });

+ 18 - 13
manager-admin/src/views/stock/orderReturnAdd.vue

@@ -9,7 +9,7 @@
       <el-form-item label="订单" style="white-space: nowrap;">
         <el-button v-if="type !== 'detail'" class="button" size="mini" type="primary" @click="handleSelectOrderSn"
           :disabled="type === 'audit'">选择</el-button>
-        <span v-if="orderReturnAddForm.order_sn">{{ orderReturnAddForm.order_sn }}</span>
+        <span v-if="orderReturnAddForm.sn">{{ orderReturnAddForm.sn }}</span>
       </el-form-item>
       <el-form-item></el-form-item>
       <el-form-item label="退货说明" prop="return_remark" style="width: 900px">
@@ -26,32 +26,33 @@
             :header-cell-style="{ textAlign: 'center' }" style="width: 100%; margin-top: 20px;">
             <el-table-column label="商品编号" >
               <template slot-scope="scope">
-                {{ scope.row.sn }}
+                {{ scope.row.goods_vo.sn }}
               </template>
             </el-table-column>
             <el-table-column label="商品名称" >
               <template slot-scope="scope">
-                {{ scope.row.name }}
+                {{ scope.row.goods_vo.name }}
               </template>
             </el-table-column>
             <el-table-column label="规格型号" >
               <template slot-scope="scope">
-                {{ scope.row.goods_style }}
+                {{ scope.row.product_vo.spec_name.join('/') }}
               </template>
             </el-table-column>
             <el-table-column label="单位" >
               <template slot-scope="scope">
-                {{ scope.row.goods_unit }}
+                {{ scope.row.product_vo.unit }}
               </template>
             </el-table-column>
             <el-table-column label="单价" >
               <template slot-scope="scope">
-                ¥{{ scope.row.price }}
+                ¥{{ scope.row.product_vo.price }}
               </template>
             </el-table-column>
             <el-table-column label="购买数量">
               <template slot-scope="scope">
-                {{ scope.row.num }}
+                <span v-if="!id">{{ scope.row.num }}</span>
+                <span v-else>{{scope.row.order_num}}</span>
               </template>
             </el-table-column>
             <el-table-column label="退货数量" >
@@ -171,7 +172,7 @@ export default {
       if (orders) {
         API_orderReturn.getWarehouseOutProduct(orders[0].id).then(response => {
           /* const product_list =*/
-         response.item_list.map(el => {
+        /* response.item_list.map(el => {
             el.allow_sn=el.goods_vo.allow_sn
             el.bar_code=el.goods_vo.bar_code
             el.brand_id=el.goods_vo.brand_id
@@ -190,7 +191,7 @@ export default {
             el.goods_unit=el.goods_vo.goods_unit
             el.have_spec=el.goods_vo.have_spec
             el.hire_or_sail=el.goods_vo.hire_or_sail
-            /* el.id=el.goods_vo.id */
+             el.id=el.goods_vo.id
             el.image=el.goods_vo.image
             el.image_list=el.goods_vo.image_list
             el.label_names=el.goods_vo.label_names
@@ -207,7 +208,8 @@ export default {
             el.usable_stock=el.goods_vo.usable_stock
             el.video=el.goods_vo.video
             return el
-          })
+          })*/
+          this.orderReturnAddForm.sn=response.sn
           this.orderReturnAddForm.item_list = response.item_list
 
         })
@@ -250,8 +252,11 @@ export default {
       const { id } = this.orderReturnAddForm
       const params = this.MixinClone(this.orderReturnAddForm)
       const mapList={}
+      params.order_sn=params.sn
       params.item_list=params.item_list.map(el=>{
         mapList.order_item_id= el.id
+        mapList.order_num=el.num
+        mapList.product_id=el.product_id
         mapList.return_num=el.return_num
         return mapList
       })
@@ -287,7 +292,7 @@ export default {
     },
     GET_orderReturnDetail() {
       API_orderReturn.getorderReturnInfo(this.id).then(response => {
-        response.item_list.map(el => {
+        /* response.item_list.map(el => {
             el.allow_sn=el.goods_vo.allow_sn
             el.bar_code=el.goods_vo.bar_code
             el.brand_id=el.goods_vo.brand_id
@@ -306,7 +311,7 @@ export default {
             el.goods_unit=el.goods_vo.goods_unit
             el.have_spec=el.goods_vo.have_spec
             el.hire_or_sail=el.goods_vo.hire_or_sail
-            /* el.id=el.goods_vo.id */
+            /* el.id=el.goods_vo.id
             el.image=el.goods_vo.image
             el.image_list=el.goods_vo.image_list
             el.label_names=el.goods_vo.label_names
@@ -323,7 +328,7 @@ export default {
             el.usable_stock=el.goods_vo.usable_stock
             el.video=el.goods_vo.video
             return el
-          })
+          }) **/
         this.orderReturnAddForm = response
         this.GET_WarehouseList({ dept_id: response.dept_id })
       })

+ 4 - 4
ui-components/PickerGoods/src/defaultOptions.js

@@ -50,8 +50,8 @@ export const data = {
 
 // 一般列
 export const generalColumns = [
-  { label: '商品编号', prop: 'sn' },
-  { label: '商品名称', prop: 'name' },
-  { label: '规格型号', prop: 'goods_style' },
-  { label: '商品类别', prop: 'category_name' }
+  { label: '商品编号', prop: 'goods_vo.sn' },
+  { label: '商品名称', prop: 'goods_vo.name' },
+  { label: '规格型号', prop: 'spec_name' },
+  { label: '库存数量', prop: 'usable_stock' }
 ]

+ 2 - 1
ui-components/PickerGoods/src/main.vue

@@ -56,7 +56,7 @@ export default {
       purchasePlanParams: {
         page_no: 1,
         page_size: 10,
-        market_enable: true
+        market_enable: true,
       },
       searchParams: {
         sn: ''
@@ -147,6 +147,7 @@ export default {
     async getGoodsList() {
       this.loading = true
       const params = JSON.parse(JSON.stringify(this.purchasePlanParams))
+      console.log(params);
       request({
         url: this.goodsApi,
         method: 'get',

+ 4 - 4
ui-components/PickerWarehouseEntryBatch/src/defaultOptions.js

@@ -62,12 +62,12 @@ export const data = {
 // 一般列
 export const generalColumns = [
   // { label: '仓库名称', prop: 'warehouse_entry_id' },
-  { label: '商品编号', prop: 'sn' },
+  { label: '商品编号', prop: 'goods_vo.sn' },
   // { label: '库位号',   prop: 'code'},
   { label: '商品条码', prop: 'bar_code' },
   { label: '序列号',   prop: 'sn_code'},
-  { label: '商品名称', prop: 'name' },
-  { label: '规格型号', prop: 'goods_style' },
-  { label: '单位', prop: 'goods_unit' },
+  { label: '商品名称', prop: 'goods_vo.name' },
+  { label: '规格型号', prop: 'spec_name' },
+  { label: '单位', prop: 'unit' },
   { label: '库存数量', prop: 'usable_stock' }
 ]