chunk-0812dd4e.d9120dc4.js 3.9 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0812dd4e"],{"3dd5":function(e,t,i){"use strict";i("6b99")},"6b99":function(e,t,i){},b4a4:function(e,t,i){"use strict";i.r(t);var r=function(){var e=this,t=e._self._c;return t("div",[t("el-drawer",{attrs:{visible:e.showArea,size:"44vw","before-close":e.closeFn,"custom-class":"drawer-class",direction:"rtl"},on:{"update:visible":function(t){e.showArea=t}}},[t("div",[t("x-crud",{on:{load:e.onLoad},scopedSlots:e._u([{key:"table-column-cover",fn:function({scope:e}){return[t("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover"}},[t("div",{staticStyle:{width:"200px",height:"200px"}},[t("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover"},attrs:{src:e.row.bigCover}})]),t("div",{staticStyle:{width:"40px"},attrs:{slot:"reference"},slot:"reference"},[t("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover","border-radius":"5px"},attrs:{src:e.row.cover}})])])]}},{key:"table-column-name",fn:function({scope:i}){return[t("span",{staticStyle:{"font-size":"16px"}},[e._v(e._s(i.row.name))])]}},{key:"table-column-stock",fn:function({scope:i}){return[t("span",{staticStyle:{"font-size":"13px"}},[e._v(e._s(i.row.stock?parseFloat(i.row.stock):0))])]}},{key:"table-column-showUsePrice",fn:function({scope:i}){return[t("el-input",{attrs:{placeholder:"价格"},model:{value:i.row.showUsePrice,callback:function(t){e.$set(i.row,"showUsePrice",t)},expression:"scope.row.showUsePrice"}})]}},{key:"table-column-bigCount",fn:function({scope:i}){return[t("el-input",{attrs:{placeholder:"数量"},model:{value:i.row.bigCount,callback:function(t){e.$set(i.row,"bigCount",t)},expression:"scope.row.bigCount"}})]}},{key:"slot-column-option",fn:function({scope:i}){return[t("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(t){return t.stopPropagation(),e.confirmAdd(i.row)}}},[e._v("添加")])]}},{key:"slot-option-area-list",fn:function(){return[t("el-input",{ref:"itemSearchRef",staticStyle:{width:"200px"},attrs:{placeholder:"搜索花材",size:"big",clearable:!0},on:{input:function(t){return e.changeSearch()},focus:function(t){e.search=""}},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),t("el-button",{staticStyle:{"margin-left":"30px"},attrs:{size:"medium",type:"primary"},on:{click:function(t){return t.stopPropagation(),e.closeFn()}}},[e._v("关闭")])]},proxy:!0}])})],1)])],1)},s=[],o={name:"simple-item",props:{simpleData:{type:Object,default:()=>{}}},data(){return{showArea:!1,search:""}},methods:{changeSearch(){let e=this;null!=this.T&&clearTimeout(this.T),this.T=setTimeout((function(){e.app.refresh({name:this.search})}),650)},init(){this.showArea=!0,this.search="",this.app&&this.app.refresh({name:this.search}),this.$nextTick(()=>{this.$refs.itemSearchRef.focus()})},closeFn(){this.showArea=!1},confirmAdd(e){if(Number(e.bigCount)<=0)return this.$message.error("请填写数量"),!1;let t=Number(e.showUsePrice)>0?e.showUsePrice:100,i=[{id:e.id,bigCount:e.bigCount,price:t}];this.$service.orderItem.addItem({data:JSON.stringify(i),id:this.simpleData.id}).then(e=>{this.$message.success("添加成功"),this.$emit("renewArrival",this.simpleData)})},onLoad({ctx:e,app:t}){this.app=t;let i=()=>this.$service.item.simpleList({name:this.search});e.service({page:i}).set("table",{columns:[{label:"ID",prop:"id",align:"center",width:70},{label:"图片",prop:"cover",align:"center",width:65},{label:"名称",prop:"name",align:"center",width:200},{label:"库存",prop:"stock",align:"center",width:90},{label:"价格",prop:"showUsePrice",align:"center",width:100},{label:"数量",prop:"bigCount",align:"center",width:100}],op:{visible:!0,props:{width:130,align:"center",fixed:"right",label:"操作"},layout:["slot-column-option"]}}).set("layout",[["slot-option-area-list"],["data-table"],["flex1"]]).done(),t.refresh({name:this.search})}}},n=o,a=(i("3dd5"),i("1805")),c=Object(a["a"])(n,r,s,!1,null,"5e6f1863",null);t["default"]=c.exports}}]);