Selaa lähdekoodia

更新生命周期

qxmlucky 1 kuukausi sitten
vanhempi
säilyke
42f023fda0
3 muutettua tiedostoa jossa 103 lisäystä ja 70 poistoa
  1. 53 0
      src/api/omsOrder/lifeCycle.js
  2. 0 44
      src/api/product/lifeCycle.js
  3. 50 26
      src/views/omsOrder/lifeCycle/index.vue

+ 53 - 0
src/api/omsOrder/lifeCycle.js

@@ -0,0 +1,53 @@
+import request from '@/benyun/utils/request'
+
+//查询物料SKU
+export function queryMaterialSku(query) {
+    return request({
+        url: '/maindata/maindataMaterialSku/queryMaterialSku',
+        method: 'get',
+        params: query
+    })
+}
+
+// 查询生命周期列表
+export function listLifeCycle(query) {
+    return request({
+        url: '/omsOrder/lifeCycle/list',
+        method: 'get',
+        params: query
+    })
+}
+
+// 查询生命周期详细
+export function getLifeCycle(id) {
+    return request({
+        url: '/omsOrder/lifeCycle/' + id,
+        method: 'get'
+    })
+}
+
+// 新增生命周期
+export function addLifeCycle(data) {
+    return request({
+        url: '/omsOrder/lifeCycle',
+        method: 'post',
+        data: data
+    })
+}
+
+// 修改生命周期
+export function updateLifeCycle(data) {
+    return request({
+        url: '/omsOrder/lifeCycle',
+        method: 'put',
+        data: data
+    })
+}
+
+// 删除生命周期
+export function delLifeCycle(id) {
+    return request({
+        url: '/omsOrder/lifeCycle/' + id,
+        method: 'delete'
+    })
+}

+ 0 - 44
src/api/product/lifeCycle.js

@@ -1,44 +0,0 @@
-import request from '@/utils/request'
-
-// 查询生命周期列表
-export function listLifeCycle(query) {
-  return request({
-    url: '/product/lifeCycle/list',
-    method: 'get',
-    params: query
-  })
-}
-
-// 查询生命周期详细
-export function getLifeCycle(id) {
-  return request({
-    url: '/product/lifeCycle/' + id,
-    method: 'get'
-  })
-}
-
-// 新增生命周期
-export function addLifeCycle(data) {
-  return request({
-    url: '/product/lifeCycle',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改生命周期
-export function updateLifeCycle(data) {
-  return request({
-    url: '/product/lifeCycle',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除生命周期
-export function delLifeCycle(id) {
-  return request({
-    url: '/product/lifeCycle/' + id,
-    method: 'delete'
-  })
-}

+ 50 - 26
src/views/product/lifeCycle/index.vue → src/views/omsOrder/lifeCycle/index.vue

@@ -15,8 +15,8 @@
             icon="el-icon-plus"
             size="mini"
             @click="handleAdd"
-            v-hasPermi="['product:lifeCycle:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -26,8 +26,8 @@
             size="mini"
             :disabled="single"
             @click="handleUpdate"
-            v-hasPermi="['product:lifeCycle:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -37,8 +37,8 @@
             size="mini"
             :disabled="multiple"
             @click="handleDelete"
-            v-hasPermi="['product:lifeCycle:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -47,23 +47,23 @@
             icon="el-icon-download"
             size="mini"
             @click="handleExport"
-            v-hasPermi="['product:lifeCycle:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="lifeCycleList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-<!--      <el-table-column label="主键" align="center" prop="id" />-->
-      <el-table-column label="创建人" align="center" prop="createBy" />
+      <el-table-column type="selection" width="55" align="center"/>
+      <!--      <el-table-column label="主键" align="center" prop="id"/>-->
+      <el-table-column label="创建人" align="center" prop="createBy"/>
       <el-table-column label="创建时间" align="center" prop="createTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="事项" align="center" prop="matter" />
-      <el-table-column label="操作人" align="center" prop="operator" />
+      <el-table-column label="事项" align="center" prop="matter"/>
+      <el-table-column label="操作人" align="center" prop="operator"/>
       <el-table-column label="时间" align="center" prop="time" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span>
@@ -81,15 +81,15 @@
               type="text"
               icon="el-icon-edit"
               @click="handleUpdate(scope.row)"
-              v-hasPermi="['product:lifeCycle:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
               size="mini"
               type="text"
               icon="el-icon-delete"
               @click="handleDelete(scope.row)"
-              v-hasPermi="['product:lifeCycle:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -106,10 +106,10 @@
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="事项" prop="matter">
-          <el-input v-model="form.matter" placeholder="请输入事项" />
+          <el-input v-model="form.matter" placeholder="请输入事项"/>
         </el-form-item>
         <el-form-item label="操作人" prop="operator">
-          <el-input v-model="form.operator" placeholder="请输入操作人" />
+          <el-input v-model="form.operator" placeholder="请输入操作人"/>
         </el-form-item>
         <el-form-item label="时间" prop="time">
           <el-date-picker clearable
@@ -129,6 +129,16 @@
             ></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="请选择物料" prop="skuId">
+          <el-select placeholder="请选择物料">
+            <el-option
+                v-for="sku in materialSkuList"
+                :key="sku.id"
+                :label="sku.skuTitle"
+                :value="sku.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -139,7 +149,14 @@
 </template>
 
 <script>
-import { listLifeCycle, getLifeCycle, delLifeCycle, addLifeCycle, updateLifeCycle } from "@/api/product/lifeCycle";
+import {
+  listLifeCycle,
+  getLifeCycle,
+  delLifeCycle,
+  addLifeCycle,
+  updateLifeCycle,
+  queryMaterialSku
+} from "@/api/omsOrder/lifeCycle";
 
 export default {
   name: "LifeCycle",
@@ -160,6 +177,7 @@ export default {
       total: 0,
       // 生命周期表格数据
       lifeCycleList: [],
+      materialSkuList: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -172,14 +190,19 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
+      rules: {}
     };
   },
   created() {
     this.getList();
+    this.queryMaterialSkuList();
   },
   methods: {
+    queryMaterialSkuList() {
+      queryMaterialSku(this.queryParams).then(response => {
+        this.materialSkuList = response.data;
+      });
+    },
     /** 查询生命周期列表 */
     getList() {
       this.loading = true;
@@ -229,7 +252,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
@@ -271,16 +294,17 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除生命周期编号为"' + ids + '"的数据项?').then(function() {
+      this.$modal.confirm('是否确认删除生命周期编号为"' + ids + '"的数据项?').then(function () {
         return delLifeCycle(ids);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      }).catch(() => {
+      });
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('product/lifeCycle/export', {
+      this.download('omsOrder/lifeCycle/export', {
         ...this.queryParams
       }, `lifeCycle_${new Date().getTime()}.xlsx`)
     }