Browse Source

清单模板复制报错问题

lishihao 3 years ago
parent
commit
3d8c03fb13

+ 1 - 1
modules/bills_template_lib/controllers/bills_template_controller.js

@@ -158,7 +158,7 @@ class BillsTemplateController extends BaseController {
         try {
             const data = JSON.parse(req.body.data);
             const userName = req.session.managerData.username;
-            await billsTemplateFacade.copyLib(data.libID, data.name, userName ,data.libType);
+            await billsTemplateFacade.copyLib(data.libID, data.name, userName);
             res.json({error: 0, data: null, message: 'success'})
         } catch (err) {
             console.log(err);

+ 1 - 2
modules/bills_template_lib/facade/bills_template_facade.js

@@ -96,14 +96,13 @@ async function addLib(data){
     }
 }
 
-async function copyLib(libID, name, userName,libType) {
+async function copyLib(libID, name, userName) {
     const lib = await billTemplateLibModel.findOne({ID: libID}, '-_id').lean();
     const libItems = await billTemplateItemsModel.find({libID}, '-_id').lean();
     lib.creator = userName;
     lib.createDate = Date.now();
     lib.recentOpr = [{operator: userName, operator: moment(lib.createDate).format('YYYY-MM-D HH:mm:ss')}];
     lib.name = name;
-    lib.libType=libType;
     lib.ID = uuidV1();
     await billTemplateLibModel.create(lib);
     libItems.forEach(item => {

+ 1 - 1
web/maintain/bill_template_lib/js/bills_template.js

@@ -67,7 +67,7 @@ $(document).ready(function() {
             return;
         }
         $.bootstrapLoading.start();
-        CommonAjax.post('/billsTemplate/copyLib', {libID, name,libType}, function () {
+        CommonAjax.post('/billsTemplate/copyLib', {libID, name}, function () {
             $.bootstrapLoading.end();
             window.location.reload();
         }, function () {