| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b59e8114","chunk-b2714028","chunk-2d0e66a4"],{1236:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("d2-container",{class:{"page-compact":e.crud.pageOptions.compact}},[t("template",{slot:"header"},[e._v("出入库列表")]),t("d2-crud-x",e._g(e._b({directives:[{name:"loading",rawName:"v-loading",value:e.exportLoading,expression:"exportLoading"}],ref:"d2Crud"},"d2-crud-x",e._crudProps,!1),e._crudListeners),[t("div",{attrs:{slot:"header"},slot:"header"},[t("crud-search",{ref:"search",attrs:{options:e.crud.searchOptions},on:{submit:e.handleSearch}}),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.addRow}},[t("i",{staticClass:"el-icon-plus"}),e._v("新增 ")]),t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"Export",expression:"'Export'"}],staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"warning"},on:{click:e.onExport}},[t("i",{staticClass:"el-icon-download"}),e._v("导出 ")]),t("span",{staticStyle:{"margin-left":"10px"}},[t("importExcel",{directives:[{name:"permission",rawName:"v-permission",value:"Import",expression:"'Import'"}],attrs:{importApi:"api/myapp/stock/import/"}},[e._v("导入 ")])],1),t("crud-toolbar",e._g(e._b({},"crud-toolbar",e._crudToolbarProps,!1),e._crudToolbarListeners))],1)])],2)},n=[],i=r("5530"),o=(r("d3b7"),r("3e62")),s=r("1fbf"),d=r("993a"),l=r("22ce"),c={data:function(){return{exportLoading:!1}},name:"stock",mixins:[s["d2CrudPlus"].crud],methods:{resolveSearchParams:function(e){var t=Object(i["a"])({ordering:this.ordering},e);return Array.isArray(t.arrival_date)&&2===t.arrival_date.length&&(t.arrival_date_start=t.arrival_date[0],t.arrival_date_end=t.arrival_date[1]),delete t.arrival_date,Array.isArray(t.shipping_date)&&2===t.shipping_date.length&&(t.shipping_date_start=t.shipping_date[0],t.shipping_date_end=t.shipping_date[1]),delete t.shipping_date,t},getCrudOptions:function(){return Object(o["crudOptions"])(this)},pageRequest:function(e){return Object(d["GetList"])(this.resolveSearchParams(e))},addRequest:function(e){return Object(d["AddObj"])(e)},updateRequest:function(e){return Object(d["UpdateObj"])(e)},delRequest:function(e){return Object(d["DelObj"])(e.id)},onExport:function(){var e=this;this.$confirm("是否确认导出所有数据项?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var t=e.getSearch().getForm();e.exportLoading=!0;var r="/api/myapp/stock/export/";Object(l["a"])({url:r,params:e.resolveSearchParams(t),method:"post"}).finally((function(){e.exportLoading=!1}))})).catch((function(){e.exportLoading=!1}))}}},p=c,u=r("2877"),m=Object(u["a"])(p,a,n,!1,null,null,null);t["default"]=m.exports},"3e62":function(e,t,r){"use strict";r.r(t),r.d(t,"crudOptions",(function(){return o}));var a=r("5530"),n=r("47f4"),i=[],o=function(e){return{pageOptions:{compact:!0},options:{tableType:"vxe-table",rowKey:!0,rowId:"id",height:"100%",highlightCurrentRow:!0,events:{"sort-change":function(t){var r=t.field,n=t.order,i="desc"===n?"-":"",o=i+r,s=e.getSearch().getForm(),d=Object(a["a"])({ordering:o},s);e.doSearch(d)}}},rowHandle:{fixed:"right",align:"center",width:"170px",view:{thin:!0,text:""},edit:{thin:!0,text:""},remove:{thin:!0,text:""}},indexRow:{title:"序号",align:"center",resizable:!0,fixed:"left",width:90},viewOptions:{componentType:"form"},formOptions:{defaultSpan:24,width:"35%"},columns:[{title:"ID",key:"id",show:!1,disabled:!0,width:70,form:{disabled:!0}},{title:"SN码",key:"sn",fixed:"left",resizable:!0,minWidth:130,align:"center",search:{width:160,component:{props:{clearable:!0}}},type:"input",form:{editDisabled:!0,rules:[{required:!0,message:"SN码必填"}],component:{props:{clearable:!0},placeholder:"请输入SN码"},itemProps:{class:{yxtInput:!0}}}},{title:"供应商名称",key:"supplier_name",resizable:!0,align:"center",minWidth:150,search:{width:180,component:{props:{clearable:!0}}},type:"input",form:{rules:[{max:30,message:"最长30个字"}],component:{props:{clearable:!0},placeholder:"请输入供应商名称"},itemProps:{class:{yxtInput:!0}}}},{title:"到货日期",key:"arrival_date",sortable:!0,align:"center",minWidth:130,resizable:!0,type:"date",search:{disabled:!1,width:360,component:{name:"el-date-picker",props:{type:"daterange","range-separator":"至","start-placeholder":"开始","end-placeholder":"结束",valueFormat:"yyyy-MM-dd"}}},form:{rules:[{required:!1}],component:{props:{clearable:!0,format:"yyyy-MM-dd",valueFormat:"yyyy-MM-dd"},placeholder:"请选择到货日期"},itemProps:{class:{yxtInput:!0}}}},{title:"客户名称",key:"customer_name",resizable:!0,align:"center",minWidth:150,search:{width:180,component:{props:{clearable:!0}}},type:"input",form:{rules:[{max:30,message:"最长30个字"}],component:{props:{clearable:!0},placeholder:"请输入客户名称"},itemProps:{class:{yxtInput:!0}}}},{title:"出货时间",key:"shipping_date",sortable:!0,align:"center",minWidth:130,resizable:!0,type:"date",search:{disabled:!1,width:360,component:{name:"el-date-picker",props:{type:"daterange","range-separator":"至","start-placeholder":"开始","end-placeholder":"结束",valueFormat:"yyyy-MM-dd"}}},form:{rules:[{required:!1}],component:{props:{clearable:!0,format:"yyyy-MM-dd",valueFormat:"yyyy-MM-dd"},placeholder:"请选择出货时间"},itemProps:{class:{yxtInput:!0}}}},{title:"更新时间",key:"daterange",sortable:!0,type:"daterange",show:!1,search:{disabled:!1,width:390},form:{disabled:!0,component:{props:{"time-arrow-control":!1,"picker-options":{shortcuts:i},format:"yyyy-MM-dd HH:mm:ss",valueFormat:"yyyy-MM-dd HH:mm:ss"}}},valueBuilder:function(e,t){n["a"].hasEmpty(e.daterangeStart,e.daterangeEnd)||(e.daterange=[new Date(e.daterangeStart),new Date(e.daterangeEnd)])},valueResolve:function(e,t){null!=e.daterange&&e.daterange.length>1?(e.start_time=e.daterange[0],e.stop_time=e.daterange[1]):(e.start_time=null,e.stop_time=null)}},{title:"备注",key:"remark",align:"center",minWidth:180,resizable:!0,showOverflowTooltip:!0,type:"input",form:{rules:[{max:50,message:"最长50个字"}],component:{props:{clearable:!0},placeholder:"请输入备注"},itemProps:{class:{yxtInput:!0}}}},{title:"更新时间",key:"update_datetime",minWidth:170,align:"center",show:!0,type:"datetime",sortable:!0,form:{disabled:!0}},{title:"创建时间",key:"create_datetime",align:"center",minWidth:170,search:{disabled:!0},show:!0,type:"datetime",sortable:!0,form:{disabled:!0}}]}}},"47f4":function(e,t,r){"use strict";function a(e){return null==e||""===e}function n(...e){for(const t of e)if(null!=t&&""!==t)return!1;return!1}function i(...e){for(const t of e)if(null==t||""===t)return!0;return!1}const o={isEmpty:a,isAllEmpty:n,hasEmpty:i};t["a"]=o},"993a":function(e,t,r){"use strict";r.r(t),r.d(t,"urlPrefix",(function(){return n})),r.d(t,"GetList",(function(){return i})),r.d(t,"AddObj",(function(){return o})),r.d(t,"UpdateObj",(function(){return s})),r.d(t,"DelObj",(function(){return d})),r.d(t,"exportData",(function(){return l}));var a=r("22ce"),n="/api/myapp/stock/";function i(e){return Object(a["c"])({url:n,method:"get",params:e})}function o(e){return Object(a["c"])({url:n,method:"post",data:e})}function s(e){return Object(a["c"])({url:n+e.id+"/",method:"put",data:e})}function d(e){return Object(a["c"])({url:n+e+"/",method:"delete",data:{id:e}})}function l(e){return Object(a["a"])({url:n+"export/",params:e,method:"post"})}}}]);
|