| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cbb261c","chunk-16a1dbdb","chunk-2d0aece5"],{"0c40":function(e,t,r){"use strict";r.r(t),r.d(t,"urlPrefix",(function(){return n})),r.d(t,"GetList",(function(){return o})),r.d(t,"AddObj",(function(){return i})),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/sample/";function o(e){return Object(a["c"])({url:n,method:"get",params:e})}function i(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"})}},"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 o(...e){for(const t of e)if(null==t||""===t)return!0;return!1}const i={isEmpty:a,isAllEmpty:n,hasEmpty:o};t["a"]=i},"9b6c":function(e,t,r){},b806: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/sample/import/"}},[e._v("导入 ")])],1),t("crud-toolbar",e._g(e._b({},"crud-toolbar",e._crudToolbarProps,!1),e._crudToolbarListeners))],1)])],2)},n=[],o=r("5530"),i=(r("d3b7"),r("d36f")),s=r("1fbf"),d=r("0c40"),l=r("22ce"),c={data:function(){return{exportLoading:!1}},name:"sample",mixins:[s["d2CrudPlus"].crud],activated:function(){s["d2CrudPlus"].util.dict.clear()},methods:{addRow:function(){s["d2CrudPlus"].util.dict.clear(),this.getD2Crud().showDialog({mode:"add"})},resolveSearchParams:function(e){var t=Object(o["a"])({ordering:this.ordering},e);return Array.isArray(t.demand_date)&&2===t.demand_date.length&&(t.demand_date_start=t.demand_date[0],t.demand_date_end=t.demand_date[1]),delete t.demand_date,t},getCrudOptions:function(){return Object(i["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/sample/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("e7cf"),r("2877")),m=Object(u["a"])(p,a,n,!1,null,null,null);t["default"]=m.exports},d36f:function(e,t,r){"use strict";r.r(t),r.d(t,"crudOptions",(function(){return i}));var a=r("5530"),n=r("47f4"),o=[],i=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,o="desc"===n?"-":"",i=o+r,s=e.getSearch().getForm(),d=Object(a["a"])({ordering:i},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:"项目名称",key:"project_name",fixed:"left",resizable:!0,minWidth:150,align:"center",search:{width:160,component:{props:{clearable:!0}}},type:"input",form:{rules:[{required:!0,message:"项目名称必填"}],component:{props:{clearable:!0},placeholder:"请输入项目名称"},itemProps:{class:{yxtInput:!0}}}},{title:"物料编码",key:"material_code",resizable:!0,minWidth:130,align:"center",search:{width:160,component:{props:{clearable:!0}}},type:"input",form:{rules:[{required:!0,message:"物料编码必填"}],component:{props:{clearable:!0},placeholder:"请输入物料编码"},itemProps:{class:{yxtInput:!0}}}},{title:"物料名称",key:"material_name",resizable:!0,minWidth:130,align:"center",search:{width:160,component:{props:{clearable:!0}}},type:"input",form:{rules:[{required:!0,message:"物料名称必填"}],component:{props:{clearable:!0},placeholder:"请输入物料名称"},itemProps:{class:{yxtInput:!0}}}},{title:"型号/规格",key:"model_spec",resizable:!0,minWidth:180,align:"center",className:"col-model-spec",component:{render:function(e,t){var r=null==t.value?"":String(t.value);return e("el-tooltip",{props:{content:r,placement:"top",effect:"dark",openDelay:200,disabled:!r}},[e("span",{class:"col-model-spec-text"},r)])}},search:{disabled:!1,width:160,component:{props:{clearable:!0}}},type:"input",form:{component:{props:{clearable:!0},placeholder:"请输入型号/规格"},itemProps:{class:{yxtInput:!0}}}},{title:"数量",key:"quantity",align:"center",minWidth:100,resizable:!0,type:"number",form:{value:1,rules:[{required:!0,message:"请输入数量"}],component:{props:{clearable:!0,min:1},placeholder:"请输入数量"},itemProps:{class:{yxtInput:!0}}}},{title:"单位",key:"unit",align:"center",minWidth:80,resizable:!0,type:"input",form:{value:"PCS",component:{props:{clearable:!0},placeholder:"请输入单位"},itemProps:{class:{yxtInput:!0}}}},{title:"需求日期",key:"demand_date",sortable:!0,align:"center",minWidth:170,resizable:!0,type:"datetime",search:{disabled:!1,width:370,component:{name:"el-date-picker",props:{type:"datetimerange","range-separator":"至","start-placeholder":"开始","end-placeholder":"结束",valueFormat:"yyyy-MM-dd HH:mm:ss"}}},form:{component:{props:{clearable:!0,format:"yyyy-MM-dd HH:mm:ss",valueFormat:"yyyy-MM-dd HH:mm:ss"},placeholder:"请选择需求日期"},itemProps:{class:{yxtInput:!0}}}},{title:"品牌/制造商",key:"brand_manufacturer",resizable:!0,minWidth:150,align:"center",search:{disabled:!1,width:160,component:{props:{clearable:!0}}},type:"input",form:{component:{props:{clearable:!0},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:o},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:"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}}]}}},e7cf:function(e,t,r){"use strict";r("9b6c")}}]);
|