(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6cbe145d"],{"0954":function(t,e,a){},"23c4":function(t,e,a){"use strict";a("0954")},"31c9":function(t,e,a){"use strict";a("7483")},"6aee":function(t,e,a){"use strict";a("94a6")},7483:function(t,e,a){},"7d0e":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"NCC-dialog NCC-dialog_center",attrs:{title:"批次详情","close-on-click-modal":!1,visible:t.visible,"lock-scroll":"",width:"1000px"},on:{"update:visible":function(e){t.visible=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("el-card",{staticClass:"box-card",attrs:{shadow:"never"}},[a("div",{staticClass:"card-header",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("批次基本信息")])]),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("批次ID:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.BatchId||"无"))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("创建时间:")]),a("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.batchInfo.CreateTime)))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("创建人:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.CreateUserName||"无"))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("总记录数:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.TotalCount||0))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("有效记录数:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.EffectiveCount||0))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("无效记录数:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.IneffectiveCount||0))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("总使用数量:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.TotalUsageQuantity||0))])])])],1)],1),t.batchInfo.ApplicationInfo?a("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"20px"},attrs:{shadow:"never"}},[a("div",{staticClass:"card-header",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("申请记录信息")])]),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("申请编号:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.ApplicationInfo.Id||"无"))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("申请人:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.ApplicationInfo.ApplicationUserName||"无"))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("申请门店:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.ApplicationInfo.ApplicationStoreName||"无"))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("申请时间:")]),a("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.batchInfo.ApplicationInfo.ApplicationTime)))])])]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("审批状态:")]),a("el-tag",{attrs:{type:t.getStatusType(t.batchInfo.ApplicationInfo.ApprovalStatus),size:"small"}},[t._v("\n\t\t\t\t\t\t\t"+t._s(t.batchInfo.ApplicationInfo.ApprovalStatus||"无")+"\n\t\t\t\t\t\t")])],1)]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("是否已领取:")]),a("el-tag",{attrs:{type:1===t.batchInfo.ApplicationInfo.IsReceived?"success":"info",size:"small"}},[t._v("\n\t\t\t\t\t\t\t"+t._s(1===t.batchInfo.ApplicationInfo.IsReceived?"已领取":"未领取")+"\n\t\t\t\t\t\t")])],1)]),t.batchInfo.ApplicationInfo.ReceiveTime?a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("领取时间:")]),a("span",{staticClass:"value"},[t._v(t._s(t.formatDateTime(t.batchInfo.ApplicationInfo.ReceiveTime)))])])]):t._e(),t.batchInfo.ApplicationInfo.ReceiveUser?a("el-col",{attrs:{span:8}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("领取人:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.ApplicationInfo.ReceiveUserName||"无"))])])]):t._e(),t.batchInfo.ApplicationInfo.Remarks?a("el-col",{attrs:{span:24}},[a("div",{staticClass:"info-item"},[a("span",{staticClass:"label"},[t._v("备注:")]),a("span",{staticClass:"value"},[t._v(t._s(t.batchInfo.ApplicationInfo.Remarks||"无"))])])]):t._e()],1)],1):t._e(),a("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"20px"},attrs:{shadow:"never"}},[a("div",{staticClass:"card-header",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("使用记录列表")])]),a("NCC-table",{attrs:{data:t.batchInfo.UsageRecords||[],"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{label:"产品名称",align:"center",prop:"productName"}}),a("el-table-column",{attrs:{label:"单价",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v("¥"+t._s(t.formatMoney(e.row.unitPrice)))])]}}])}),a("el-table-column",{attrs:{label:"门店",align:"center",prop:"storeName"}}),a("el-table-column",{attrs:{label:"使用时间",align:"center",prop:"usageTime",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.formatDateTime(e.row.usageTime)))])]}}])}),a("el-table-column",{attrs:{label:"使用数量",align:"center",prop:"usageQuantity"}}),a("el-table-column",{attrs:{label:"合计金额",align:"center",prop:"totalAmount"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"amount-text"},[t._v("¥"+t._s(t.formatMoney(e.row.totalAmount)))])]}}])})],1)],1)],1)])},n=[],s=(a("c5f6"),a("f576"),a("9d50")),o={data:function(){return{visible:!1,loading:!1,batchInfo:{BatchId:"",CreateTime:null,CreateUser:"",CreateUserName:"",TotalCount:0,EffectiveCount:0,IneffectiveCount:0,TotalUsageQuantity:0,TotalUsageAmount:0,UsageRecords:[],ApplicationInfo:null}}},methods:{init:function(t){var e=this;this.visible=!0,this.loading=!0,this.batchInfo={BatchId:"",CreateTime:null,CreateUser:"",CreateUserName:"",TotalCount:0,EffectiveCount:0,IneffectiveCount:0,TotalUsageQuantity:0,TotalUsageAmount:0,UsageRecords:[],ApplicationInfo:null},Object(s["e"])(t).then((function(t){e.loading=!1,200==t.code&&t.data?e.batchInfo=t.data:e.$message({type:"error",message:t.msg||"查询失败"})})).catch((function(){e.loading=!1}))},getStatusType:function(t){var e={"待审批":"info","审批中":"warning","已通过":"success","未通过":"danger","已退回":"info"};return e[t]||"info"},formatDateTime:function(t){if(!t)return"无";var e=new Date(t),a=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(i,"-").concat(n," ").concat(s,":").concat(o,":").concat(r)},formatMoney:function(t){return t||0===t?Number(t).toFixed(2):"0.00"}}},r=o,l=(a("fb6d"),a("2877")),c=Object(l["a"])(r,i,n,!1,null,"30a620cb",null);e["default"]=c.exports},"8b14":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"NCC-dialog NCC-dialog_center",attrs:{title:"添加使用记录","close-on-click-modal":!1,visible:t.visible,"lock-scroll":"",width:"900px"},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{ref:"elForm",attrs:{model:t.dataForm,size:"small","label-width":"120px","label-position":"right",rules:t.rules}},[a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"审批人",prop:"approverId"}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择审批人(财务老师或库管)",clearable:"",filterable:""},on:{change:t.onApproverChange},model:{value:t.dataForm.approverId,callback:function(e){t.$set(t.dataForm,"approverId",e)},expression:"dataForm.approverId"}},t._l(t.approverOptions,(function(t){return a("el-option",{key:t.id,attrs:{label:t.label,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"申请门店",prop:"applicationStoreId"}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择申请门店",clearable:"",filterable:""},model:{value:t.dataForm.applicationStoreId,callback:function(e){t.$set(t.dataForm,"applicationStoreId",e)},expression:"dataForm.applicationStoreId"}},t._l(t.storeOptions,(function(t){return a("el-option",{key:t.id,attrs:{label:t.dm,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[a("el-input",{style:{width:"100%"},attrs:{type:"textarea",rows:2,placeholder:"请输入备注(可选)",maxlength:"500","show-word-limit":""},model:{value:t.dataForm.remarks,callback:function(e){t.$set(t.dataForm,"remarks",e)},expression:"dataForm.remarks"}})],1)],1)],1),a("el-divider"),a("div",{staticClass:"usage-items-container"},t._l(t.dataForm.usageItems,(function(e,i){return a("div",{key:i,staticClass:"usage-item-row"},[a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"产品",prop:"usageItems."+i+".productId",rules:t.rules.productId}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择产品",clearable:"",filterable:""},on:{change:function(a){return t.onProductChange(e,i)}},model:{value:e.productId,callback:function(a){t.$set(e,"productId",a)},expression:"item.productId"}},t._l(t.productOptions,(function(t){return a("el-option",{key:t.id,attrs:{label:t.productName,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"门店",prop:"usageItems."+i+".storeId",rules:t.rules.storeId}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择门店",clearable:"",filterable:""},model:{value:e.storeId,callback:function(a){t.$set(e,"storeId",a)},expression:"item.storeId"}},t._l(t.storeOptions,(function(t){return a("el-option",{key:t.id,attrs:{label:t.dm,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"使用数量",prop:"usageItems."+i+".usageQuantity",rules:t.rules.usageQuantity}},[a("el-input-number",{style:{width:"100%"},attrs:{placeholder:"数量",min:1,precision:0},model:{value:e.usageQuantity,callback:function(a){t.$set(e,"usageQuantity",a)},expression:"item.usageQuantity"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"使用时间",prop:"usageItems."+i+".usageTime",rules:t.rules.usageTime}},[a("el-date-picker",{style:{width:"100%"},attrs:{type:"datetime",placeholder:"使用时间","value-format":"yyyy-MM-dd HH:mm:ss",format:"yyyy-MM-dd HH:mm:ss"},model:{value:e.usageTime,callback:function(a){t.$set(e,"usageTime",a)},expression:"item.usageTime"}})],1)],1),t.dataForm.usageItems.length>1?a("el-col",{attrs:{span:24}},[a("div",{staticClass:"item-actions"},[a("el-button",{staticClass:"delete-btn",attrs:{type:"text",icon:"el-icon-delete"},on:{click:function(e){return t.removeItem(i)}}},[t._v("删除")])],1)]):t._e()],1),i1?this.dataForm.usageItems.splice(t,1):this.$message({type:"warning",message:"至少保留一条记录"})},dataFormSubmit:function(){var t=this;if(!this.dataForm.approverId)return this.$message({type:"error",message:"请选择审批人"}),!1;if(!this.dataForm.applicationStoreId)return this.$message({type:"error",message:"请选择申请门店"}),!1;var e=!0;if(this.dataForm.usageItems.forEach((function(a,i){a.productId||(t.$message({type:"error",message:"第".concat(i+1,"条记录:请选择产品")}),e=!1),a.storeId||(t.$message({type:"error",message:"第".concat(i+1,"条记录:请选择门店")}),e=!1),(!a.usageQuantity||a.usageQuantity<=0)&&(t.$message({type:"error",message:"第".concat(i+1,"条记录:请输入使用数量")}),e=!1),a.usageTime||(t.$message({type:"error",message:"第".concat(i+1,"条记录:请选择使用时间")}),e=!1)})),!e)return!1;this.btnLoading=!0;var a=this.dataForm.usageItems.map((function(t){var e=t.usageTime;if(e&&!e.includes("T")){var a=new Date(e);e=a.toISOString()}return{productId:t.productId,storeId:t.storeId,usageTime:e,usageQuantity:t.usageQuantity,relatedConsumeId:t.relatedConsumeId||""}}));Object(o["a"])({url:"/api/Extend/LqInventoryUsage/BatchCreate",method:"POST",data:{approverId:this.dataForm.approverId,applicationStoreId:this.dataForm.applicationStoreId,remarks:this.dataForm.remarks||"",usageItems:a}}).then((function(e){t.btnLoading=!1,t.$message({type:"success",message:e.msg||"添加成功",onClose:function(){t.visible=!1,t.$emit("refresh")}})})).catch((function(){t.btnLoading=!1}))}}},l=r,c=(a("23c4"),a("2877")),u=Object(c["a"])(l,i,n,!1,null,"9bf686ae",null);e["default"]=u.exports},"94a6":function(t,e,a){},"9d50":function(t,e,a){"use strict";a.d(e,"c",(function(){return n})),a.d(e,"k",(function(){return s})),a.d(e,"g",(function(){return o})),a.d(e,"f",(function(){return r})),a.d(e,"d",(function(){return l})),a.d(e,"b",(function(){return c})),a.d(e,"h",(function(){return u})),a.d(e,"a",(function(){return p})),a.d(e,"j",(function(){return d})),a.d(e,"e",(function(){return m})),a.d(e,"i",(function(){return f}));a("6b54");var i=a("b775");function n(t){return Object(i["a"])({url:"/api/Extend/LqInventory/Create",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/api/Extend/LqInventory/Update",method:"put",data:t})}function o(t){return Object(i["a"])({url:"/api/Extend/LqInventory/GetList",method:"get",data:t})}function r(t){return Object(i["a"])({url:"/api/Extend/LqInventory/GetInfo",method:"get",data:{id:t}})}function l(t){return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/Create",method:"post",data:t})}function c(t,e){return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/Cancel?id="+t+"&remarks="+e,method:"put"})}function u(t){return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/GetList",method:"get",data:t})}function p(t,e,a){var n=new URLSearchParams;n.append("result",e),a&&n.append("opinion",a);var s=n.toString();return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/Approve/".concat(t).concat(s?"?"+s:""),method:"post"})}function d(t){return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/MarkReceived/".concat(t),method:"put"})}function m(t){return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/GetBatchInfo",method:"get",data:{batchId:t}})}function f(t){return Object(i["a"])({url:"/api/Extend/LqInventoryUsage/GetStoreReceiveStatistics",method:"post",data:t})}},c492:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"NCC-common-layout"},[a("div",{staticClass:"NCC-common-layout-center"},[a("el-row",{staticClass:"NCC-common-search-box",attrs:{gutter:16}},[a("el-form",{nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"申请门店"}},[a("el-select",{attrs:{placeholder:"请选择申请门店",clearable:"",filterable:""},model:{value:t.query.applicationStoreId,callback:function(e){t.$set(t.query,"applicationStoreId",e)},expression:"query.applicationStoreId"}},t._l(t.storeOptions,(function(t){return a("el-option",{key:t.id,attrs:{label:t.dm,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"审批状态"}},[a("el-select",{attrs:{placeholder:"请选择审批状态",clearable:""},model:{value:t.query.approvalStatus,callback:function(e){t.$set(t.query,"approvalStatus",e)},expression:"query.approvalStatus"}},[a("el-option",{attrs:{label:"待审批",value:"待审批"}}),a("el-option",{attrs:{label:"审批中",value:"审批中"}}),a("el-option",{attrs:{label:"已通过",value:"已通过"}}),a("el-option",{attrs:{label:"未通过",value:"未通过"}}),a("el-option",{attrs:{label:"已退回",value:"已退回"}})],1)],1)],1),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"是否已领取"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:t.query.isReceived,callback:function(e){t.$set(t.query,"isReceived",e)},expression:"query.isReceived"}},[a("el-option",{attrs:{label:"未领取",value:0}}),a("el-option",{attrs:{label:"已领取",value:1}})],1)],1)],1),a("el-col",{attrs:{span:6}},[a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.search()}}},[t._v("查询")]),a("el-button",{attrs:{icon:"el-icon-refresh-right"},on:{click:function(e){return t.reset()}}},[t._v("重置")])],1)],1)],1)],1),a("div",{staticClass:"NCC-common-layout-main NCC-flex-main"},[a("div",{staticClass:"NCC-common-head"},[a("div",[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){return t.addUsage()}}},[t._v("添加使用记录")])],1),a("div",{staticClass:"NCC-common-head-right"},[a("el-tooltip",{attrs:{effect:"dark",content:"刷新",placement:"top"}},[a("el-link",{attrs:{icon:"icon-ym icon-ym-Refresh NCC-common-head-icon",underline:!1},on:{click:function(e){return t.initData()}}})],1),a("screenfull",{attrs:{isContainer:""}})],1)]),a("NCC-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.list,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{label:"申请编号",align:"center",prop:"id",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"id-info"},[a("i",{staticClass:"el-icon-postcard id-icon"}),a("span",{staticClass:"text-nowrap"},[t._v(t._s(e.row.id||"无"))])])]}}])}),a("el-table-column",{attrs:{label:"批次ID",align:"center",prop:"usageBatchId",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"text-nowrap"},[t._v(t._s(e.row.usageBatchId||"无"))])]}}])}),a("el-table-column",{attrs:{label:"申请人",align:"center",prop:"applicationUserName",width:"120"}}),a("el-table-column",{attrs:{label:"申请门店",align:"center",prop:"applicationStoreName",width:"150"}}),a("el-table-column",{attrs:{label:"申请时间",align:"center",prop:"applicationTime",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.formatDateTime(e.row.applicationTime)))])]}}])}),a("el-table-column",{attrs:{label:"审批状态",align:"center",prop:"approvalStatus",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{type:t.getStatusType(e.row.approvalStatus),size:"small"}},[t._v("\n\t\t\t\t\t\t\t"+t._s(e.row.approvalStatus||"无")+"\n\t\t\t\t\t\t")])]}}])}),a("el-table-column",{attrs:{label:"是否已领取",align:"center",prop:"isReceived",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{type:1===e.row.isReceived?"success":"info",size:"small"}},[t._v("\n\t\t\t\t\t\t\t"+t._s(1===e.row.isReceived?"已领取":"未领取")+"\n\t\t\t\t\t\t")])]}}])}),a("el-table-column",{attrs:{label:"领取时间",align:"center",prop:"receiveTime",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.receiveTime?t.formatDateTime(e.row.receiveTime):"无"))])]}}])}),a("el-table-column",{attrs:{label:"备注",align:"center",prop:"remarks","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.remarks||"无"))])]}}])}),a("el-table-column",{attrs:{label:"操作",width:"280",align:"left",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"action-buttons"},[a("el-button",{staticClass:"view-btn",attrs:{type:"text",icon:"el-icon-view"},on:{click:function(a){return t.viewBatchDetail(e.row)}}},[t._v("\n\t\t\t\t\t\t\t\t查看批次详情\n\t\t\t\t\t\t\t")]),"审批中"===e.row.approvalStatus?a("el-button",{staticClass:"approve-btn",attrs:{type:"text",icon:"el-icon-check"},on:{click:function(a){return t.approve(e.row)}}},[t._v("\n\t\t\t\t\t\t\t\t审批\n\t\t\t\t\t\t\t")]):t._e(),"已通过"===e.row.approvalStatus&&0===e.row.isReceived?a("el-button",{staticClass:"receive-btn",attrs:{type:"text",icon:"el-icon-finished"},on:{click:function(a){return t.markReceived(e.row)}}},[t._v("\n\t\t\t\t\t\t\t\t标记已领取\n\t\t\t\t\t\t\t")]):t._e()],1)]}}])})],1),a("pagination",{attrs:{total:t.total,page:t.query.currentPage,limit:t.query.pageSize},on:{"update:page":function(e){return t.$set(t.query,"currentPage",e)},"update:limit":function(e){return t.$set(t.query,"pageSize",e)},pagination:t.initData}})],1)],1),t.approvalDialogVisible?a("ApprovalDialog",{ref:"ApprovalDialog",on:{refresh:t.initData}}):t._e(),t.batchDetailDialogVisible?a("BatchDetailDialog",{ref:"BatchDetailDialog"}):t._e(),t.usageMultiFormVisible?a("UsageMultiForm",{ref:"UsageMultiForm",on:{refresh:t.initData}}):t._e()],1)},n=[],s=(a("f576"),a("456d"),a("ac6a"),a("5530")),o=a("b775"),r=a("9d50"),l=a("d166"),c=a("7d0e"),u=a("8b14"),p={components:{ApprovalDialog:l["default"],BatchDetailDialog:c["default"],UsageMultiForm:u["default"]},data:function(){return{loading:!1,list:[],total:0,query:{currentPage:1,pageSize:20,applicationStoreId:void 0,approvalStatus:void 0,isReceived:void 0},storeOptions:[],approvalDialogVisible:!1,batchDetailDialogVisible:!1,usageMultiFormVisible:!1}},created:function(){this.initStoreOptions(),this.initData()},methods:{initData:function(){var t=this;this.loading=!0;var e=Object(s["a"])({},this.query);Object.keys(e).forEach((function(t){void 0!==e[t]&&null!==e[t]&&""!==e[t]||delete e[t]})),Object(o["a"])({url:"/api/Extend/LqInventoryUsage/GetApplicationList",method:"GET",data:e}).then((function(e){200==e.code&&e.data?(t.list=e.data.list||[],t.total=e.data.pagination?e.data.pagination.total:0):(t.list=[],t.total=0),t.loading=!1})).catch((function(){t.loading=!1,t.list=[],t.total=0}))},initStoreOptions:function(){var t=this;Object(o["a"])({url:"/api/Extend/LqMdxx",method:"GET",data:{currentPage:1,pageSize:1e3}}).then((function(e){e.data&&e.data.list&&(t.storeOptions=e.data.list)})).catch((function(){t.storeOptions=[]}))},search:function(){this.query.currentPage=1,this.initData()},reset:function(){this.query={currentPage:1,pageSize:20,applicationStoreId:void 0,approvalStatus:void 0,isReceived:void 0},this.initData()},viewBatchDetail:function(t){var e=this;this.batchDetailDialogVisible=!0,this.$nextTick((function(){e.$refs.BatchDetailDialog.init(t.usageBatchId)}))},approve:function(t){var e=this;this.approvalDialogVisible=!0,this.$nextTick((function(){e.$refs.ApprovalDialog.init(t)}))},markReceived:function(t){var e=this;this.$confirm("确定要标记该申请为已领取吗?","提示",{type:"warning"}).then((function(){Object(r["j"])(t.id).then((function(t){e.$message({type:"success",message:t.msg||"标记成功",onClose:function(){e.initData()}})})).catch((function(){}))})).catch((function(){}))},addUsage:function(){var t=this;this.usageMultiFormVisible=!0,this.$nextTick((function(){t.$refs.UsageMultiForm.init()}))},getStatusType:function(t){var e={"待审批":"info","审批中":"warning","已通过":"success","未通过":"danger","已退回":"info"};return e[t]||"info"},formatDateTime:function(t){if(!t)return"无";var e=new Date(t),a=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(i,"-").concat(n," ").concat(s,":").concat(o,":").concat(r)}}},d=p,m=(a("31c9"),a("2877")),f=Object(m["a"])(d,i,n,!1,null,"01be9d06",null);e["default"]=f.exports},d166:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"NCC-dialog NCC-dialog_center",attrs:{title:"审批申请","close-on-click-modal":!1,visible:t.visible,"lock-scroll":"",width:"600px"},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{ref:"elForm",attrs:{model:t.dataForm,size:"small","label-width":"120px","label-position":"right",rules:t.rules}},[a("el-form-item",{attrs:{label:"申请编号"}},[a("span",[t._v(t._s(t.dataForm.id||"无"))])]),a("el-form-item",{attrs:{label:"申请人"}},[a("span",[t._v(t._s(t.dataForm.applicationUserName||"无"))])]),a("el-form-item",{attrs:{label:"申请门店"}},[a("span",[t._v(t._s(t.dataForm.applicationStoreName||"无"))])]),a("el-form-item",{attrs:{label:"申请时间"}},[a("span",[t._v(t._s(t.formatDateTime(t.dataForm.applicationTime)))])]),a("el-form-item",{attrs:{label:"审批状态"}},[a("el-tag",{attrs:{type:t.getStatusType(t.dataForm.approvalStatus),size:"small"}},[t._v("\n\t\t\t\t"+t._s(t.dataForm.approvalStatus||"无")+"\n\t\t\t")])],1),a("el-form-item",{attrs:{label:"备注"}},[a("span",[t._v(t._s(t.dataForm.remarks||"无"))])]),a("el-divider"),a("el-form-item",{attrs:{label:"审批结果",prop:"result"}},[a("el-radio-group",{model:{value:t.dataForm.result,callback:function(e){t.$set(t.dataForm,"result",e)},expression:"dataForm.result"}},[a("el-radio",{attrs:{label:"通过"}},[t._v("通过")]),a("el-radio",{attrs:{label:"不通过"}},[t._v("不通过")])],1)],1),a("el-form-item",{attrs:{label:"审批意见",prop:"opinion"}},[a("el-input",{attrs:{type:"textarea",rows:4,placeholder:"请输入审批意见(可选)",maxlength:"500","show-word-limit":""},model:{value:t.dataForm.opinion,callback:function(e){t.$set(t.dataForm,"opinion",e)},expression:"dataForm.opinion"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.visible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary",loading:t.btnLoading},on:{click:function(e){return t.dataFormSubmit()}}},[t._v("确 定")])],1)],1)},n=[],s=(a("f576"),a("9d50")),o={data:function(){return{visible:!1,btnLoading:!1,dataForm:{id:"",applicationUserName:"",applicationStoreName:"",applicationTime:null,approvalStatus:"",remarks:"",result:"通过",opinion:""},rules:{result:[{required:!0,message:"请选择审批结果",trigger:"change"}]}}},methods:{init:function(t){this.visible=!0,this.dataForm={id:t.id||"",applicationUserName:t.applicationUserName||"",applicationStoreName:t.applicationStoreName||"",applicationTime:t.applicationTime||null,approvalStatus:t.approvalStatus||"",remarks:t.remarks||"",result:"通过",opinion:""}},dataFormSubmit:function(){var t=this;this.$refs.elForm.validate((function(e){return!!e&&("审批中"!==t.dataForm.approvalStatus?(t.$message({type:"warning",message:"只有审批中状态的申请才能进行审批操作"}),!1):(t.btnLoading=!0,void Object(s["a"])(t.dataForm.id,t.dataForm.result,t.dataForm.opinion).then((function(e){t.btnLoading=!1,t.$message({type:"success",message:e.msg||"审批成功",onClose:function(){t.visible=!1,t.$emit("refresh")}})})).catch((function(){t.btnLoading=!1}))))}))},getStatusType:function(t){var e={"待审批":"info","审批中":"warning","已通过":"success","未通过":"danger","已退回":"info"};return e[t]||"info"},formatDateTime:function(t){if(!t)return"无";var e=new Date(t),a=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(i,"-").concat(n," ").concat(s,":").concat(o,":").concat(r)}}},r=o,l=(a("6aee"),a("2877")),c=Object(l["a"])(r,i,n,!1,null,"28e08eb6",null);e["default"]=c.exports},da34:function(t,e,a){},fb6d:function(t,e,a){"use strict";a("da34")}}]);